0
IM現在執行使用非參數平滑估計paramneters選址模型.....平滑paramater之一是,我有優化lamdha ...優化使用「nlminb」
所以在這種我決定使用「nlminb函數」來實現它.....
但是,我的程序給了我相同的「$ par」值,即使它迭代了150次並且做了200次評估(默認情況下) .....這是它選擇「起始值$面值」(即0.000001 ......我想,一定有什麼毛病我編寫的程序....
我看編程如: - (注:W是我要優化參數和LOO是 立場留一出
BEGIN
Myfunc <- function(w, n1, n2, v1, v2, g)
{ ## open loop for main function
## DATA generation
# generate data from group 1 and 2
# for each group: discretise the continuous to binary
# newdata <- combine the groups 1 and 2
## MODEL construction
countError <- 0
n <- nrow(newdata)
for (k in 1:n)
{# open loop for leave-one-out
# construct model based on n-1 object using smoothing method
# classify omitted object
countError <- countError + countE
} # close loop for LOO process
Error <- countError/n # error rate counted from LOO procedure
return(Error) # The Average ERROR Rate from LOO procedure
} # close loop for Myfunc
library(stats)
nlminb(start=0.000001, Myfunc, lower=0.000001, upper=0.999999,
control=list(eval.max=100, iter.max=100))
END
可能有人幫我... ...
您的關注和指南的高度讚賞和really100需要......
Hashibah, STATIS抽動博士生