50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


asymmetry.measures (version 0.2)

q.sample: Switch between a range of available quantile functions.

Description

Returns the quantiles of selected distributions at user specified locations.

Usage

q.sample(s,dist, p1=0,p2=1)

Arguments

s

A scalar or vector: the probabilities where the quantile function will be evaluated.

dist

Character string, used as a switch to the user selected distribution function (see details below).

p1

A scalar. Parameter 1 (vector or object) of the selected distribution.

p2

A scalar. Parameter 2 (vector or object) of the selected distribution.

Value

A vector containing the quantile values at the user specified points s.

Details

Based on user-specified argument dist, the function returns the value of the quantile function at s.

Supported distributions (along with the corresponding dist values) are:

  • weib: The quantile function for the weibull distribution is implemented as Q(s)=p1(log(1s))1/p2 where p1 is the shape parameter and p2 the scale parameter.

  • lognorm: The lognormal distribution has quantile function implemented as Q(s)=exp{p1+2p22erf1(2s1)} where p1 is the mean, p2 is the standard deviation and erf is the Gauss error function.

  • norm: The normal distribution has quantile function implemented as Q(p)=Φ1(s;p1,p2) where p1 is the mean and the p2 is the standard deviation.

  • uni: The uniform distribution has quantile function implemented as Q(s;p1,p2)=s(p2p1)+p1 for p1<s<p2.

  • cauchy: The cauchy distribution has quantile function implemented as Q(s)=p1+p2tan{π(s12)} where p1 is the location parameter and p2 the scale parameter.

  • fnorm: The half normal distribution has quantile function implemented as Q(s)=p12erf1(s) where and p1 is the standard deviation of the distribution.

  • normmix: The quantile function normal mixture distribution is estimated numericaly, based on the built in quantile function.

  • skewnorm: There is no closed form expression for the quantile function of the skew normal distribution. For this reason, the quantiles are calculated through the qsn function of the sn package.

  • fas:There is no closed form expression for the quantile function of the Fernandez and Steel distribution. For this reason, the quantiles are calculated through the qskt function of the skewt package.

  • shash:There is no closed form expression for the quantile function of the Sinh-Arcsinh distribution. For this reason, the quantiles are calculated through the qSHASHo function of the gamlss package.

References

Bagkavos D., Patil P.N., Wood A.T.A. (2016), A Numerical Study of the Power Function of a New Symmetry Test. In: Cao R., Gonzalez Manteiga W., Romo J. (eds) Nonparametric Statistics. Springer Proceedings in Mathematics and Statistics, vol 175, Springer.

See Also

r.sample, d.sample, p.sample

Examples

Run this code
# NOT RUN {
selected.q <- "norm" #select Normal as the distribution
shape <- 2  # specify shape parameter
scale <- 2 # specify scale parameter
xout <- seq(0.1,1,length=50)  #design point where the quantile function is evaluated
q.sample(xout,selected.q,shape,scale)  # calculate quantiles at xout
  
# }

Run the code above in your browser using DataLab