rvMF: Simulation from the von Mises-Fisher distribution

View source: R/vMF.R

rvMFR Documentation

Simulation from the von Mises-Fisher distribution

Description

Random generation for the von Mises-Fisher distribution of dimension p with location parameter mu and intensity parameter eta (see Wood, 1994; Mardia, 2014).

Usage

rvMF(size, theta)

Arguments

size

is the number of simulations.

theta

is the parameter as eta*mu.

Value

A matrix whose each row is a random draw from the distribution.

Examples

# Draw 10 vectors from vMF with parameters eta = 1 and mu = c(1,0)
rvMF(10,c(1,0))

# Draw 10 vectors from vMF with parameters eta = sqrt(14) and mu proportional to (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))

PartialNetwork documentation built on May 29, 2024, 10:08 a.m.