Skip to contents

The standard normal distribution's functions as scipy.special computes them, for code that needs SciPy's values rather than a distribution family.

Usage

sc_ndtr(x)

sc_log_ndtr(x)

sc_ndtri(y)

sc_ndtri_exp(y)

sc_owens_t(h, a)

Arguments

x

Numeric or complex vector.

y

Numeric vector: probabilities for sc_ndtri(), log probabilities (at most 0) for sc_ndtri_exp().

h, a

Numeric vectors.

Value

A double vector, or a complex vector for complex input.

Details

  • sc_ndtr(): the cumulative distribution function \(\Phi(x)\), complex. Base R: stats::pnorm().

  • sc_log_ndtr(): \(\log \Phi(x)\), accurate far into the lower tail, complex. Base R: pnorm(x, log.p = TRUE).

  • sc_ndtri(): the quantile function, the inverse of sc_ndtr(). Base R: stats::qnorm().

  • sc_ndtri_exp(): the inverse of sc_log_ndtr(), for log probabilities too small for exp(). Base R: qnorm(y, log.p = TRUE).

  • sc_owens_t(): Owen's T function \(T(h, a)\), which gives bivariate and skew-normal probabilities.

Arguments are recycled: each must have length one or the common length. NA gives NA; NaN is evaluated as SciPy does. The result takes its dimensions, or else its names, from the arguments as base R arithmetic does, and so does each element of a list result. Conditions the kernels raise, such as a pole, are handled as sc_seterr() says.

Other packages

In gsl: erf_Q(x), the upper tail, which is sc_ndtr(-x).

Examples

sc_ndtr(c(-1, 0, 1))
#> [1] 0.1586553 0.5000000 0.8413447
sc_log_ndtr(-40)
#> [1] -804.6084
sc_ndtri(0.975)
#> [1] 1.959964
sc_ndtri_exp(-1000)
#> [1] -44.61575
sc_owens_t(0.5, 2)
#> [1] 0.1415806