Skip to main content

kde_fft

Function kde_fft 

Source
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:

  1. Bin data onto grid
  2. Create kernel values on grid
  3. Zero-pad both to avoid circular convolution
  4. FFT both, multiply in frequency domain, inverse FFT
  5. Extract and normalize