Learn R Programming

polykde (version 1.1.7)

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

Value

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

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.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab