# G-and-k distributions with skewness and kurtosis

**URL:** <https://discourse.pymc.io/t/g-and-k-distributions-with-skewness-and-kurtosis/5288>\
**Category:** Questions\
**Created:** [June 19, 2020, 7:40am UTC](https://discourse.pymc.io/t/g-and-k-distributions-with-skewness-and-kurtosis/5288 "2020-06-19T07:40:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cs224](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/cs224/32/2826_2.png) [@cs224](https://discourse.pymc.io/u/cs224)\
**Post date:** [June 19, 2020, 7:40am UTC](https://discourse.pymc.io/t/g-and-k-distributions-with-skewness-and-kurtosis/5288/1 "2020-06-19T07:40:12Z")

</div>

Hello,

I’ve just started googling, so I have no prior knowledge to that topic. I am looking for a parametric (ideally 4 parameters) distribution with which I can model high moments like skewness and kurtosis.

I’ve found some references in a topic area Approximate Bayesian Computational methods (ABC methodology) that talk about g-and-k distributions. The following tutorial is a quick intro:

> **[tutorial\_gandk.pdf](https://github.com/pierrejacob/winference/blob/master/inst/tutorials/tutorial_gandk.pdf)**

Does somebody know how to use such a g-and-k distribution in PyMC3? Or alternatively: does somebody know of another way that works in PyMC3 with which I can model a parametric distribution with higher moments?

Thanks a lot!  
Christian

---

<div class="post-metadata">

**Author:** ![AlexAndorra](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/alexandorra/32/9142_2.png) [@AlexAndorra](https://discourse.pymc.io/u/AlexAndorra)\
**Post date:** [June 19, 2020, 8:21am UTC](https://discourse.pymc.io/t/g-and-k-distributions-with-skewness-and-kurtosis/5288/2 "2020-06-19T08:21:41Z")

</div>

Hi Christian,  
I’m not versed in that area, but I know @aloctavodia works on the SMC-ABC sampler in PyMC3, so maybe he’ll be able to give you some pointers?  
This is a long shot though, since, again, I don’t know this area 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![aloctavodia](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/aloctavodia/32/8642_2.png) [@aloctavodia](https://discourse.pymc.io/u/aloctavodia)\
**Post date:** [June 19, 2020, 7:10pm UTC](https://discourse.pymc.io/t/g-and-k-distributions-with-skewness-and-kurtosis/5288/3 "2020-06-19T19:10:01Z")

</div>

Hi @cs224,

PyMC3 has a [skewed normal distribution](https://docs.pymc.io/api/distributions/continuous.html#pymc3.distributions.continuous.SkewNormal). And you also have the student t distribution. But I guess what you want is a skewed t distribution, unfortunately that distribution is not included with PyMC3, but you still can create it and use it with the help of `pm.DensityDist`.

---

<div class="post-metadata">

**Author:** ![nkaimcaudle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/nkaimcaudle/32/2142_2.png) [@nkaimcaudle](https://discourse.pymc.io/u/nkaimcaudle)\
**Post date:** [June 20, 2020, 5:16am UTC](https://discourse.pymc.io/t/g-and-k-distributions-with-skewness-and-kurtosis/5288/4 "2020-06-20T05:16:30Z")

</div>

You could try a Normal with [SinhArcsinh](https://www.tensorflow.org/probability/api_docs/python/tfp/bijectors/SinhArcsinh) transformation. Again that isn’t available in PyMC3 so would require coding yourself.

---

<div class="post-metadata">

**Author:** ![cs224](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/cs224/32/2826_2.png) [@cs224](https://discourse.pymc.io/u/cs224)\
**Post date:** [June 20, 2020, 4:20pm UTC](https://discourse.pymc.io/t/g-and-k-distributions-with-skewness-and-kurtosis/5288/5 "2020-06-20T16:20:02Z")

</div>

Thank you all for your replies. For the moment I’ve decided to go with the gk R package: [https://github.com/dennisprangle/gk](https://github.com/dennisprangle/gk)
