# How to fit a normal approximation to data in Julia

**URL:** <https://discourse.julialang.org/t/how-to-fit-a-normal-approximation-to-data-in-julia/35045>\
**Category:** Statistics\
**Created:** [February 23, 2020, 9:02am UTC](https://discourse.julialang.org/t/how-to-fit-a-normal-approximation-to-data-in-julia/35045 "2020-02-23T09:02:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 23, 2020, 9:20am UTC](https://discourse.julialang.org/t/how-to-fit-a-normal-approximation-to-data-in-julia/35045/2 "2020-02-23T09:20:48Z")

</div>

Three approaches that occur to me are

1. matching moments: calculate weighted mean and variance using [GitHub - JuliaStats/StatsBase.jl: Basic statistics for Julia](https://github.com/JuliaStats/StatsBase.jl) (your counts are a weight vector)

2. the same with some quantile statistics (eg 25-75%)

3. maximum likelihood, or likelihood-based methods in general: given a mean and a standard deviation you can calculate the log likelihood of each value, counts multiply that

---

_[View the full topic](https://discourse.julialang.org/t/how-to-fit-a-normal-approximation-to-data-in-julia/35045)._
