![]() |
Stan Math Library
5.3.0
Automatic Differentiation
|
|
inline |
Calculates the log of the cdf of the standard normal distribution.
The piecewise structure here is the same as normal_lcdf, and the cutoffs, their provenance and the measurements behind them are documented once, on that function. See prim/prob/normal_lcdf.hpp. That covers the A&S 7.1.26, Cody (1969) and DLMF 7.12.1 references, the R pnorm and SciPy log_ndtr cross-references, why the erfc/Cody crossover sits at 4, the stan-dev/math#1411 origin of the interior Taylor cutoffs, and the two cutoff tables.
Two differences apply when reading it here. The scaled variable is scaled_y = y * INV_SQRT_TWO, not scaled_diff = (y - mu) / (sigma * SQRT_TWO); since mu = 0 and sigma = 1 the two coincide, so every cutoff value transfers unchanged. And the test that enforces the worst in-range column for this function is the branch_accuracy test in mix/prob/std_normal_cdf_log_test.cpp.
| func | name reported by the error checks. Reflected distributions such as std_normal_lccdf delegate here and pass their own name so that exceptions name the function the user actually called. |
| T_y | A vector or scalar type for the random variable. |
| y | (Sequence of) scalar(s). |
Definition at line 56 of file std_normal_lcdf.hpp.