寻找方程的根

时间:2016-01-18 11:29:17

标签: r equation

我想解决下面给出的等式wrt c

enter image description here

其中n = k = 30,x在下面给出。

我在uniroot包中使用了rootSolve命令,并在代码后面给了我一个错误。

model <- function(c){
  sx <- apply(x,1, function(x) exp(c*x))
  numerator <- sum(sx[2:30])-29*sx[1]
  denumerator <- (30*29*(sx[1]-1))
  numerator/denumerator-0.2542
}
ss <- uniroot(model, c(0,1))

根是已知的并且是0.0331。

那我的错误在哪里?如何解决?

0 个答案:

没有答案
相关问题