我想找到以下函数的根:
x=0.5
f <- function(y) ((1-pbeta(1-exp(-0.002926543
*( 107.2592+y)^1.082618 *exp(0.04097536*(107.2592+y))),shape1=0.2640229,shape2=0.1595841)) -
(1-pbeta(1-exp(-0.002926543*(x)^1.082618 *exp(0.04097536*(x))),shape1=0.2640229,shape2=0.1595841))^2)
sroot=uniroot(f, lower=0, upper=1000)$root
Run Code Online (Sandbox Code Playgroud)
uniroot错误(f,lower = 0,upper = 1000):端点处的f()值不是符号相反
我该如何解决错误?
r ×1