# 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:** 2\
**Page:** 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:** [January 8, 2021, 10:33am UTC](https://discourse.julialang.org/t/how-to-fit-a-normal-approximation-to-data-in-julia/35045/21 "2021-01-08T10:33:09Z")

</div>

> [@abulak](#):
>
> Essentially what I’m trying to do is to bring SW-test to XXIst century 😉

If you really need p-values, I would just use MC methods to calculate them directly. It may be less costly and error prone than what you are doing, as these methods are relatively well established.

---

<div class="post-metadata">

**Author:** ![abulak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abulak/32/28314_2.png) [@abulak](https://discourse.julialang.org/u/abulak)\
**Post date:** [January 8, 2021, 7:32pm UTC](https://discourse.julialang.org/t/how-to-fit-a-normal-approximation-to-data-in-julia/35045/22 "2021-01-08T19:32:19Z")

</div>

Sampling is cheap, but probably not that cheap 😉 i.e. I can’t sample for each `k` (size of `Wₖ`) in `4:5000` (and I’m not sure it’s feasible to compute those covariances for `k > 500`), so I think I need to take some shortcuts.

I hoped to compute the normalizing transformation for a couple `k`s (say k=`5:5:500`) and then find some approximation of `t~t(k)` (it seems to be exponentially decaying) to be used for all `k`.

[Previous page](https://discourse.julialang.org/t/how-to-fit-a-normal-approximation-to-data-in-julia/35045.md?page=1)
