rvMF {vMF} | R Documentation |
Sample from von Mises - Fisher distribution.
Description
rvMF
returns random draws from von Mises - Fisher distribution.
Usage
rvMF(size, theta)
Arguments
size |
as the number of draws needed. |
theta |
as the distribution parameter. |
Details
The parameter theta is such that dim(theta)
is the sphere dimension, |theta|
the intensity parameter and \frac{theta}{|theta|}
the mean directional parameter.
Value
A matrix whose each row is a random draw from the distribution.
References
Wood, A. T. (1994). Simulation of the von Mises Fisher distribution. Communications in statistics-simulation and computation, 23(1), 157-164. doi:10.1080/03610919408813161.
Hornik, K., & Grun, B. (2014). movMF: An R package for fitting mixtures of von Mises-Fisher distributions. Journal of Statistical Software, 58(10), 1-31. doi:10.18637/jss.v058.i10.
Examples
# Draw 1000 vectors from vM-F with parameter 1, (1,0)
rvMF(1000,c(1,0))
# Draw 10 vectors from vM-F with parameter sqrt(14), (2,1,3)
rvMF(10,c(2,1,3))
# Draw from the vMF distribution with mean direction proportional
# to c(1, -1) and concentration parameter 3
rvMF(10, 3 * c(1, -1) / sqrt(2))
[Package vMF version 0.0.3 Index]