vonmises {VGAM} | R Documentation |
Estimates the location and scale parameters of the von Mises distribution by maximum likelihood estimation.
vonmises(llocation = "elogit", lscale = "loge", elocation = if(llocation == "elogit") list(min = 0, max = 2*pi) else list(), escale = list(), ilocation = NULL, iscale = NULL, imethod = 1, zero = NULL)
llocation, lscale |
Parameter link functions applied to the location a parameter
and scale parameter k, respectively.
See |
elocation, escale |
List. Extra argument for each of the link functions.
See |
ilocation |
Initial value for the location a parameter.
By default, an initial value is chosen internally using
|
iscale |
Initial value for the scale k parameter.
By default, an initial value is chosen internally using
|
imethod |
An integer with value |
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}. |
The (two-parameter) von Mises is the most commonly used distribution in practice for circular data. It has a density that can be written as
f(y;a,k) = exp[k*cos(y-a)] / (2*pi*I0(k))
where 0 <= y < 2*pi, k>0 is the scale parameter, a is the location parameter, and I0(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 - I1(k) / I0(k) where I1(k) is the modified Bessel function of order 1. By default, eta1=log(a/(2*pi-a)) and eta2=log(k) for this family function.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
rrvglm
and vgam
.
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
.
The response and the fitted values are scaled so that 0<=y<2*pi. The linear/additive predictors are left alone. Fisher scoring is used.
T. W. Yee
Evans, M., Hastings, N. and Peacock, B. (2000) Statistical Distributions, New York: Wiley-Interscience, Third edition.
CircStats and circular currently have a lot more R functions for circular data than the VGAM package.
vdata = data.frame(x2 = runif(nn <- 1000)) vdata = transform(vdata, y = rnorm(nn, m = 2+x2, sd = exp(0.2))) # Bad data!! fit = vglm(y ~ x2, vonmises(zero = 2), vdata, trace = TRUE) coef(fit, matrix = TRUE) Coef(fit) with(vdata, range(y)) # original data range(fit@y) # processed data is in [0,2*pi)