# Simulation of super high-dimensional distribution

**URL:** <https://discourse.julialang.org/t/simulation-of-super-high-dimensional-distribution/35144>\
**Category:** Statistics\
**Tags:** question\
**Created:** [February 26, 2020, 12:11am UTC](https://discourse.julialang.org/t/simulation-of-super-high-dimensional-distribution/35144 "2020-02-26T00:11:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxjroger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zxjroger/32/11826_2.png) [@zxjroger](https://discourse.julialang.org/u/zxjroger)\
**Post date:** [February 26, 2020, 12:11am UTC](https://discourse.julialang.org/t/simulation-of-super-high-dimensional-distribution/35144/1 "2020-02-26T00:11:24Z")

</div>

I am working on simulated method of moments which requires to draw random variables from a multivariate normal distribution for numerical integration. However, the dimension of this multivariate normal distribution is super high, something like 250000. I would like to use Halton sequence. Since the dimension is so high, I believe I need to use the so called scrambled Halton sequence to avoid highly correlated draws. I have three questions:

1. Given the super high dimension, is there a better way of sampling?
2. If I have to use scrambled Halton sequence, is there a Julia package for it?
3. Given the super high dimension, is there a rule of thumb for the number of simulations for each observation?

I noticed the following post about Sobol sequences, but it seems that there is already some problem with a dimension of 100. So I am guessing it will be the same for Halton.

> [@Generating high-dimensional Sobol sequences](https://discourse.julialang.org/t/generating-high-dimensional-sobol-sequences/21521):
>
> Hi there, I am using Sobol sequences to generate say 10,000 draws from the Multivariate Normal with dimension 100, mean vector 0 and covariance matrix equal to the identity matrix. Generating the sequence is fine, but I find that the distribution of the resulting points is highly concentrated. That is, the density of each draw, relative to that of the other draws, is almost zero for 99% of points, then several orders of magnitude higher for just a few points. I’d expect the relative densities …

I noticed the following two Halton packages, but I don’t think they offer the option of scrambled Halton. Thank you.

> **[GitHub - npfrazier/FastHalton.jl: Implements Halton Sequences and Halton...](https://github.com/npfrazier/FastHalton.jl)**
>
> Implements Halton Sequences and Halton Draws for Julia - GitHub - npfrazier/FastHalton.jl: Implements Halton Sequences and Halton Draws for Julia

> **[GitHub - tobydriscoll/HaltonSequences.jl: Halton sequences and points in Julia](https://github.com/tobydriscoll/HaltonSequences.jl)**
>
> Halton sequences and points in Julia. Contribute to tobydriscoll/HaltonSequences.jl development by creating an account on GitHub.

---

<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 26, 2020, 8:29am UTC](https://discourse.julialang.org/t/simulation-of-super-high-dimensional-distribution/35144/2 "2020-02-26T08:29:02Z")

</div>

Alternatively, you could just set a random seed and use plain old `rand()`. Either your problem is “nice” (insensitive to issues of non-uniform coverage), or both methods will be horrible anyway for 2.5e5 dimensions for a feasible number of draws.

---

<div class="post-metadata">

**Author:** ![zxjroger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zxjroger/32/11826_2.png) [@zxjroger](https://discourse.julialang.org/u/zxjroger)\
**Post date:** [February 26, 2020, 4:12pm UTC](https://discourse.julialang.org/t/simulation-of-super-high-dimensional-distribution/35144/3 "2020-02-26T16:12:42Z")

</div>

I see. Thank you.

---

<div class="post-metadata">

**Author:** ![phrb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phrb/32/13580_2.png) [@phrb](https://discourse.julialang.org/u/phrb)\
**Post date:** [March 24, 2020, 2:26am UTC](https://discourse.julialang.org/t/simulation-of-super-high-dimensional-distribution/35144/4 "2020-03-24T02:26:16Z")

</div>

Regarding your second point, I don’t know what you’ve used before, but I use the [randtoolbox](https://cran.r-project.org/web/packages/randtoolbox/randtoolbox.pdf) R package to generate scrambled low discrepancy sequences, you can try to use it with [RCall](https://github.com/JuliaInterop/RCall.jl).
