SkewNormalDistribution {fSeries}R Documentation

Skew Normal Distribution

Description

A collection and description of functions to compute density, distribution function, quantile function and to generate random variates for the skew normal distribution.

The functions are:

[dpqr]norm Normal distribution from R's base package,
[dpqr]snorm Skew Normal distribution.

Usage

dsnorm(x, mean = 0, sd = 1, xi = 1.5)
psnorm(q, mean = 0, sd = 1, xi = 1.5)
qsnorm(p, mean = 0, sd = 1, xi = 1.5)
rsnorm(n, mean = 0, sd = 1, xi = 1.5)

Arguments

mean, sd, xi location parameter mean, scale parameter sd, skewness parameter xi.
n number of observations.
p a numeric vector of probabilities.
x, q a numeric vector of quantiles.

Details

Symmetric Normal Distibution:

The functions for the normal distribution are part of R's base package.

Skew Normal Distribution:

The skew normal distribution functions are defined as described by Fernandez and Steel (2000).

Value

All values are numeric vectors: d* returns the density, p* returns the distribution function, q* returns the quantile function, and r* generates random deviates.

Author(s)

Diethelm Wuertz for the Rmetrics R-port.

References

Fernandez C., Steel M.F.J. (2000); On Bayesian Modelling of Fat Tails and Skewness, Preprint, 31 pages.

See Also

sstdDistribution, sgedDistribution.

Examples

## snorm -
   xmpSeries("\nStart: Skew Normal Distribuion:  > ")
   par(mfrow = c(2, 2), cex = 0.75)
   set.seed(1953)
   r = rsnorm(n = 1000, mean = 1, sd = 0.5, xi = 1.5)
   plot(r, type = "l", main = "snorm: xi = 1.5")
   # Plot empirical density and compare with true density:
   hist(r, n = 25, probability = TRUE, border = "white", col = "steelblue4")
   x = seq(-4, 6, 0.1)
   lines(x, dsnorm(x = x, mean = 1, sd = 0.5, xi = 1.5))
   # Plot df and compare with true df:
   plot(sort(r), (1:1000/1000), main = "Probability", col = "steelblue4")
   lines(x, psnorm(x, mean = 1, sd = 0.5, xi = 1.5))
   # Compute quantiles:
   qsnorm(psnorm(q = -4:6, mean = 1, sd = 0.5, xi = 1.5), 
     mean = 1, sd = 0.5, xi = 1.5) 

[Package fSeries version 200.10058 Index]