I would like to simulate from a joint distribution multiplied by a constant.

e.g. 3*NormalDistribution[0,1]*NormalDistribution[1,1]

I tried using something like ProductDistribution but that doesn't work.

Can anyone give me any hints.



d1 = NormalDistribution[];
d2 = NormalDistribution[1, 1];
d3 = TransformedDistribution[3 x y, {Distributed[x, d1], Distributed[y, d2]}];
(* or d3 = TransformedDistribution[3 x y, 
   Distributed[{x, y}, BinormalDistribution[{0, 1}, {1, 1}, 0]]]; thanks: @BobHanlon *)

data = RandomVariate[d3, 100];
Histogram[data, 10, "PDF"]

enter image description here

  • 1
    $\begingroup$ d3 can also be defined as d3 = TransformedDistribution[3*x*y, Distributed[{x, y}, BinormalDistribution[{0, 1}, {1, 1}, 0]]]; This form is more general and could readily handle cases where x and y are correlated. $\endgroup$
    – Bob Hanlon
    Dec 19 '14 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.