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 \mathbb{S}^{d_1}\times\cdots\times \mathbb{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.

References

García-Portugués, E. and Meilán-Vila, A. (2026). Kernel density estimation with polyspherical data and its applications. Journal of the American Statistical Association, 121(553):427–439. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.2025.2521898")}

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 Nov. 13, 2026, 1:08 a.m.