I have the random variable $X\sim0.5Normal[2,2]+0.5Normal[20,2]$ and I am trying to use Mathematica to simulate, say, 500 points from this distribution. I briefly looked into Monte Carlo Simulation online, but I think they only use examples where the distribution is a "well-known" (i.e. Normal, Beta, etc.).
1 Answer
$\begingroup$
$\endgroup$
1
RandomVariate[
MixtureDistribution[{.5, .5},
NormalDistribution @@@ {{2, 2},{20, 2}}],
500]
Histogram[%, 30]