rvMF() generates von Mises--Fisher distributed pseudo-random vectors,
without resorting to the rejection-based sampling method proposed by Wood
(1994). See Kang and Oh (2024) for details. This function partly uses the
code from the function Rfast::rvmf() and the article Marsaglia et al.
(2004).
rvMF(n, mu, k)matrix where each row independently follows the specified von
Mises-Fisher distribution. The number of columns equals the length of mu,
and the number of rows equals n for rvMF.
number of pseudo-random vectors to generate.
mean direction.
concentration parameter. k ≥ 0.
S. Kang and H.-S. Oh. Novel sampling method for the von Mises--Fisher distribution. Statistics and Computing, 34(3):106, 2024.
K. V. Mardia and P. E. Jupp. Directional Statistics, volume 494. John Wiley & Sons, Chichester, 1999.
G. Marsaglia, W. W. Tsang, and J. Wang. Fast generation of discrete random variables. Journal of Statistical Software, 11(3):1–11, 2004.
M. Papadakis, M. Tsagris, M. Dimitriadis, S. Fafalios, I. Tsamardinos, M. Fasiolo, G. Borboudakis, J. Burkardt, C. Zou, K. Lakiotaki, and C. Chatzipantsiou. Rfast: A Collection of Efficient and Extremely Fast R Functions, 2022. https://CRAN.R-project.org/package=Rfast. R package version 2.0.6.
A. T. Wood. Simulation of the von Mises Fisher distribution. Communications in Statistics– Simulation and Computation, 23(1):157–164, 1994.
rvMFangle(), dvMFangle(), Rfast::rvmf().
rvMF(10, c(0,0,1), 10)
rvMF(10, c(1,1)/sqrt(2), 0)
Run the code above in your browser using DataLab