bwFo: Optimal Bandwidth Selection via Fourier Plug-in Method

View source: R/bwFo.R

bwFoR Documentation

Optimal Bandwidth Selection via Fourier Plug-in Method

Description

This function computes the optimal smoothing parameter (bandwidth) for circular data using the Fourier series-based direct plug-in approach based on delta sequence estimators (see \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10485252.2022.2057974")}).

Usage

bwFo(x, C1 = 0.25, C2 = 25, gamma = 0.5)

Arguments

x

Data from which the smoothing parameter is to be computed. The object is coerced to a numeric vector in radians using circular. Can be a numeric vector or an object of class circular.

C1

Numeric scalar (default 0.25) representing the lower bound constant for determining the range of Fourier coefficients. Used to compute the lower bound L_n = \lfloor C_1 \cdot n^{1/11} \rfloor + 1 for the optimal number of Fourier terms. Must be positive and less than C2.

C2

Numeric scalar (default 25) representing the upper bound constant for determining the range of Fourier coefficients. Used to compute the upper bound U_n = \lfloor C_2 \cdot n^{1/11} \rfloor for the optimal number of Fourier terms. Must be positive and greater than C1.

gamma

Numeric scalar between 0 and 1 (default 0.5) representing the penalty parameter in the criterion function H(m) used for selecting the optimal number of Fourier coefficients. Controls the trade-off between bias and variance in the functional estimation.

Details

The Fourier-based plug-in estimator computes the optimal bandwidth using the formula:

\hat{h}_{FO} := (4\pi)^{-1/10} \hat{\theta}_{2,\hat{m}}^{-1/5} n^{-1/5}

where \hat{\theta}_{2,\hat{m}} is the estimator of the second-order functional \theta_2(f) based on the selected number of Fourier coefficients \hat{m}.

Under the assumption of von Mises density, this formula becomes:

\hat{h}_{VM} = (4\pi)^{-1/10} \left(\frac{3\hat{\kappa}^2 I_0(2\hat{\kappa}) - \hat{\kappa}I_1(2\hat{\kappa})}{8\pi I_0(\hat{\kappa})^2}\right)^{-1/5} n^{-1/5}

where I_0 and I_1 are the modified Bessel functions of the first kind of orders 0 and 1, and \hat{\kappa} is the estimated concentration parameter of the von Mises distribution.

Value

The computed optimal smoothing parameter kappa, a numeric concentration parameter (analogous to inverse radians) derived from the Fourier method for circular kernel density estimation. Higher values indicate sharper, more concentrated kernels and less smoothing; lower values indicate broader kernels and more smoothing.

References

Tenreiro, C. (2022). Kernel density estimation for circular data: a Fourier series-based plug-in approach for bandwidth selection. Journal of Nonparametric Statistics, 34(2):377–406. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10485252.2022.2057974")}

See Also

bwScv, bwLscvg, bwCcv

Examples

# Example with circular data
library(circular)
set.seed(123)
x <- rvonmises(100, mu = circular(0), kappa = 2)
bw <- bwFo(x)
print(bw)

x <- rwrappednormal(100, mu = circular(1), rho = 0.7)
bw <- bwFo(x)
y <- density(x, bw=bw) 
plot(y, main="KDE with Fourier Plug-in Bandwidth")


circularKDE documentation built on Jan. 7, 2026, 9:06 a.m.