Re: [R] Optim function in the loop

2009-05-04 Thread Rstarer
Thanks for the reply. optim(initpar,Linn,NULL,method="BFGS",hessian=TRUE,control=list(trace=1,REPORT=1,maxit=300)) The optim is to minimize the negative likelihood function which is performed in function "Linn", Every time the code stops right after optim, for example, the output looks like: "

[R] Optim function in the loop

2009-05-03 Thread Rstarer
Hi all, I wrote the following lines of codes try to do some iterations to find the global optimal values, but the function does not execute properly. Every time codes stop after one iteration right after executing the optim() function. Does anyone could have me to take a look? Thanks. if (count>0