asynorm | R Documentation |
Density, distribution function, quantile function and random generation for the asymmetric normal distribution with the parameters mu
, sigma
and tau
.
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)
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 |
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.
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.
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.