Post Reply 
Integrals involving NORMALD_CDF - possible CAS bug?
02-24-2020, 07:47 PM
Post: #3
RE: Integrals involving NORMALD_CDF - possible CAS bug?
(02-24-2020 12:35 AM)Albert Chan Wrote:  
(02-23-2020 10:47 PM)Nigel (UK) Wrote:  I tried to evaluate the integral \[\int_{-10}^{10} \hbox{NORMALD}(X)*\hbox{NORMALD_CDF}(X)\,{\rm d}X \] in the Home screen, expecting to get an answer close to \(0.5\). Instead I got an error message - "Error: Undefined result". This was strange - the integrand is perfectly well-behaved and gives a smooth graph in the Function app.

XCas also unable to symbolically evaluate the integral.
But, numerical integration is easy, using either romberg, or gaussquad, both returning 0.5

BTW, this integral is trivial if you let c = normald_cdf(x) → dc = normald(x) dx

I(c) = ∫ c dc = c²/2

Let lower limit z = normald_cdf(-10), upper limit = normald_cdf(10) = 1-z

Integral = I(1-z) - I(z) = (1-z+z)(1-z-z)/2 = ½ - z ≈ ½
Thanks for the XCAS information. I was carrying out the original integral as a prelude to integrals of the form \[\int_{-10}^{10} \hbox{NORMALD}(X)\times\hbox{NORMALD_CDF}(\mu, \sigma; X)\,{\rm d}X, \] the idea being to find the probability that a number chosen from a distribution with \(\mu=0\) and \(\sigma=1\) will be greater than a number chosen from a distribution with different \(\mu\) and \(\sigma\). I don't see a way of doing this more general integral analytically (though I may be wrong!) but in any event a numerical answer is fine. The problem with the Prime is that the CAS integration function returns an incorrect analytical expression in exact mode, which stops the Home Screen integration from working.

Nigel (UK)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Integrals involving NORMALD_CDF - possible CAS bug? - Nigel (UK) - 02-24-2020 07:47 PM



User(s) browsing this thread: 2 Guest(s)