2

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?

user26143
  • 185
  • 1
  • 9

0 Answers0