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){
k=k+0.05;
mu0=c(83+k,0,0)
Sigma0= diag(0.4,3)
initpar=c(.1+10*k,10*k,10*k,10*k) # initial parameters for Phi[1,1], the 2
Q?s and R
est=optim(initpar,Linn,NULL,method="BFGS",hessian=TRUE,control=list(trace=1,REPORT=1,maxit=300))
stderr=sqrt(diag(solve(est$hessian)))
estimate=est$par
u=cbind(estimate,stderr)
if (u[1]>0 & u[2]>0 & u[3]>0 & u[4]>0){
print("mu0=");print(mu0);
print("initpar=");print(initpar)
#break
} else {count=-1;
}
}