Skip to contents

A naive acceptance-rejection sampling algorithm, based on bounding the density (with respect to the distance from mu) with a constant. For large kappa, this method grows inefficient. For kappa == 100, about 13 tries are needed per success. For kappa == -100, about 18 tries are needed.

Usage

rwatson(n, mu, k)

Source

geologyGeometry by Davis, J.R.

Arguments

n

integer. number of random samples to be generated

mu

Mean vector. object of class "Vec3", "Line", "Ray", or "Plane", where the rows are the observations and the columns are the coordinates.

k

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

Value

vector of class mu of length n

Examples

set.seed(20250411)
r <- rwatson(100, mu = Ray(120, 50), k = 10)

contour(r)
points(r)