Learn R Programming

polykde (version 1.1.7)

r_mvmf_polysph: Sample mixtures of von Mises--Fisher distributed polyspherical data

Description

Simulates from an \(m\)-mixture of product of von Mises--Fisher distributions on the polysphere \(\mathcal{S}^{d_1} \times \cdots \times \mathcal{S}^{d_r}\).

Usage

r_mvmf_polysph(n, d, mu, kappa, prop, norm_mu = FALSE)

Value

A matrix of size c(n, sum(d) + r) with the sample.

Arguments

n

sample size.

d

vector of size r with dimensions.

mu

a matrix of size c(m, sum(d + 1)) with the means of each mixture components in the rows.

kappa

a matrix of size c(m, r) with the concentrations of each mixture components in the rows.

prop

a vector of size m with the proportions of the mixture components.

norm_mu

ensure a normalization of mu? Defaults to FALSE.

Examples

Run this code
# Simulate mixture of vMF data on (S^1)^2
r_mvmf_polysph(n = 10, d = c(1, 1),
               mu = rbind(c(0, 1, 0, 1), c(1, 0, 1, 0)),
               kappa = rbind(c(5, 2), c(1, 2)), prop = c(0.7, 0.3))

Run the code above in your browser using DataLab