Message Boards Message Boards

0
|
3635 Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Calculation of definite Integral gives no result?

Posted 3 years ago

I'm trying to calculate the expectation of X^2Y by using the law of iterated expectation.enter image description here

So, I need to evaluate the highlighted integral.

The output just prints the integral again. I guess the error is something related to the integral. How do I check what has gone, wrong? And, what should I change to get the result?

6 Replies
fxy = Exp[-1*(((x - ux)/sx)^2 + ((y - uy)/sy)^2 - 
          2 r ((x - ux)*(y - uy)/(sx*sy)))/(2 (1 - r^2))]/(2*Pi*sx*
       sy*(1 - r^2)^0.5);
  fy = (1/(sy (2*Pi)^0.5))*Exp[-(1/2)*((y - uy)/sy)^2];
  f = Rationalize[x^2*y*(fxy/fy), 0] // Simplify // PowerExpand

  (*(35567099 E^((sy (ux - x) + r sx (-uy + y))^2/(
   2 (-1 + r^2) sx^2 sy^2)) x^2 y)/(89153496 Sqrt[1 - r^2] sx)*)

 INT1 = Integrate[f, {y, -Infinity, Infinity}, 
   Assumptions -> {ux > 0, uy > 0, sx > 0, sy > 0, 0 < r < 1, 
     x \[Element] Reals}]

 (*(35567099 Sqrt[\[Pi]/2] sy x^2 (r sx uy + 
    sy (-ux + x)))/(44576748 r^2 sx^2)*)

 Integrate[INT1, {x, -Infinity, Infinity}, 
  Assumptions -> {ux > 0, uy > 0, sx > 0, sy > 0, 0 < r < 1}]

 (*"Integral of 1 does not converge on {-\[Infinity],\[Infinity]}"*)

Looks like integral is divergent.

POSTED BY: Mariusz Iwaniuk

You integrated twice with respect to y...

POSTED BY: Daniel Lichtblau

Oh my mistake, but answer is the same as before.

POSTED BY: Mariusz Iwaniuk

Thank you @Daniel and @Mariusz, the mistake is mine. The integrand will not contain the pdf of y in the denominator, as I will multiply with the pdf of y while evaluating the outer Expectation operation. It works without that.

Posted 3 years ago

Underscore represents Blank it cannot be used in symbol names. Try removing all underscores

u_x // FullForm
(* Pattern[u, Blank[x]] *)

ux // FullForm
(* ux *)
POSTED BY: Rohit Namjoshi

I made the changes, you have suggested. It now shows " Cloud: This computation has exceeded the time limit for your plan". Is there anything I can do about it?

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract