Obtain incomplete moments of bivariate normal as func of CDF?

Posted 10 months ago
972 Views
|
6 Replies
|
1 Total Likes
|
 Hi I am a Mathematica/Wolfram novice so apologies for the elementary nature of this question.I am looking to use Mathematica to see if a few integrals related to bivariate distributions have closed forms.In particular I am interested in the incomplete moments: Integrate[ x^m y^n Exp[ -(x^2 + y^2 - 2 \[Rho] x y)/(2 (1 - \[Rho]^2))]/(2 \[Pi] Sqrt[ 1 - \[Rho]^2]), {x, a, Infinity}, {y, b, Infinity}] I suspect they can be written in terms of the standard CDF- L(a,b,rho) in the Abramowitz /Stegun formalism (eqn 26.3.3).However, as a test case, trying to get Mathematica to evaluate the above with m=n=0 leads it into a loop from which it never seems to emerge.How could I define the default m=m=0 case and see if it can express the m>0 n>0 case in terms of it?Many thanks. Tom
6 Replies
Sort By:
Posted 10 months ago
 I only found for: m = n = a = b = 0,\[Rho] < 1 f[a_, b_, \[Rho]_, m_, n_] := NIntegrate[(E^((-x^2 - y^2 + 2 x y \[Rho])/(2 (1 - \[Rho]^2))) x^m y^n)/( 2 \[Pi] Sqrt[1 - \[Rho]^2]), {x, a, Infinity}, {y, b, Infinity}] f[0, 0, 1/2, 0, 0] (*0.333333*) (\[Pi] + 2 ArcSin[\[Rho]])/(4 \[Pi]) /. \[Rho] -> 1/2 // N (*0.333333*) I think that does not have finite closed-form expression in terms of very large class of special functions.
Posted 10 months ago
 Hi MariuszThanks for the reply.I donâ€™t necessarily need finite. The m=n=0 form is a well known function (see for instance the abramowitz chapter). My hunch is that the m> 0, n>0 form can be expressed in terms of it, (in manner similar to the Isserlis/Wick theory but I suspect In a simpler way). Do you know if Mathematica can be used to search for a simplification of the more complex In terms of the simpler?Thanks again Tom
Posted 10 months ago
 If a=b=0,m>0,n>0 and \[Rho] < 1 then:  g[m_, n_, \[Rho]_] := 1/\[Pi] 2^(1/2 (-6 + m + n)) (1 - \[Rho]^2)^( 1/2 (1 + m + n)) (2 Gamma[(1 + m)/2] Gamma[(1 + n)/2] Hypergeometric2F1[( 1 + m)/2, (1 + n)/2, 1/2, \[Rho]^2] - ( m n Gamma[m/2] Gamma[n/ 2] (-(-1 + \[Rho]^2) Hypergeometric2F1[(2 + m)/2, (2 + n)/ 2, -(1/2), \[Rho]^2] + (-1 + (4 + m + n) \[Rho]^2) Hypergeometric2F1[(2 + m)/2, (2 + n)/2, 1/ 2, \[Rho]^2]))/((1 + m) (1 + n) \[Rho])) g[2, 3, 1/2] // N (* 1.34643*) f[0, 0, 1/2, 2, 3] (* 1.34643*) Regards M.I.PS. I have another integral: Integrate[( E^((-x^2 - y^2 + 2 x y \[Rho])/(2 (1 - \[Rho]^2))) x^m y^n)/( 2 \[Pi] Sqrt[1 - \[Rho]^2]), {x, -Infinity, Infinity}, {y, -Infinity, Infinity}] == 1/\[Pi] 2^(1/2 (-4 + m + n)) (1 - \[Rho]^2)^( 1/2 (1 + m + n)) (( n Gamma[1 + m/2] Gamma[n/ 2] (-(-1 + \[Rho]^2) Hypergeometric2F1[(2 + m)/2, (2 + n)/ 2, -(1/2), \[Rho]^2] + (-1 + (4 + m + n) \[Rho]^2) Hypergeometric2F1[(2 + m)/2, (2 + n)/2, 1/ 2, \[Rho]^2]) (-1 + Cos[m \[Pi]] + I Sin[m \[Pi]]))/((1 + m) (1 + n) \[Rho]) + 1/((1 + m) (1 + n) \[Rho]) (-1)^(1 + n) n Gamma[1 + m/2] Gamma[n/ 2] (-(-1 + \[Rho]^2) Hypergeometric2F1[(2 + m)/2, (2 + n)/ 2, -(1/2), \[Rho]^2] + (-1 + (4 + m + n) \[Rho]^2) Hypergeometric2F1[(2 + m)/2, (2 + n)/2, 1/ 2, \[Rho]^2]) (-1 + Cos[m \[Pi]] + I Sin[m \[Pi]]) + Gamma[(1 + m)/2] Gamma[(1 + n)/2] Hypergeometric2F1[(1 + m)/2, ( 1 + n)/2, 1/ 2, \[Rho]^2] (1 + Cos[m \[Pi]] + I Sin[m \[Pi]]) + (-1)^ n Gamma[(1 + m)/2] Gamma[(1 + n)/2] Hypergeometric2F1[(1 + m)/ 2, (1 + n)/2, 1/ 2, \[Rho]^2] (1 + Cos[m \[Pi]] + I Sin[m \[Pi]]))  $$\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }\frac{e^{\frac{-x^2-y^2+2 x y \rho }{2 \left(1-\rho ^2\right)}} x^m y^n}{2 \pi \sqrt{1-\rho ^2}}dydx=\frac{2^{\frac{1}{2} (-4+m+n)} \left(1-\rho ^2\right)^{\frac{1}{2} (1+m+n)} \left(\frac{n \Gamma \left(1+\frac{m}{2}\right) \Gamma \left(\frac{n}{2}\right) \left(-\left(-1+\rho ^2\right) \, _2F_1\left(\frac{2+m}{2},\frac{2+n}{2};-\frac{1}{2};\rho ^2\right)+\left(-1+(4+m+n) \rho ^2\right) \, _2F_1\left(\frac{2+m}{2},\frac{2+n}{2};\frac{1}{2};\rho ^2\right)\right) (-1+\cos (m \pi )+i \sin (m \pi ))}{(1+m) (1+n) \rho }+\frac{(-1)^{1+n} n \Gamma \left(1+\frac{m}{2}\right) \Gamma \left(\frac{n}{2}\right) \left(-\left(-1+\rho ^2\right) \, _2F_1\left(\frac{2+m}{2},\frac{2+n}{2};-\frac{1}{2};\rho ^2\right)+\left(-1+(4+m+n) \rho ^2\right) \, _2F_1\left(\frac{2+m}{2},\frac{2+n}{2};\frac{1}{2};\rho ^2\right)\right) (-1+\cos (m \pi )+i \sin (m \pi ))}{(1+m) (1+n) \rho }+\Gamma \left(\frac{1+m}{2}\right) \Gamma \left(\frac{1+n}{2}\right) \, _2F_1\left(\frac{1+m}{2},\frac{1+n}{2};\frac{1}{2};\rho ^2\right) (1+\cos (m \pi )+i \sin (m \pi ))+(-1)^n \Gamma \left(\frac{1+m}{2}\right) \Gamma \left(\frac{1+n}{2}\right) \, _2F_1\left(\frac{1+m}{2},\frac{1+n}{2};\frac{1}{2};\rho ^2\right) (1+\cos (m \pi )+i \sin (m \pi ))\right)}{\pi }$$
