Learn R Programming

lmom (version 3.2)

cdfgno: Generalized normal distribution

Description

Distribution function and quantile function of the generalized normal distribution.

Usage

cdfgno(x, para = c(0, 1, 0))
quagno(f, para = c(0, 1, 0))

Value

cdfgno gives the distribution function;

quagno gives the quantile function.

Arguments

x

Vector of quantiles.

f

Vector of probabilities.

para

Numeric vector containing the parameters of the distribution, in the order \(\xi, \alpha, k\) (location, scale, shape).

Details

The generalized normal distribution with location parameter \(\xi\), scale parameter \(\alpha\) and shape parameter \(k\) has distribution function $$F(x)=\Phi(y)$$ where $$y=-k^{-1}\log\lbrace1-k(x-\xi)/\alpha\rbrace$$ and \(\Phi(y)\) is the distribution function of the standard normal distribution, with \(x\) bounded by \(\xi+\alpha/k\) from below if \(k<0\) and from above if \(k>0\).

The generalized normal distribution contains as special cases the usual three-parameter lognormal distribution, corresponding to \(k<0\), with a finite lower bound and positive skewness; the normal distribution, corresponding to \(k=0\); and the reverse lognormal distribution, corresponding to \(k>0\), with a finite upper bound and negative skewness. The two-parameter lognormal distribution, with a lower bound of zero and positive skewness, is obtained when \(k<0\) and \(\xi+\alpha/k=0\).

See Also

cdfln3 for the lmom package's version of the three-parameter lognormal distribution.

cdfnor for the lmom package's version of the normal distribution.

pnorm for the standard R version of the normal distribution.

plnorm for the standard R version of the two-parameter lognormal distribution.

Examples

Run this code
# Random sample from the generalized normal distribution
# with parameters xi=0, alpha=1, k=-0.5.
quagno(runif(100), c(0,1,-0.5))

# The generalized normal distribution with parameters xi=1, alpha=1, k=-1,
# is the standard lognormal distribution.  An illustration:
fval<-seq(0.1,0.9,by=0.1)
cbind(fval, lognormal=qlnorm(fval), g.normal=quagno(fval, c(1,1,-1)))

Run the code above in your browser using DataLab