Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ std_normal_lcdf() [2/2]

template<const char * func = internal::std_normal_lcdf_func, typename T_y , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y > * = nullptr>
return_type_t< T_y > stan::math::std_normal_lcdf ( const T_y &  y)
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.

Template Parameters
funcname 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_yA vector or scalar type for the random variable.
Parameters
y(Sequence of) scalar(s).
Returns
The log of the standard normal cdf evaluated at the specified argument. If given a container, the log of the product of the cdfs.

Definition at line 56 of file std_normal_lcdf.hpp.