pub fn kde_fft(
data: &[f64],
grid: &[f64],
bandwidth: f64,
n: f64,
) -> KdeResult<Vec<f64>>Expand description
FFT-based Kernel Density Estimation
Uses FFT convolution for O(n log n) performance instead of O(n*m). Algorithm:
- Bin data onto grid
- Create kernel values on grid
- Zero-pad both to avoid circular convolution
- FFT both, multiply in frequency domain, inverse FFT
- Extract and normalize