vMFangle: Inner Product of von Mises--Fisher Random Vector and Mean Direction
Description
These functions provide information about the distribution of an inner
product between von Mises--Fisher random vector and its mean direction.
Specifically, if \(X\) follows a von Mises--Fisher distribution with mean
direction \(\mu\), the inner product \(X'\mu\) will be a random variable
following some distribution. See page 170 of Mardia and Jupp (1999).
rvMFangle() generates random variates using the algorithm proposed in Kang
and Oh (2024), and dvMFangle gives the density from this distribution. This
function partly uses the code from the article Marsaglia et al. (2004).
Usage
rvMFangle(n, p, kappa)
dvMFangle(r, p, kappa)
Value
rvMFangle() returns a vector whose components independently follow the
aforementioned distribution. The length of the result is determined by n
for rvMFangle().
dvMFangle() returns a vector of density function value. The length of the
result is determined by the length of r for dvMFangle().
Arguments
n
number of random vectors to generate.
p
dimension of the sphere. i.e.,
Sp-1, p ≥ 2.
kappa
concentration parameter. kappa > 0.
Setting kappa = 0 may cause errors.
r
vector of quantiles. -1 ≤ r ≤ 1.
References
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.