Posted 10 months ago
 Your second example can be simplified (somewhat) that removes the explicit use of imaginary numbers: f = Expectation[x^n y^m, {x, y} \[Distributed] BinormalDistribution[{0, 0}, {1, 1}, \[Rho]], Assumptions -> {n > 0, m > 0, n \[Element] Integers, m \[Element] Integers}] // FullSimplify  $$\frac{2^{\frac{1}{2} (m+n-4)} \left(1-\rho ^2\right)^{\frac{1}{2} (m+n+1)} \left(\left((-1)^m+1\right) \left((-1)^n+1\right) \Gamma \left(\frac{m+1}{2}\right) \Gamma \left(\frac{n+1}{2}\right) \, _2F_1\left(\frac{m+1}{2},\frac{n+1}{2};\frac{1}{2};\rho ^2\right)-\frac{\left((-1)^m-1\right) m \left((-1)^n-1\right) \Gamma \left(\frac{m}{2}\right) \Gamma \left(\frac{n}{2}+1\right) \left((m+2) \left(\rho ^2-1\right) \left(\rho ^2 (m+n+4)-1\right) \, _2F_1\left(\frac{m+4}{2},\frac{n+2}{2};-\frac{1}{2};\rho ^2\right)+\left((m+2) \rho ^2 (m+2 n+7)-m+(n+1) (n+3) \rho ^4-2\right) \, _2F_1\left(\frac{m+2}{2},\frac{n+2}{2};-\frac{1}{2};\rho ^2\right)\right)}{(m+1) (m+3) (n+1) (n+3) \rho ^3}\right)}{\pi }$$Now for specific small values of $n$ and $m$ great simplifications can be obtained by using FunctionExpand and FullSimplify: TableForm[Flatten[Table[{n, m, f // FunctionExpand // FullSimplify}, {n, 1, 4}, {m, n, 4}], 1], TableHeadings -> {None, {"\nn", "\nm", "Integral(x^n y^m * PDF,{x,0,Infinity},{y,0,Infinity}, \nAssumptions -> 0 < \[Rho] < 1)"}}] 
 Using Assumptions helps. For example: Integrate[x y PDF[BinormalDistribution[{0, 0}, {1, 1}, \[Rho]], {x, y}], {x, 0, \[Infinity]}, {y, 0, \[Infinity]}, Assumptions -> 0 < \[Rho] < 1] gets you $$\frac{\rho \left(\sqrt{\frac{1}{\rho ^2}-1}-\cos ^{-1}(\rho )+\pi \right)}{2 \pi }$$
 Many thanks Mariusz & Jim(thanks also for the "assumptions" lead. That looks very useful to me!)There are indeed some explicit results hidden here.Unfortunately the incomplete version is (with arbitrary lower limits) is vital for what I want to do. What keeps nagging at me (and is the origin of the hunch) is the fact that if you write out a standard MGF type approach, and try and evaluate the "incomplete" expectation value of, say, $$M(u,v)=E[\exp(u x + v y)]=\int_{a}^{\infty}\int_{b}^{\infty} \exp(u x + v y)g(x,y,\rho)dxdy$$ you get a form that looks like with a simple change of variable you can express (I believe) as a simple version of the classical form of the standard, tabulated CDF $$L(a^{\star},b^{\star},\rho)=f(u,v)\int_{a^{\star}(u,v)}^{\infty} \int_{b^{\star}(u,v)}^{\infty} g(x,y,\rho)dxdy$$. Then you can explicitly evaluate $$(\partial^{2} M/\partial u \partial v)_{ u=0,v=0}$$ etc. to get the desired forms. The algebra looks kinda lengthy so I was hoping to get Mathematica to do the heavy lifting but alas it doesn't want to express results in terms of the CDF as a special function.I was thinking there may be way to define the CDF as my own function then get Mathematica to write stuff in terms of this but a lack of experience with the product left me floundering.Anyhow, thanks for the pointers!Tom