bw_mrot_polysph: Marginal rule-of-thumb bandwidth selection for polyspherical...

View source: R/bwd.R

bw_mrot_polysphR Documentation

Marginal rule-of-thumb bandwidth selection for polyspherical kernel density estimator

Description

Computes marginal (sphere by sphere) rule-of-thumb bandwidths for the polyspherical kernel density estimator using a von Mises–Fisher distribution as reference.

Usage

bw_mrot_polysph(X, d, kernel = 1, k = 10, upscale = FALSE, deriv = 0,
  kappa = NULL)

Arguments

X

a matrix of size c(n, sum(d) + r) with the sample.

d

vector of size r with dimensions.

kernel

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

k

softplus kernel parameter. Defaults to 10.0.

upscale

rescale bandwidths to work on \mathcal{S}^{d_1}\times\cdots\times \mathcal{S}^{d_r} and for derivative estimation? Defaults to FALSE. If upscale = 1, the order n is upscaled. If upscale = 2, then also the kernel constant is upscaled.

deriv

derivative order to perform the upscaling. Defaults to 0.

kappa

estimate of the concentration parameters. Computed if not provided (default).

Value

A vector of size r with the marginal optimal bandwidths.

Examples

n <- 100
d <- 1:2
kappa <- rep(10, 2)
X <- r_vmf_polysph(n = n, d = d, mu = r_unif_polysph(n = 1, d = d),
                   kappa = kappa)
bw_rot_polysph(X = X, d = d)$bw
bw_mrot_polysph(X = X, d = d)

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