
obj <- function(thetac){
for (j in 1:(N/k)) {
for (i in 1:20) {
ps1<-vector(mode = "numeric",20)
ps1 = thetac*x[i,j]
}
mtheta[j] <- y[j]*sum(ps1)-log(1+exp(sum(ps1)))
}
Mtheta=sum(mtheta)/(N/k)
return(Mtheta)
}
optim(par = thetac,fn = obj)
|
楼主: 16639529600
|
4817
4
[程序分享] 在Rstudio中不能运行成功,也不报错,是function有问题么 |
|
本科生 5%
-
|
| ||
|
|
| ||
加好友,备注cda京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


