From cd6f31fe5b7b4f5a8098db52d5bc68f1bc813257 Mon Sep 17 00:00:00 2001 From: MathisWellmann Date: Fri, 11 Aug 2023 12:16:25 +0200 Subject: [PATCH] Show an example usage --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index afad424..515aae5 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,16 @@ To use this smoother in you project, add this to your `Cargo.toml`: whittaker_smoother = "0.1" ``` +Now you can use the smoothing function as such: +```rust +// Here we use the WOOD_DATASET, but this can be any series that you would like to smooth +let raw = Vec::from_iter(WOOD_DATASET.iter().map(|v| *v as f64)); +let lambda = 2e4; +let order = 3; +let smoothed = whittaker_smoother(&raw, lambda, order).unwrap(); +``` +And BAM, that's it! There is you perfectly smoothed series. + ### Further Reading: See the [papers](./papers/) folder for two papers showing additional details of the method.