d_mvmf_polysph: Density of the product of von Mises-Fisher distributions on...

View source: R/distr.R

d_mvmf_polysphR Documentation

Density of the product of von Mises–Fisher distributions on the polysphere

Description

Computes the density of an m-mixture of product of von Mises–Fisher densities on the polysphere.

Usage

d_mvmf_polysph(x, d, mu, kappa, prop, log = FALSE)

Arguments

x

a matrix of size c(nx, sum(d) + r) with the evaluation points.

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.

log

compute the logarithm of the density? Defaults to FALSE.

Value

A vector of size nx with the evaluated density.

Examples

# Simple check of integration on S^1 x S^2
d <- c(1, 2)
mu <- rbind(c(0, 1, 0, 1, 0), c(1, 0, 1, 0, 0))
kappa <- rbind(c(5, 2), c(1, 2))
prop <- c(0.7, 0.3)
x <- r_mvmf_polysph(n = 1e4, d = d, mu = mu, kappa = kappa, prop = prop)
mean(1 / d_mvmf_polysph(x = x, d = d, mu = mu, kappa = kappa, prop = prop)) /
  prod(rotasym::w_p(p = d + 1))

polykde documentation built on Aug. 8, 2025, 6:55 p.m.