[R] Solving an integral in R gives the error “The integral is probably divergent”

peter dalgaard pdalgd at gmail.com
Sat Apr 13 09:49:51 CEST 2013


On Apr 13, 2013, at 06:47 , Thomas Lumley wrote:

> On Sat, Apr 13, 2013 at 6:31 AM, peter dalgaard <pdalgd at gmail.com> wrote:
> But is it supposed to be t^{-3/2} or t^{-0.5}?? The formula has the former and the code the latter, and the integral is clearly divergent with the former.
> 
> 
> I didn't look at that -- I just assumed that the code would reproduce the reported error. 
> 

So did I, but I looked at the formula instead, and got confused when you obtained convergence. 

For the benefit of other recipients:

Of course it makes quite a difference since t^-alpha is integrable near zero iff alpha < 1, and it is the dominating term when x==0. 

Numerically, even theoretically convergent integrals can confuse the algorithm, basically because it tries to infer global behavior from a few evaluations of the integrand.


-pd

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list