Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'RandomVariate' topicStudent Support Forum > General > Archives > "RandomVariate"

Next Comment >Help | Reply To Topic
Author Comment/Response
Sinval Santos
05/13/12 09:58am

f1[x_] = Piecewise[{{(2/9) x, 0 <= x <= 3}}];

a1 = ProbabilityDistribution[f1[x], {x, 0, 3}];

Here, with a random variable, RandomVariate works.

RandomVariate[a1,5]

{1.14944, 2.82497, 1.45736, 2.86544, 1.56023}

f2[x_, y_] = Piecewise[{{(29/27)x-y,0<=x<=3 && 0<=y<=3}}];

a2=ProbabilityDistribution[f2[x,y],{x,0,3},{y,0,3}];

Here, with two random variables, RandomVariate does not work.

RandomVariate[a2,5]

RandomVariate::noimp: Sampling from ProbabilityDistribution[\[Piecewise](29 \[FormalX]1)/27-\[FormalX]20<=\[FormalX]1<=3&&0<=\[FormalX]2<=3
0   True
,{\[FormalX]1,0,3},{\[FormalX]2,0,3}] is not implemented. >>

Is there any way to run?

URL: ,

Subject (listing for 'RandomVariate')
Author Date Posted
RandomVariate Sinval Santos 05/13/12 09:58am
Re: RandomVariate Michael 05/26/12 8:18pm
Next Comment >Help | Reply To Topic