Learn R Programming

sdetorus (version 0.1.10)

dVm: Density of the von Mises

Description

Computes the density of a von Mises in a numerically stable way.

Usage

dVm(x, mu, kappa)

Value

A vector of the same length as x containing the density.

Arguments

x

evaluation angles, not necessary in \([\pi,\pi)\).

mu

circular mean.

kappa

non-negative concentration parameter.

References

Jammalamadaka, S. R. and SenGupta, A. (2001) Topics in Circular Statistics. World Scientific, Singapore. tools:::Rd_expr_doi("10.1142/4031")

Examples

Run this code
x <- seq(-pi, pi, l = 200)
plot(x, x, type = "n", ylab = "Density", ylim = c(0, 1))
for (i in 0:20) {
  lines(x, dVm(x = x, mu = 0, kappa = 5 * i / 20),
        col = rainbow(21)[i + 1])
}

Run the code above in your browser using DataLab