From macrakis at alum.mit.edu  Tue Dec 14 01:52:49 2010
From: macrakis at alum.mit.edu (Stavros Macrakis)
Date: Mon, 13 Dec 2010 19:52:49 -0500
Subject: [Rd] 0.5 != integrate(dnorm,0,20000) = 0
In-Reply-To: <OF0969FD50.6188C4C4-ON852577F2.005296E8-852577F2.005296EC@american.edu>
References: <19709.61472.158760.44576@lynne.math.ethz.ch>
	<4CFD729C.6050704@structuremonitoring.com>
	<alpine.LFD.2.00.1012070734070.10594@gannet.stats.ox.ac.uk>
	<OF8288EBC8.20FC0DC2-ON852577F2.004AF65E-852577F2.004AF661@american.edu>
	<4CFE48B2.2090804@uwaterloo.ca>
	<OF0969FD50.6188C4C4-ON852577F2.005296E8-852577F2.005296EC@american.edu>
Message-ID: <AANLkTikbnyL1iXUD4ZBoini5vG8oQUtLeJCnujTNRGX3@mail.gmail.com>

I'd suggest that the original sin here is calling some particular
numerical integration routine 'integrate', which gives the user an
illusory sense of power.... Functions have to be well-behaved in
various ways for quadrature to work well, and you've got to expect
things like

> integrate(function(x)tan(x),0,pi)
Error in integrate(function(x) tan(x), 0, pi) :
  roundoff error is detected in the extrapolation table   <<< a 'good'
error -- tells the user something's wrong
> integrate(function(x)tan(x)^2,0,pi)
1751.054 with absolute error < 0                                  <<< oops
> integrate(function(x)1/(x-pi/2)^2,0,pi)                         <<< the same pole (analytically)
Error in integrate(function(x) 1/(x - pi/2)^2, 0, pi) :         <<<
gets a useful error in this form
  non-finite function value

But by that argument, I suppose you shouldn't call floating-point
addition "+" :-)

                -s



[Rd] 0.5 != integrate(dnorm,0,20000) = 0
Stavros Macrakis