Estimates the location and scale parameters of the von Mises distribution by maximum likelihood estimation.
vonmises(llocation = extlogitlink(min = 0, max = 2*pi),
lscale = "loglink", ilocation = NULL, iscale = NULL,
imethod = 1, zero = NULL)
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions
such as vglm
,
rrvglm
and vgam
.
Parameter link functions applied to the
location Links
for more choices.
For
Initial value for the location imethod
. Assigning a value will override
the argument imethod
.
Initial value for the scale imethod
. Assigning a value will override
the argument imethod
.
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
.
An integer-valued vector specifying which
linear/additive predictors are modelled as intercepts only.
The default is none of them.
If used, one can choose one value from the set {1,2}.
See CommonVGAMffArguments
for more information.
T. W. Yee
Numerically, the von Mises can be difficult to fit because of a
log-likelihood having multiple maximums.
The user is therefore encouraged to try different starting values,
i.e., make use of ilocation
and iscale
.
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
Forbes, C., Evans, M., Hastings, N. and Peacock, B. (2011). Statistical Distributions, Hoboken, NJ, USA: John Wiley and Sons, Fourth edition.
Bessel
,
cardioid
.
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, 2+x2, 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(depvar(fit)) # Processed data is in [0,2*pi)
Run the code above in your browser using DataLab