skewn: Density function, distribution function, quantiles and random...

Usage Arguments Details Value References Examples

Usage

1
2
3
4
5
6
7
8
9
dsn(x, xi = 0, omega = 1, alpha = 0, tau = 0, dp = NULL,
  log = FALSE)

psn(x, xi = 0, omega = 1, alpha = 0, tau = 0, dp = NULL, engine, ...)

qsn(p, xi = 0, omega = 1, alpha = 0, tau = 0, dp = NULL,
  tol = 1e-08, solver = "NR", ...)

rsn(n = 1, xi = 0, omega = 1, alpha = 0, tau = 0, dp = NULL)

Arguments

x

vector of quantiles. Missing values (NA<e2><80><99>s) andInf<e2><80><99>s are allowed.

xi

vector of location parameters.

omega

vector of scale parameters; must be positive

alpha

vector of slant parameter(s);+/- Infis allowed. Withpsn, it must be of length 1 ifengine="T.Owen". With qsn, it must be of length 1

tau

a single value representing the <e2><80><98>hidden mean<e2><80><99> parameter of theESNdistribution; tau=0 (default) corresponds to a SN distribution.

dp

a vector of length 3 (in the SN case) or 4 (in the ESN case), whose components represent the individual parameters described above. If dp is specified, the individual parameters cannot be set.

log

logical flag used in dsn (defaul tFALSE). When TRUE, the logarithm of the density values is returned.

engine

a character string which selects the computing engine; this is either "T.Owen" or "biv.nt.prob", the latter from package mnormt. If tau != 0 or length(alpha)>1, "biv.nt.prob" must be used. If this argument is missing, a default selection rule is applied.

...

additional parameters passed to T.Owen

p

vector of probabilities. Missing values (NAs) are allowed

tol

a scalar value which regulates the accuracy of the result of qsn, measured on the probability scale.

solver

a character string which selects the numerical method used for solving the quan-tile equation; possible options are "NR" (default) and "RFB", described in the <e2><80><98>Details<e2><80><99> section

n

a positive integer representing the sample size.

Details

psn and qsn make use of function T.Owen or biv.nt.prob

In qsn, the choice solver="NR" selects the Newton-Raphson method for solving the quantile equation, while optionsolver="RFB" alternates a step of regula falsi with one of bisection. The "NR" method is generally more efficient, but "RFB" is occasionally required in some problematic cases.

Value

density (dsn), probability (psn), quantile (qsn) or random sample (rsn) from the skew-normal dis-tribution with given xi,omega and alpha parameters or from the extended skew-normal if tau!=0

References

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

Azzalini, A. with the collaboration of Capitanio, A. (2014).The Skew-Normal and Related Families.Cambridge University Press, IMS Monographs series.

Examples

1
2
3
4
5
pdf <- dsn(seq(-3, 3, by=0.1), alpha=3)
cdf <- psn(seq(-3, 3, by=0.1), alpha=3)
q <- qsn(seq(0.1, 0.9, by=0.1), alpha=-2)
r <- rsn(100, 5, 2, 5)
qsn(1/10^(1:4), 0, 1, 5, 3, solver="RFB")

dangulod/ECTools documentation built on May 4, 2019, 3:19 p.m.