Code: Select all
dlm(startup=SolveModel(),y=yf,$
a=afull,f=ffull,c=cfull,sw=swfull,presample=ergodic,$
pmethod=simplex,piters=5,method=bfgs,iters=100,$
reject=(eta<1.0.or.eta>1.05.or.rho>=1.0)) 1948:1 2002:2You can't use REJECT as a cheap way to impose a restriction when the boundary is feasible. If, for instance, your function is computable at x>=1.0 and you want to impose x<=1.0, you need to do a parameter set that includes
x x<=1.0
The option REJECT=(X>1.0) will cause the optimization to fail to converge if the function is increasing at x=1.0. Given the shape of the function, the optimization will naturally be testing values of x larger than 1. When it's told that the value there is NA (as a result of the REJECT), it will cut the step size, but will probably have to cut it quite a few times before getting down below 1.0. The next iteration will likely need even more subiterations in order to get under 1, etc. Eventually, it will hit a subiterations limit.
The proper course is to use the constrained optimization, which, in this case, will come in from above x=1.0. It uses a penalty function for values above 1.0, but that penalty function starts relatively small, so at least initially (given the shape of the function), it will have a higher total (likelihood less penalty) for values above 1. The penalty function increases as you iterate more, eventually dominating the function value and forcing x towards 1. You'll probably end up with the final estimated x being something like 1.000001.