Learn R Programming

VGAM (version 0.7-1)

vonmises: von Mises Distribution Family Function

Description

Estimates the location and scale parameters of the von Mises distribution by maximum likelihood estimation.

Usage

vonmises(lscale="loge", ilocation=NULL,
         iscale=NULL, method.init=1, zero=NULL)

Arguments

lscale
Parameter link function applied to the scale parameter $k$. See Links for more choices. A log link is the default because the parameter is positive.
ilocation
Initial value for the location $a$ parameter. By default, an initial value is chosen internally using method.init. Assigning a value will override the argument method.init.
iscale
Initial value for the scale $k$ parameter. By default, an initial value is chosen internally using method.init. Assigning a value will override the argument method.init.
method.init
An integer with value 1 or 2 which specifies the initialization method. If failure to converge occurs try the other value, or else specify a value for ilocation and iscale.
zero
An integer-valued vector specifying which linear/additive predictors are modelled as intercepts only. The default is none of them. If used, choose one value from the set {1,2}.

Value

Warning

Numerically, the von~Mises can be difficult to fit because of a log-likelihood having multiple maxima. The user is therefore encouraged to try different starting values, i.e., make use of ilocation and iscale.

Details

The (two-parameter) von Mises distribution has a density that can be written as $$f(y;a,k) = \frac{\exp[k\cos(y-a)]}{ 2\pi I_0(k)}$$ where $0 \leq y < 2\pi$, $k>0$ is the scale parameter, $a$ is the location parameter, and $I_0(k)$ is the modified Bessel function of order 0 evaluated at $k$. The mean of $Y$ (which is the fitted value) is $a$ and the circular variance is $1 - I_1(k) / I_0(k)$ where $I_1(k)$ is the modified Bessel function of order 1. By default, $\eta_1=a$ and $\eta_2=\log(k)$ for this family function, but later an extended logit link $\eta_1=\log(a/(2\pi-a))$ might be provided for $\eta_1$.

References

Evans, M., Hastings, N. and Peacock, B. (2000) Statistical Distributions, New York: Wiley-Interscience, Third edition.

See Also

Bessel.

CircStats and circular currently have a lot more R functions for circular data than the VGAM package.

Examples

Run this code
x = runif(n <- 1000)
y = rnorm(n, m=2+x, sd=exp(0.2))   # Not von Mises data!!
fit = vglm(y  ~ x, vonmises(zero=2), trace=TRUE)
coef(fit, matrix=TRUE)
Coef(fit)
range(y)       # original data
range(fit@y)   # processed data is in [0,2*pi)

Run the code above in your browser using DataLab