rmwat {watson}R 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://research.wu.ac.at/en/publications/random-sampling-from-the-watson-distribution.

Value

A matrix with rows equal to the generated values.

References

Sablica, Hornik and Leydold (2022). Random Sampling from the Watson Distribution https://research.wu.ac.at/en/publications/random-sampling-from-the-watson-distribution.

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))

[Package watson version 0.4 Index]