[R] R's integrate function

Susanne Pfeifer tiffy at tiffy.it
Tue Sep 30 22:28:22 CEST 2008


Hi,

sorry, I was a bit confused and my function looked slightly different
from the one I posted before:

Susanne Pfeifer schrieb:
>>> 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)

integrate(function(y,z){
sapply(y, function(y,z){
integrate(function(x,z)
1/x*dbeta(0.01,x/(0.01/1.01),(1-x)/(0.01/1.01))*dbeta(y,x/(0.01/1.01),(1-x)/(0.01/1.01))*(1-y)^z,0,1,12000)$value
})
},0,1,12000)

Sorry for the confusion...



More information about the R-help mailing list