# Rand() doesn't work for NormalInverseGaussian

**URL:** <https://discourse.julialang.org/t/rand-doesnt-work-for-normalinversegaussian/23948>\
**Category:** Statistics\
**Created:** [May 7, 2019, 7:15am UTC](https://discourse.julialang.org/t/rand-doesnt-work-for-normalinversegaussian/23948 "2019-05-07T07:15:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BMval](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bmval/32/7647_2.png) [@BMval](https://discourse.julialang.org/u/BMval)\
**Post date:** [May 7, 2019, 7:15am UTC](https://discourse.julialang.org/t/rand-doesnt-work-for-normalinversegaussian/23948/1 "2019-05-07T07:15:55Z")

</div>

rand() doesn’t work for NormalInverseGaussian.

```julia
x = rand(dnig, 100)

Error: MethodError: no method matching iterate(::NormalInverseGaussian{Float64})

Would somebody help to generate random values?
```

---

<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:** [May 7, 2019, 7:17am UTC](https://discourse.julialang.org/t/rand-doesnt-work-for-normalinversegaussian/23948/2 "2019-05-07T07:17:59Z")

</div>

Please quote your code, and include an MWE.

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

**Author:** ![alejandromerchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alejandromerchan/32/10500_2.png) [@alejandromerchan](https://discourse.julialang.org/u/alejandromerchan)\
**Post date:** [May 7, 2019, 5:12pm UTC](https://discourse.julialang.org/t/rand-doesnt-work-for-normalinversegaussian/23948/3 "2019-05-07T17:12:33Z")

</div>

You should probably file an issue on GitHub, because it looks like that functionality is missing for that distribution. Or you can try to implement it and file a PR.
