Learn R Programming

lmom (version 1.0)

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))

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).

Value

  • cdfgno gives the distribution function; quagno gives the quantile function.

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(1-k(x-\xi)/\alpha)$$ 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$;" reverse="" lognormal="">0$, with a finite upper bound and negative skewness.

See Also

cdfnor for the lmom package's version of the normal distribution. pnorm for the standard Rversion of the normal distribution. qlnorm for the standard Rversion of the 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