- (kde sequence bandwidth kernel #:n)procedure
Computes kernel density estimate for the given sequence using specified bandwidth (smoothing parameter) and kernel function. Returns a list of (x . density) pairs with n evaluation points (default 512).
Available kernels:
- 'gaussian or 'normal - Gaussian kernel (most common)
- 'epanechnikov - Epanechnikov kernel (most efficient)
- 'rectangular or 'uniform - Rectangular kernel
- 'triangular - Triangular kernel
- 'biweight or 'quartic - Biweight kernel
> (let* ((data '(1 2 3 4 5)) (bw (kde-bandwidth-nrd data)) (density (kde data bw 'gaussian 10))) (length density)) 10 > (kde '(1 2 3) 1.0 'gaussian 5) ((-2.0 . 0.006649110640673518) (-0.75 . 0.07266464304354425) (0.5 . 0.25725941161130127) (1.75 . 0.2968430843637567) (3.0 . 0.1123450687407796))