intg: results differ substantially from those from Wolfram Alpha, which are correct?

Ginters Bušs ginters.buss at gmail.com
Fri May 20 13:49:59 CEST 2011


On Fri, May 20, 2011 at 2:15 PM, Ginters Bušs <ginters.buss at gmail.com>wrote:

>
>
> On Fri, May 20, 2011 at 2:09 PM, Ginters Bušs <ginters.buss at gmail.com>wrote:
>
>> Dear all,
>>
>> Let's integrate:
>>
>> function y=f(x, a,
>> sigma),y=(1/sqrt(2*%pi))*log(abs(a+sigma*x))*exp(-(x^2)/2),endfunction
>>
>> out=intg(-1e+2,1e+2,list(f,1,.1))
>>
>> out=8.605D-49
>>
>> but Wolfram Alpha gives out= -0.111
>>
>>
> which is a totally different answer.
>>
>> I've noticed that intg and integrate incline to give values close to zero
>> when boundaries tend to infinity.   So, I trust Wolfram Alpha more.  How to
>> get around the apparent mistakes in intg, integrate (particularly, I'm
>> interested in indefinite integrals)?
>>
>> Gin.
>>
>> Pardon, Wolfram alpha gives -0.005; if the 2nd argument 0.1 is increase to
> 0.4, then intg gives 1.555D-47, and Wolfram Alpha gives -0.111, the
> difference increases.
>

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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20110520/bc9e05bf/attachment.htm>


More information about the users mailing list