Last chance! 50% off unlimited learning
Sale ends in
Returns the quantiles of selected distributions at user specified locations.
q.sample(s,dist, p1=0,p2=1)
A scalar or vector: the probabilities where the quantile function will be evaluated.
Character string, used as a switch to the user selected distribution function (see details below).
A scalar. Parameter 1 (vector or object) of the selected distribution.
A scalar. Parameter 2 (vector or object) of the selected distribution.
A vector containing the quantile values at the user specified points s
.
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
lognorm: The lognormal distribution has quantile function implemented as
norm: The normal distribution has quantile function implemented as
uni: The uniform distribution has quantile function implemented as
cauchy: The cauchy distribution has quantile function implemented as
fnorm: The half normal distribution has quantile function implemented as
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.
# 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