pub fn optim_bandwidth(
x: &[f64],
y: &[f64],
h_range: Option<(f64, f64)>,
criterion: CvCriterion,
kernel: &str,
n_grid: usize,
) -> OptimBandwidthResultExpand description
Bandwidth optimizer for kernel smoothers (R’s optim.np).
Grid search over evenly-spaced bandwidths, selecting the one that minimizes the specified criterion (CV or GCV).
§Arguments
x— Predictor valuesy— Response valuesh_range— Optional(h_min, h_max). Defaults to(h_default / 5, h_default * 5)whereh_default = (x_max - x_min) / n^0.2.criterion— CV or GCVkernel— Kernel typen_grid— Number of grid points (default: 50)