rmwat: Random Sampling from a Mixture of Watson Distributions

View source: R/RcppExports.R

rmwatR Documentation

Random Sampling from a Mixture of Watson Distributions

Description

rmwat generates a random sample from a mixture of multivariate Watson distributions.

Usage

rmwat(n, weights, kappa, mu, method = "acg", b = -10, rho = 1.1)

Arguments

n

an integer giving the number of samples to draw.

weights

a numeric vector with non-negative elements giving the mixture probabilities.

kappa

a numeric vector giving the kappa parameters of the mixture components.

mu

a numeric matrix with columns giving the mu parameters of the mixture components.

method

a string indicating whether ACG sampler (method = "acg"), Tinflex sampler (method = "tinflex") or automatic selection (method = "auto") of the sampler should be used, default: "acg".

b

a positive numeric hyper-parameter used in the sampling. If not a positive value is given, optimal choice of b is used, default: -10.

rho

performance parameter: requested upper bound for ratio of area below hat to area below squeeze (numeric). See Tinflex.setup, default: 1.1.

Details

The function generates samples from finite mixtures of Watson distributions, using methods from Sablica, Hornik and Leydold (2022) https://www.tandfonline.com/doi/full/10.1080/10618600.2024.2416521.

Value

A matrix with rows equal to the generated values.

References

Sablica, Hornik and Leydold (2022). Random Sampling from the Watson Distribution https://www.tandfonline.com/doi/full/10.1080/10618600.2024.2416521.

Examples


## simulate from Watson distribution
sample1 <- rmwat(n = 20, weights = 1, kappa = 20, mu = matrix(c(1,1,1),nrow = 3))

## simulate from a mixture of Watson distributions
sample2 <- rmwat(n = 20, weights = c(0.5,0.5), kappa = c(-200,-200),
                            mu = matrix(c(1,1,1,-1,1,1),nrow = 3))

watson documentation built on April 12, 2025, 1:35 a.m.

Related to rmwat in watson...