[scilab-Users] Re: intg: results differ substantially from those from Wolfram Alpha, which are correct?

Jean-Yves Baudais jean-yves.baudais at insa-rennes.fr
Fri May 20 15:05:21 CEST 2011


Hello,

> ok, for normal distribution I found a cure - folded normal dist (
> http://en.wikipedia.org/wiki/Folded_normal_distribution) that avoids the
> abs() in the integral; but what about other cases?

   But in the folded normal dist there is no log function as in your 
function. Your problem is the same as

--> function y=f(x),y=exp(-x), endfunction
--> intg(0,1e10,f)
ans=
0

The integral calculation is performed with Monte-Carlo method (I think), 
so the probability to obtain non zero contribution, when the upper limit 
increases, decreases. With lower upper limit the result is good

--> intg(0,1e2,f)
ans=
1

When lim(x->0) f(x)=0, you must pay attention to the upper limit. It is 
your case.



More information about the users mailing list