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 \mathcal{S}^{d_1} \times \cdots \times \mathcal{S}^{d_r} and efficiencies of kernels on (\mathcal{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 \mathcal{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. Must be either "prod" (product kernel, default) or "sph" (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. Must be either "prod" (product kernel) or "sph" (spherically symmetric kernel, default).

...

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.

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 April 16, 2025, 1:11 a.m.