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

View source: R/distr.R

d_vmf_polysphR Documentation

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

Description

Computes the density of the product of von Mises–Fisher densities on the polysphere.

Usage

d_vmf_polysph(x, d, mu, kappa, 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 vector of size sum(d) + r with the concatenated von Mises–Fisher means.

kappa

a vector of size r with the von Mises–Fisher concentrations.

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 <- c(0, 1, 0, 1, 0)
kappa <- c(1, 1)
x <- r_vmf_polysph(n = 1e4, d = d, mu = mu, kappa = kappa)
mean(1 / d_vmf_polysph(x = x, d = d, mu = mu, kappa = kappa)) /
  prod(rotasym::w_p(p = d + 1))

polykde documentation built on April 16, 2025, 1:11 a.m.