curv_vmf_polysph: Curvature of a polyspherical von Mises-Fisher density

View source: R/bwd.R

curv_vmf_polysphR Documentation

Curvature of a polyspherical von Mises–Fisher density

Description

Computes the curvature matrix \boldsymbol{R}(\boldsymbol{\kappa}) of a product of von Mises–Fisher densities on the polysphere. This curvature is used in the rule-of-thumb selector bw_rot_polysph.

Usage

curv_vmf_polysph(kappa, d, log = FALSE)

Arguments

kappa

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

d

vector of size r with dimensions.

log

compute the (entrywise) logarithm of the curvature matrix? Defaults to FALSE.

Value

A matrix of size c(length(r), length(r)).

Examples

# Curvature matrix
d <- 2:4
kappa <- 1:3
curv_vmf_polysph(kappa = kappa, d = d)
curv_vmf_polysph(kappa = kappa, d = d, log = TRUE)

# Equivalence on the sphere with DirStats::R_Psi_mixvmf
drop(curv_vmf_polysph(kappa = kappa[1], d = d[1]))
d[1]^2 * DirStats::R_Psi_mixvmf(q = d[1], mu = rbind(c(rep(0, d[1]), 1)),
                                kappa = kappa[1], p = 1)

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