Skip to contents

Density and random generation for the spherical normal distribution with mean and concentration parameter (\(\kappa\)) .

Usage

rvmf(n = 100, mu = Vec3(1, 0, 0), k = 5)

dvmf(x, mu, k = 5)

Source

Adapted fom rotasym::r_vMF() and rotasym::d_vMF()

Arguments

n

integer. number of random samples to be generated

k

numeric. The concentration parameter (\(\kappa\)) of the von Mises-Fisher distribution

x, mu

object of class "Vec3", "Line" or "Plane"

See also

runif.spherical() for alternative algorithms to generate uniform distributed samples on a sphere, rkent() for Kent distribution, rfb() for Fisher-Bingham distribution.

Examples

set.seed(20250411)
x <- rvmf(100, mu = Line(120, 50), k = 5)
dx <- dvmf(x, mu = Line(120, 50))
head(dx)
#>           [,1]
#> [1,] 0.3539639
#> [2,] 0.3456839
#> [3,] 0.3298219
#> [4,] 0.2878725
#> [5,] 0.3416724
#> [6,] 0.3087497

plot(x, col = assign_col(dx))