source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/normcdflogit.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

  • Property svn:executable set to *
File size: 645 bytes
Line 
1function e = normcdflogit(x)
2% NORMCDFLOGIT   log(normcdf/(1-normcdf))
3% More accurate than explicitly evaluating log(normcdf/(1-normcdf)), and
4% retains more precision than normcdfln when x is large.
5
6% Written by Tom Minka
7% (c) Microsoft Corporation. All rights reserved.
8
9e = x;
10small = -7;
11large = 7;
12i = find(x >= small & x <= large);
13if ~isempty(i)
14  e(i) = normcdf(x(i));
15  e(i) = log(e(i)./(1-e(i)));
16end
17i = find(x < small);
18if ~isempty(i)
19  e(i) = normcdfln(x(i));
20  %e(i) = e(i) - log(1-exp(e(i)));
21end
22i = find(x > large);
23if ~isempty(i)
24  e(i) = -normcdfln(-x(i));
25  %e(i) = log(1-exp(-e(i))) + e(i);
26end
Note: See TracBrowser for help on using the repository browser.