asynorm {dirttee} | R Documentation |
The asymmetric normal distribution.
Description
Density, distribution function, quantile function and random generation for the asymmetric normal distribution with the parameters mu
, sigma
and tau
.
Usage
dasynorm(x, mu = 0, sigma = 1, tau = 0.5)
pasynorm(q, mu = 0, sigma = 1, tau = 0.5)
qasynorm(p, mu = 0, sigma = 1, tau = 0.5)
rasynorm(n, mu = 0, sigma = 1, tau = 0.5)
Arguments
q |
vector of quantiles. |
mu |
location parameter and mode of the distribution. |
sigma |
comparable to the standard deviation. Must be positive. |
tau |
asymmetry parameter. |
x |
vector of locations. |
p |
vector of probabilities. |
n |
number of observations. If |
Details
The asymmetric normal distribution has the following density
f(x) = (2\sqrt{\tau(1-\tau)/\pi}/\sigma)/(\sqrt{1-\tau} + \sqrt{\tau)}\exp(-|(\tau - (x <= \mu))|*(x - \mu)^2/\sigma^2)
The cdf is derived by integration of the distribution function by using the integrate
function.
Value
dasynorm
gives the density, pasynorm
gives the distribution function, qasynorm
gives the quantile function, and rasynorm
generates random deviates.
Corresponds to the normal distribution for \tau = 0.5
.
The length of the result is determined by n
for rasynorm
, and is the maximum of the lengths of the numerical arguments for the other functions.
The numerical arguments other than n
are recycled to the length of the result.
Examples
hist(rasynorm(1000))
qg <- qasynorm(0.1, 1, 2, 0.5)
pasynorm(qg, 1, 2, 0.5)
ax <- c(1:1000)/100-5
plot(ax,dasynorm(ax), type = 'l')