我正在尝试使用uniRoot来解决R
中的下面的等式Equation to solve - Assume Theta-F = 4 and Theta-L = 2
本文概述了...... http://dro.dur.ac.uk/11458/1/11458.pdf
我知道我的代码错误[如下所示],但无法弄清楚原因......
# Choose Theta-F and Theta-L, e = 0.01
e=0.01
tehta_f = 2
theta_l = 4
# Solve for (v)
v <- log(theta_l)/(log(1/e-1))
print(v)
print(1-v)
# Solve (3) for b
our_function_new <- function(b){
s <- (b+v-1)/(2*b+v-2)
w <- ((e/s)^(b+v-1)*((1-e)/(1-s))^(b-1))
return(w)
}
our_function_new <- Vectorize(our_function_new)
roots_our_function_new <- uniroot.all(our_function_new, c(0, 1-v))
roots_our_function_new
Uniroot返回&#34;数字(0)&#34; - &GT;我认为这意味着没有根。 不太确定我哪里出错了