Dear R users I am trying to use OPTIMX(OPTIM) for nonlinear optimization.
There is no error in my code but the results are so weird (see below). When I ran via OPTIM, the results are that Initial values are that theta0 = 0.6 1.6 0.6 1.6 0.7. (In fact true vales are 0.5,1.0,0.8,1.2, 0.6.) -------------------------------------------------------------------------------------------- > optim(par=theta0, fn=obj.fy, method="BFGS", control=list(trace=1, > maxit=10000), hessian=T) initial value -0.027644 final value -0.027644 converged $par [1] 0.6 1.6 0.6 1.6 0.7 $value [1] -0.02764405 $counts function gradient 1 1 $convergence [1] 0 $message NULL $hessian [,1] [,2] [,3] [,4] [,5] [1,] 0 0 0 0 0 [2,] 0 0 0 0 0 [3,] 0 0 0 0 0 [4,] 0 0 0 0 0 [5,] 0 0 0 0 0 -------------------------------------------------------------------------------------------- When I ran via OPTIMX, the results are that -------------------------------------------------------------------------------------------- > optimx(par=theta0, fn=obj.fy, method="BFGS", control=list(maxit=10000), > hessian=T) par fvalues method fns grs itns conv KKT1 KKT2 xtimes 1 0.6, 1.6, 0.6, 1.6, 0.7 -0.02764405 BFGS 1 1 NULL 0 TRUE NA 8.71 > -------------------------------------------------------------------------------------------- Whenever I used different initial values, the initial ones are the answer of OPTIMX(OPTIM). Would you plz explain why it happened? or any suggestion will be greatly appreciated. Regards, Kathryn Lord -- View this message in context: http://r.789695.n4.nabble.com/optimization-problems-tp3741005p3741005.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.