Displaying 1 result from an estimated 1 matches for "inbeta".
Did you mean:
pnbeta
2000 Apr 15
0
problem with function involving ifelse and integrate
Dear R people,
There is probably a simple explanation for the following, but I have been
unable to come up with one.
I want to integrate x(1-x)^{-1/3} over intervals of the form [0,a] where a
is between 0 and 1.
Hence, consider:
fm <- function(x) ifelse(x==0 | x==1 ,0,(x*(1-x))^(-1/3))
inbeta <- function(x)
{
ifelse(x==0,0,integrate(fm,0,x,maxpts = NULL, eps=0.01))
}
Comments:
integrate(fm,0,x,maxpts = NULL, eps=0.01) works ok for everything I tried
it for except x = 0 for some reason, hence the ifelse above.
The problem is with inbeta. Trying inbeta(x) for any value of x other...