This gives two options for that; the first pegs the correlation coefficient at 1 (if the unrestricted max is >1, the restricted max should be at 1). The second estimates the covariance matrix in packed lower triangular form. If the restricted max is at perfect correlation, the (2,2) element of the lower triangular should be 0.
- Code: Select all
*
* Unrestricted UC model, allowing for correlation between the shocks.
* The maximum occurs at rho=1 (possible since we have only one
* observable, so having just a single effective shock is OK).
*
compute rhone=0.0,sn=.1
nonlin mu d sn ph1 ph2 se rhone=1.0
*
frml swf = ||sn^2|rhone*abs(sn)*abs(se),se^2||
dlm(presample=ergodic,a=af,z=zf,sw=swf,c=c,f=f,y=lgdp,method=bfgs,$
type=filter) / statesur
*
* Alternative parameterization for covariance matrix of shocks.
*
dec packed swlower(2,2)
*
frml swf = %ltouterxx(swlower)
compute swlower(1,1)=.7,swlower(2,1)=0.0,swlower(2,2)=.7
nonlin mu d ph1 ph2 swlower
dlm(presample=ergodic,a=af,z=zf,sw=swf,c=c,f=f,y=lgdp,method=bfgs,$
type=filter) / statesur