Computing probabilities from joint distribution of functions of random variables
5 views (last 30 days)
Show older comments
I have three independent random variables, each from a normal distribution with zero mean, but respective variances.
x1 ~ N(0,s1)
x2 ~ N(0,s2)
x3 ~ N(0,s3)
I need to find the joint probability: P(x1+x3>0, x2-x3 >0)
My approach has been to form functions of the random variables, create a joint distribution and then find the probabilities. However, I'm having difficulty coding this correctly in Matlab. Any thoughts?
My functions of random variables:
y1 = x1+x3
y2 = x2-x3
y3 = x3 % included because I need as many equations as unknowns
So,
x1 = y1-y3
x2 = y2-y3
x3 = y3
The Jacobian of the transformation is equal to 1.
So,
fY = 1/((2*pi)^(3/2)*det(SIGMA)^(1/2))*exp(-0.5*Y'*inv(SIGMA)*Y),
where Y = [y1-y3, y2-y3, y3] and SIGMA = [s1,0,0; 0,s2,0; 0,0,s3]
Now I need to compute P(y1>0, y2>0). Any ideas? Best practices? Thanks!
1 Comment
bym
on 29 Jan 2013
since your means are 0, then the P(x1+x3>0) = .50 The same would hold true for x2-x3>0. Then I would say the answer of both being true is .25 (unless I am missing something entirely)
Answers (1)
Roger Stafford
on 24 Jan 2013
You can use matlab's 'integral3' function with numerical integration taken with respect to y1, y2, and y3. Your limits of integration would be:
y1min = 0, y1max = inf, y2min = 0, y2max = inf, y3min = -inf, y3max = inf
Your Jacobian is 1 so you don't have to include it in the integrand. The integrand would be obtained by substituting in your joint density function using x1, x2, and x3, the corresponding y1, y2, and y2 values in accordance with the transformation you have worked out. Note however that your equation for x2 is incorrect and should be
x2 = y2+y3
and not the one you have written.
2 Comments
bym
on 29 Jan 2013
I don't have the latest Matlab, so I don't know if this will help but you could try:
vectorize(fun)
ans =
@(y1,y2,y3)1./((2.*pi).^(3./2).*det(SIGMA).^(1./2)).*exp(-0.5.*[y1;y2;y3]'.*inv(SIGMA).*[y1;y2;y3])
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!