Message-ID: <48E2892E.9090205@tiffy.it>
Date: 2008-09-30T20:16:46Z
From: Susanne Pfeifer
Subject: R's integrate function
In-Reply-To: <Pine.LNX.4.64.0809301008190.8645@tajo.ucsd.edu>
Hi Charles,
hi Victor
Charles C. Berry schrieb:
> What verson of R?
>
> Works for me:
>
>> integrate(function(y,z){
> + sapply(y, function(y,z){
> + integrate(function(x,z)
> +
> 1/x*dbeta(0.01,x/(0.005/1.005),(1-x)/(0.005/1.005))*dbeta(y,x/(0.005/1.005),(1-x)/(0.005/1.005))*(1-y)^z,0,1
>
> + ,423)$value
> + })
> + },0,1,423)
> 18.9513 with absolute error < 0.0011
I have updated my version to the 2.7.2 and it works fine.
Thank you for the hint.
If I increase my constant now from 423 to 11,000, it still works fine
(producing a value of 8.226982) but if I increase it further (say to
12,000), R doesn't seem to calculate it right (resulting in
3.871566e-05) even if I increase the number of subdivisions.
Do you have any idea, why?
Thanks for your help again,
Tiffy