Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: integrals - correction!


From   "FEIVESON, ALAN H. (AL) (JSC-SD) (NASA)" <alan.h.feiveson@nasa.gov>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: integrals - correction!
Date   Fri, 22 Nov 2002 12:57:38 -0600

Dear Statalist:

Sorry - Please disregard my last message on this - I took the integration on
y to be over -oo to +oo. However, for fixed x, the partial integral over y
for fixed x is just the probability that Y< 0.56 |X=x, where X and Y are the
random variables whose joint distribution is f(x,y). Since the conditional
distribution of Y|X is also a normal with adjusted mean and variance (e.g.
see T.W. Anderson -An Introduction to Multivariuate Statistical Analysis -
Wiley), you can express P(Y < 0.56) in terms of the cumulative normal
function PHI ("norm" in Stata). Thus after integration by y, you are left
with something like x*PHI( (x-a)/b) to integrate with respect to x. You
could do this numerically, but  you might be able to get this integral in
closed form also, by integrating by parts twice. First differentiate the PHI
and integrate x, leaving an integral of the form x*x*f( (x-a)/b) ) where
f(x) is the normal density. Then differentiate x and integrate x*f( (x-a)/b)
) . The latter is a perfect differential.

Al Feiveson

-----Original Message-----

From: Clara [mailto:bldvegac@xa.bs.ehu.es]
Sent: Friday, November 22, 2002 10:26 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: integrals


hi, I need to solve a double integral. This integral does not have an
analytic solution, then i need to do this numerically. There are someone
that know how can i do this in stata??

I need to integral:
 x*f(x,y)dxdy

where f(x,y) is a bivariate normal density function.
the integration intervals are: [-infinity, 0.56]

thanks, clara   



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index