how to restrict the correlation parameter in estimating sw?
-
horsehandsome
- Posts: 8
- Joined: Mon Sep 28, 2009 12:51 pm
how to restrict the correlation parameter in estimating sw?
Hi I am estimating a state-space model where there are two state variables. I allow two shocks in the transition equations to be correlated in the spirit to Morley, Nelson and Zivot (2003) and Sinclair (2009). My question is: how to restrict the correlation parameter in 'sw' to be less than 1 in its absolute term. I ended up getting some number way above 1. Thanks.
Jason
Jason
Re: how to restrict the correlation parameter in estimating sw?
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-
horsehandsome
- Posts: 8
- Joined: Mon Sep 28, 2009 12:51 pm
Re: how to restrict the correlation parameter in estimating sw?
Thanks for you reply, Tom. But what I ended up having is above 1 correlation along with non-convergence warning and some nonsensical parameters. Is there any way to constrain the correlation parameter within the (-1,1) band while allowing it to be freely estimated? Thanks.
Re: how to restrict the correlation parameter in estimating sw?
Use this as the parameter set:
Code: Select all
nonlin mu d sn ph1 ph2 se rhone rhone<=1.0-
horsehandsome
- Posts: 8
- Joined: Mon Sep 28, 2009 12:51 pm
Re: how to restrict the correlation parameter in estimating sw?
Thanks a lot! It works.