NIntegrate bug in Mathematica 6?
- To: mathgroup at smc.vnet.net
- Subject: [mg84168] NIntegrate bug in Mathematica 6?
- From: vlad <volodymyr.babich at gmail.com>
- Date: Wed, 12 Dec 2007 05:12:50 -0500 (EST)
The following code in Mathematica 6:
Clear[logdist1, pdfLog1, \[Mu]1, \[Sigma]1]
logdist1 =
LogNormalDistribution[(\[Mu]1 - \[Sigma]1^2/2), \[Sigma]1];
pdfLog1[x_] := PDF[logdist1, x]
\[Mu]1 = 0.05;
\[Sigma]1 = 0.2;
NIntegrate[Min[100, 100 b1]*pdfLog1[b1], {b1, 0, 5}]
NIntegrate[Min[100, 100 b1]*pdfLog1[b1], {b1, 0, 500}]
NIntegrate[Min[100, 100 b1]*pdfLog1[b1], {b1, 0, 10000}]
NIntegrate[Min[100, 100 b1]*pdfLog1[b1], {b1, 0, +\[Infinity]}]
Produces the following output:
94.1407
38.1789
38.1789
94.1407
Note that the first and the last integrals have upper bounds of 5 and
\
[Infinity]
The middle ones have bounds 500 and 10000
All of the answers should be the same (we are way in the tail of the
random variable density). I get no warnings or errors.
Shouldn't Mathematica send me some warning that it has difficulty with
convergence? Can I get Mathematica to send me a warning? If not,
can I trust the numerical integration routines?
Incidentally, Mathematica 5.2 give the correct answer of 94.1407 in
all four cases.