Skip to contents

Computes a plug-in bandwidth vector used by GLBFP/LBFP/ASH estimators. The function validates numeric inputs, stabilizes near-singular covariance matrices with a small ridge if needed, and returns strictly positive bandwidths.

Usage

compute_bi_optim(data, m = rep(1, ncol(data)))

Arguments

data

A numeric matrix or data frame where rows are observations and columns are variables.

m

A positive integer vector of shifts, one value per dimension.

Value

A numeric vector of positive bandwidths with one value per column in data.

Details

The returned vector is intended as a starting value for examples and routine workflows. For applied analysis, sensitivity to the bandwidth should still be checked.

The plug-in expression follows the optimal cell-width calculation for multivariate frequency polygons in Carbon and Duchesne (2024).

Near-singular covariance matrices are stabilized with a small ridge term. If this fails, the function returns an error rather than silently producing non-finite bandwidths.

References

Carbon, M. and Duchesne, T. (2024). Multivariate frequency polygon for stationary random fields. Annals of the Institute of Statistical Mathematics, 76(2), 263-287. doi:10.1007/s10463-023-00883-5.

See also

Examples

set.seed(1)
x <- cbind(rnorm(200), rnorm(200))
compute_bi_optim(x, m = c(1, 1))
#> [1] 0.3109093 0.3153027