qnormFast function

Quantile function of a normal distribution

Quantile function of a normal distribution

Calculate quantile of a normal distribution using one of the available methods.

qnormFast( p, mean = 0L, sd = 1L, method = "Voutier", is_validation = TRUE, n_cores = 1L )

Arguments

  • p: numeric vector of values between 0 and 1 representing levels of the quantiles.
  • mean: numeric value representing the expectation of a normal distribution.
  • sd: positive numeric value representing standard deviation of a normal distribution.
  • method: character representing the method to be used for quantile calculation. Available options are "Voutier" (default) and "Shore".
  • is_validation: logical value indicating whether input arguments should be validated. Set it to FALSE to get performance boost (default value is TRUE).
  • n_cores: positive integer representing the number of CPU cores used for parallel computing. Currently it is not recommended to set n_cores > 1 if vectorized arguments include less then 100000 elements.

Returns

The function returns a vector of p-level quantiles of a normal distribution with mean equal to mean and standard deviation equal to sd.

Details

If method = "Voutier" then the method of P. Voutier (2010) is used which maximum absolute error is about 0.0000250.000025. If method = "Shore" then the approach proposed by H. Shore (1982) is applied which maximum absolute error is about 0.0260.026 for quantiles of level between 0.00010.0001

and 0.99990.9999.

Examples

qnormFast(c(0.1, 0.9), mean = 1, sd = 2)

References

H. Shore (1982) doi:10.2307/2347972

P. Voutier (2010) doi:10.48550/arXiv.1002.0567

  • Maintainer: Bogdan Potanin
  • License: GPL (>= 2)
  • Last published: 2023-11-29

Useful links