asynorm: The asymmetric normal distribution.

asynormR 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 length(n) > 1, the length is taken to be the number required.

Details

The asymmetric normal distribution has the following density
f(x) = (2√{τ(1-τ)/π}/σ)/(√{1-τ} + √{τ)}\exp(-|(τ - (x <= μ))|*(x - μ)^2/σ^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 τ = 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')

dirttee documentation built on Sept. 14, 2022, 5:06 p.m.