Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vonmises

von Mises Density Function


Description

Density, distribution function, random generation and quantiles for the von Mises circular distribution.

Usage

rvonmises(n, mu, kappa, control.circular=list())
dvonmises(x, mu, kappa, log)
pvonmises(q, mu, kappa, from=NULL, tol = 1e-020)
qvonmises(p, mu = circular(0), kappa=NULL, from=NULL, tol = .Machine$double.eps^(0.6), 
  control.circular = list(), ...)

Arguments

x, q, p

a vector. The x and q objects are coerced to class circular.

n

number of observations.

mu

mean direction of the distribution. The object is coerced to class circular.

kappa

non-negative numeric value for the concentration parameter of the distribution.

log

logical; if TRUE, probabilities p are given as log(p).

from

if NULL is set to mu-pi. This is the value from which the pvonmises and qvonmises are evaluated. It should be a circular object.

tol

the precision in evaluating the distributon function or the quantile.

control.circular

the attribute of the resulting object.

...

parameters passed to integrate.

Value

dvonmises gives the density, pvonmises gives the distribution function, rvonmises generates random deviates and qvonmises provides quantiles.

Since version 0.3-5 the random deviates are generated using a C code.

Author(s)

Claudio Agostinelli, Ulric Lund and Harry Southworth

References

Jammalamadaka, S. Rao and SenGupta, A. (2001). Topics in Circular Statistics, Section 2.2.4, World Scientific Press, Singapore.

Examples

data1 <- rvonmises(100, circular(0), 10, control.circular=list(units="degrees"))
plot(data1)

ff <- function(x) dvonmises(x, mu=circular(pi), kappa=10)
curve.circular(ff, join=TRUE, xlim=c(-2.3, 1),
  main="Density of a VonMises Distribution \n mu=pi, kappa=10")

ff <- function(x) pvonmises(x, mu=circular(pi), kappa=10)
curve.circular(ff, join=FALSE, xlim=c(-2, 2), ylim=c(-2, 1), 
  to=(2*pi-3*.Machine$double.eps), modulo="asis", nosort=TRUE, 
  main="Probability of a VonMises Distribution \n mu=pi, kappa=10")

plot(function(x) qvonmises(x, mu=circular(0), kappa=5), from=0, to=1)
##curve do not work!
plot(function(x) qvonmises(x, mu=circular(pi), kappa=5), from=0, to=1)
plot(function(x) qvonmises(x, mu=circular(pi), kappa=5, from=circular(pi/2)), from=0, to=1)

circular

Circular Statistics

v0.4-93
GPL-2
Authors
Ulric Lund <ulund@calpoly.edu> [aut], Claudio Agostinelli <claudio.agostinelli@unitn.it> [aut, cre], Hiroyoshi Arai <h_arai@aoni.waseda.jp> [ctb], Alessando Gagliardi <gagliardi@stud.unive.it> [ctb], Eduardo Garcia Portugues <edgarcia@est-econ.uc3m.es> [ctb], Dimitri Giunchi <dimitri.giunchi@unipi.it> [ctb], Jean-Olivier Irisson <irisson@normalesup.org> [ctb], Matthew Pocernich <pocernic@ucar.edu> [ctb], Federico Rotolo [ctb]
Initial release
2017-06-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.