eff_kern: Polyspherical kernel moments and efficiencies

View source: R/kernels.R

eff_kernR Documentation

Polyspherical kernel moments and efficiencies

Description

Computes moments of kernels on \mathbb{S}^{d_1} \times \cdots \times \mathbb{S}^{d_r} and efficiencies of kernels on (\mathbb{S}^d)^r.

Usage

eff_kern(
  d,
  r,
  k = 10,
  kernel,
  kernel_type = c("prod", "sph")[1],
  kernel_ref = "2",
  kernel_ref_type = c("prod", "sph")[2],
  ...
)

b_d(kernel, d, k = 10, kernel_type = c("prod", "sph")[1], ...)

v_d(kernel, d, k = 10, kernel_type = c("prod", "sph")[1], ...)

Arguments

d

a scalar with the common dimension of each sphere \mathbb{S}^d.

r

a scalar with the number of polyspheres of the same dimension.

k

softplus kernel parameter. Defaults to 10.0.

kernel

kernel employed: 1 for von Mises–Fisher (default); 2 for Epanechnikov; 3 for softplus.

kernel_type

type of kernel employed: "prod" for the product kernel (default) or "sph" for the spherically symmetric kernel.

kernel_ref

reference kernel to which compare the efficiency. Uses the same codification as the kernel. Defaults to "2".

kernel_ref_type

type of the reference kernel. Uses the same codification as kernel_type. Defaults to "sph".

...

further arguments passed to integrate, such as upper, abs.tol, rel.tol, etc.

Value

  • b_d: a vector with the first kernel moment on each sphere (common if kernel_type = "sph").

  • v_d: a vector with the second kernel moment if kernel_type = "prod", or a scalar if kernel_type = "sph".

  • eff_kern: a scalar with the kernel efficiency.

See Also

kde_polysph, bw_rot_polysph.

Examples

# Kernel moments
b_d(kernel = 2, d = c(2, 3), kernel_type = "prod")
v_d(kernel = 2, d = c(2, 3), kernel_type = "prod")
b_d(kernel = 2, d = c(2, 3), kernel_type = "sph")
v_d(kernel = 2, d = c(2, 3), kernel_type = "sph")

# Kernel efficiencies
eff_kern(d = 2, r = 1, kernel = "1")
eff_kern(d = 2, r = 1, kernel = "2")
eff_kern(d = 2, r = 1, k = 10, kernel = "3")

polykde documentation built on Nov. 13, 2026, 1:08 a.m.