Multivariate gaussian

Hello everybody!

I have to do an exercise in which I need to generate a class of events from a 2dimensional gaussian centered in (x,y) = (0,0) and sigma_x=sigma_y=0.3 e rho (correlation coefficient)=0.5.
I have looked for a method to generate events from such distributions using TRandom or TF2 but I have found nothing. Except the implementation “by hand” (I am thinking about a hit and miss method), do you know any other options, please?

Thanks in advance to everybody!


ROOT Version: 6.16
Platform: ubuntu 18
Compiler :g++


@moneta, can you please take a look here?

Thank you,
Oksana.

Hi @Ale_olomorfo, I believe you can inspire yourself to https://root.cern/doc/v610/MultivariateGaussianTest_8C_source.html where you can build a 2d gaussian with a defined covariance matrix. Hope it helps

1 Like

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