Skip to content

paulnorrie/smoothing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • Sheather and Jones method
  • 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)

About

Smoothing functions for Regression and Density Estimation

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages