Learn R Programming

sn (version 0.22.1)

dsn: Skew-Normal Distribution

Description

Density function, distribution function, quantiles and random number generation for the skew-normal (SN) distribution.

Usage

dsn(x, location=0, scale=1, shape=0)
psn(q, location=0, scale=1, shape=0)
qsn(p, location=0, scale=1, shape=0, tol=1e-8)
rsn(n=1, location=0, scale=1, shape=0)

Arguments

x
vector of quantiles. Missing values (NAs) are allowed.
q
vector of quantiles. Missing values (NAs) are allowed.
p
vector of probabilities. Missing values (NAs) are allowed.
location
vector of location parameters.
scale
vector of (positive) scale parameters.
shape
vector of shape parameters. With psn and `qsn", it must be of length 1.
n
sample size.
tol
a scal value which regulates the accuracy of the result.

Value

  • density (dsn), probability (psn), quantile (qsn) or random sample (rsn) from the skew-normal distribution with given location, scale and shape parameters.

Background

The family of skew-normal distributions is an extension of the normal family, via the introdution of a shape parameter which regulates skewness; when shape=0, the skew-normal distribution reduces to the normal one. The density of the SN distribution when location=0 and scale=1 is 2*dnorm(x)*pnorm(shape*x). A multivariate version of the distribution exists. See the references below for additional information.

Details

psn make use of function T.Owen

References

Azzalini, A. (1985). A class of distributions which includes the normal ones. Scand. J. Statist. 12, 171-178.

Azzalini, A. and Dalla Valle, A. (1996). The multivariate skew-normal distribution. Biometrika 83, 715--726.

See Also

T.Owen, dmsn, sn.mle

Examples

Run this code
pdf <- dsn(seq(-3,3,by=0.1), shape=3)
cdf <- psn(seq(-3,3,by=0.1), shape=3)
qu <- qsn(seq(0.1,0.9,by=0.1), shape=-2)
rn <- rsn(100, 5, 2, 5)

Run the code above in your browser using DataLab