# Generates random number from custom multivariable probability distribution

I have the following input

norm = Integrate[Exp[-c*x^2 - c*y^2], {x, 0, Infinity}, {y, 0, Infinity}, Assumptions -> c > 0];
DD[c_] = ProbabilityDistribution[1/norm Exp[-c*x^2 - c*y^2], {x, 0, Infinity}, {y, 0, Infinity}, Assumptions -> c > 0];
data = RandomVariate[DD[4], 15]


The output is

Out[279]= ProbabilityDistribution[(4 c E^(-\[FormalX]1^2 c - \[FormalX]2^2 c))/\[Pi], {\[FormalX]1, 0, \[Infinity]}, {\[FormalX]2, 0, \[Infinity]}, Assumptions -> c > 0]

During evaluation of In[278]:= RandomVariate::noimp: Sampling from ProbabilityDistribution[(16 E^(-4 \[FormalX]1^2-4 \[FormalX]2^2))/\[Pi],{\[FormalX]1,0,\[Infinity]},{\[FormalX]2,0,\[Infinity]}] is not implemented. >>

Out[280]= RandomVariate[ProbabilityDistribution[(16 E^(-4 \[FormalX]1^2 - 4 \[FormalX]2^2))/\[Pi], {\[FormalX]1, 0, \[Infinity]}, {\[FormalX]2, 0, \[Infinity]}], 15]


Excuse me, how to fix the input to let mathematica generate random number according to the custom distribution?

• In the first Integrate expression you have one set of {} too many around the integration variables, i.e. it should just be Integrate[<expression>, {x, ...}, {y, ...}]. Unfortunately, however, once you solve that problem, RandomVariate complains that sampling from such a distribution is not implemented. ProbabilityDistribution is new-ish functionality, so maybe it is still incomplete. – MarcoB Oct 21 '15 at 20:33
• Try DD = ProductDistribution[HalfNormalDistribution[Sqrt[c π]], HalfNormalDistribution[Sqrt[c π]]]. – J. M.'s ennui Oct 21 '15 at 20:39
• @J.M. seems this is a work around, is there any way to generate rather complicated custom multivariable probability function directly? I am afraid MacroB's comment, "...incomplete" is correct. – user26143 Oct 21 '15 at 20:45
• You might be interested in this, then. – J. M.'s ennui Oct 21 '15 at 20:51
• Possible duplicate of RandomVariate from 2-dimensional probability distribution – garej Jul 10 '19 at 8:24