# Good package to smooth outliers?

**URL:** https://discourse.julialang.org/t/good-package-to-smooth-outliers/107919
**Category:** General Usage
**Tags:** smoothing, outlier-detection
**Created:** [December 21, 2023, 7:07pm UTC](https://discourse.julialang.org/t/good-package-to-smooth-outliers/107919 "2023-12-21T19:07:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![PeX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pex/32/49986_2.png) [@PeX](https://discourse.julialang.org/u/PeX)
#### Post date: [December 21, 2023, 7:07pm UTC](https://discourse.julialang.org/t/good-package-to-smooth-outliers/107919/1 "2023-12-21T19:07:07Z")

</div>

Hi all,  
I’m looking for a package (or a good method) that can smooth out outliers like these:

![drop](https://global.discourse-cdn.com/julialang/original/3X/7/9/799fd4dc589ef4e8ea85df8de5cc362334dee5d8.png)

Any suggestions?

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [December 21, 2023, 8:37pm UTC](https://discourse.julialang.org/t/good-package-to-smooth-outliers/107919/2 "2023-12-21T20:37:52Z")

</div>

You could take a look at FastRunningMedian.jl.

Example:

 ![FastRunningMedian_smooth_outliers_plot](https://global.discourse-cdn.com/julialang/original/3X/3/4/34d085b5509bff357897f8eb6cdc320f39c8bcf0.png)

> **FastRunningMedian .jl code**
>
> ```julia
> using FastRunningMedian, Plots; gr(dpi=600)
> x = range(3476, 3480, 30)
> y = 1000 .+ 100*(x .- 3476) .+ 100*rand(30)
> y[8:10] .= -100
> 
> yrm = running_median(y, 7)
> 
> plot(x, [y yrm], c=[:blues :blue], label=["Original" "FastRunningMedian"])
> 
> ```

---

<div class="post-metadata">

### Author: ![Dan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dan/32/42581_2.png) [@Dan](https://discourse.julialang.org/u/Dan)
#### Post date: [December 21, 2023, 8:40pm UTC](https://discourse.julialang.org/t/good-package-to-smooth-outliers/107919/3 "2023-12-21T20:40:12Z")

</div>

Also more information is needed, as outliers are hard to define. Especially, as the saying goes, _one man’s trash is another man’s treasure_. Rafael’s suggestion looks nice though.
