# Multivariate random distribution

**URL:** <https://root-forum.cern.ch/t/multivariate-random-distribution/63796>\
**Category:** ROOT\
**Created:** [June 24, 2025, 11:22pm UTC](https://root-forum.cern.ch/t/multivariate-random-distribution/63796 "2025-06-24T23:22:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![meyerma](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/meyerma/32/29724_2.png) [@meyerma](https://root-forum.cern.ch/u/meyerma)\
**Post date:** [June 24, 2025, 11:22pm UTC](https://root-forum.cern.ch/t/multivariate-random-distribution/63796/1 "2025-06-24T23:22:31Z")

</div>

Hi @moneta

Is there any one-liner multivariate normal distribution function taking a covariant TMatrix as input and generating a column vector (such as TVector) of N dimension?

Something analog to:

> **[scipy.stats.multivariate\_normal — SciPy v1.16.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.multivariate_normal.html)**

Thank you, M.

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [June 25, 2025, 7:38am UTC](https://root-forum.cern.ch/t/multivariate-random-distribution/63796/2 "2025-06-25T07:38:16Z")

</div>

There is:

> **[ROOT: tutorials/roofit/roostats/MultivariateGaussianTest.C Source File](https://root.cern/doc/master/MultivariateGaussianTest_8C_source.html)**

or for 2D:

> [@Tilt of ellipse in bigaus](https://root-forum.cern.ch/t/tilt-of-ellipse-in-bigaus/47350/2):
>
> The “bigaus” is actually based on the “[ROOT::Math::bigaussian\_pdf](https://root.cern.ch/doc/master/group__PdfFunc.html#ga118e731634d25ce7716c0b279c5e6a16)” function (you can use the “rho”, “sigmax” and “sigmay” parameters to calculate the principal axes, which are defined by the eigenvectors of the covariance matrix, and the semidiameters, which are the square-roots of its eigenvalues): { // ... create the function ... TF2 \*f = new TF2("f", "[0] \* ROOT::Math::bigaussian\_pdf(x, y, [2], [4], [5], [1], [3])", -10., 10., -10., 10.); f-\>SetParNames("constant", "x0", "sigmax", "y0"…

so not really a onliner solution yet, but PRs are welcome 🙂

---

<div class="post-metadata">

**Author:** ![meyerma](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/meyerma/32/29724_2.png) [@meyerma](https://root-forum.cern.ch/u/meyerma)\
**Post date:** [June 27, 2025, 11:35am UTC](https://root-forum.cern.ch/t/multivariate-random-distribution/63796/3 "2025-06-27T11:35:59Z")

</div>

I am going to check that. Thanks for sharing the test!

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [July 11, 2025, 11:36am UTC](https://root-forum.cern.ch/t/multivariate-random-distribution/63796/4 "2025-07-11T11:36:55Z")

</div>

Closed on July 11, 2025, 11:36am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
