Re: [R] R's integrate function

2008-09-30 Thread Charles C. Berry
On Tue, 30 Sep 2008, Susanne Pfeifer wrote: Hi, sorry, I was a bit confused and my function looked slightly different from the one I posted before: In any case, you will not get far trying to integrate this one for values of z like 12000 without doing some homework. Simply plugging the func

Re: [R] R's integrate function

2008-09-30 Thread Susanne Pfeifer
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,

Re: [R] R's integrate function

2008-09-30 Thread Susanne Pfeifer
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,

Re: [R] R's integrate function

2008-09-30 Thread Victor Hernando Cervantes Botero
I got the same error. > sessionInfo() R version 2.6.0 (2007-10-03) i386-pc-mingw32 locale: LC_COLLATE=Spanish_Colombia.1252;LC_CTYPE=Spanish_Colombia.1252;LC_MONETARY=Spanish_Colombia.1252;LC_NUMERIC=C;LC_TIME=Spanish_Colombia.1252 attached base packages: [1] stats graphics grDevices utils

Re: [R] R's integrate function

2008-09-30 Thread Charles C. Berry
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 abs

[R] R's integrate function

2008-09-30 Thread Susanne Pfeifer
Hello, I am trying to use R's integrate function to calculate the following integral for z=423: 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,

[R] R's integrate function

2008-09-30 Thread Susanne Pfeifer
Hello, I am trying to use R's integrate function to calculate the following integral for z=423: 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,