smoothing

Smoothing functions for Regression and Density Estimation

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License GPL-3.0-or-later
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Installation

nimble install smoothing
choosenim install smoothing
git clone https://github.com/paulnorrie/smoothing

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
smoothing - - - - - - -

Source

Repository https://github.com/paulnorrie/smoothing
Homepage https://github.com/paulnorrie/smoothing
Registry Source nimble_official

README

smoothing

Smoothing functions for Regression and Density Estimation

This is a Nim port of the R sm library to use with Arraymancer. If you wish to estimate a kernel bandwidth for non-normal distributions when using the kde function in Arraymancer, there are some options:

  • Use Silvermans rule of thumb, which Arraymancer handles

or use this library for:

  • [x] Sheather and Jones method
  • [x] Normal optimal choice
  • [ ] Cross-validation (not yet done)

Example

import arraymancer
import smoothing/sj

let x = randomTensor(1, 100, 255)

# x isn't likely to be normal, so use the kernel bandwidth given by the
# Sheather Jones method instead of Silvermans rule of thumb (the default)
let sjbw = hsj(x) 

# smooth our tensor
x.kde("gauss", adjust = 1.0, samples = 255, bw = sjbw, normalize = false)