Learn R Programming

VGAM (version 0.8-7)

levy: Levy Distribution Family Function

Description

Estimates the two parameters of the Levy distribution by maximum likelihood estimation.

Usage

levy(delta = NULL, link.gamma = "loge", earg=list(),
     idelta = NULL, igamma = NULL)

Arguments

delta
Location parameter. May be assigned a known value, otherwise it is estimated (the default).
link.gamma
Parameter link function for the (positive) $\gamma$ parameter. See Links for more choices.
earg
List. Extra argument for the link. See earg in Links for general information.
idelta
Initial value for the $\delta$ parameter (if it is to be estimated). By default, an initial value is chosen internally.
igamma
Initial value for the $\gamma$ parameter. By default, an initial value is chosen internally.

Value

  • An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, and vgam.

Details

The Levy distribution is one of three stable distributions whose density function has a tractable form. The formula for the density is $$f(y;\gamma,\delta) = \sqrt{\frac{\gamma}{2\pi}} \exp \left( \frac{-\gamma}{2(y - \delta)} \right) / (y - \delta)^{3/2}$$ where $\delta0$. The mean does not exist.

References

Nolan, J. P. (2005) Stable Distributions: Models for Heavy Tailed Data.

See Also

The Nolan article is at http://academic2.american.edu/~jpnolan/stable/chap1.pdf.

Examples

Run this code
nn = 1000; delta = 0
mygamma = 1         # log link ==> 0 is the answer
ldat = data.frame(y = delta + mygamma/rnorm(nn)^2) # Levy(mygamma, delta)

# Cf. Table 1.1 of Nolan for Levy(1,0)
with(ldat, sum(y > 1) / length(y))  # Should be 0.6827
with(ldat, sum(y > 2) / length(y))  # Should be 0.5205

fit = vglm(y ~ 1, levy(delta=delta), ldat, trace=TRUE) # 1 parameter
fit = vglm(y ~ 1, levy(idelta=delta, igamma=mygamma),
           ldat, trace=TRUE)    # 2 parameters
coef(fit, matrix=TRUE)
Coef(fit)
summary(fit)
head(weights(fit, type="w"))

Run the code above in your browser using DataLab