Stock Watson Example
Stock Watson Example
Working through he Stock Watson state space example. The final chart:
does not match the original paper:
So I am wondering what I am missing? I typically see this indexes reported as nonstationary, which I thought the ACC code would accomplish.
Thanks!
does not match the original paper:
So I am wondering what I am missing? I typically see this indexes reported as nonstationary, which I thought the ACC code would accomplish.
Thanks!
Re: Stock Watson Example
Sorry. Which Stock-Watson state space example?
Re: Stock Watson Example
Yeah, I guess there are more than one.
Example 6.1 from the Handbook for State-Space models.
Example 6.1 from the Handbook for State-Space models.
Re: Stock Watson Example
I think the answer is that Stock and Watson (91) impose the identity Ct-1 = delta(Ct-1) + Ct-2, which alters the transition equation. Example 6.1 in the state space manual does not include the same identity. At least I think that is what is going on.
Re: Stock Watson Example
No. That's just incorporating into the model the accumulation of the changes which is done with the
set indicator 1959:2 * = xstates(t)(1)
acc indicator
graph(footer="Coincident Indicator, Filtered Version")
# indicator
in the RATS program. (Basically, they just build that into the state recursion).
Our program actually estimates the model as described in the paper. However, it appears that they then insert a drift (calculated from the means of the four input data series) into the accumulation of the C, which is why theirs trends and ours doesn't. (The first graph is non-stationary, just not drifting non-stationary). You can't freely estimate the drift in the indicator since that's unidentified when combined with the means of the four series, so they add what's a fairly arbitrary drift calculation. The non-drifting "cycle" is probably closer to what is done in most state-space models of the kind nowadays.
set indicator 1959:2 * = xstates(t)(1)
acc indicator
graph(footer="Coincident Indicator, Filtered Version")
# indicator
in the RATS program. (Basically, they just build that into the state recursion).
Our program actually estimates the model as described in the paper. However, it appears that they then insert a drift (calculated from the means of the four input data series) into the accumulation of the C, which is why theirs trends and ours doesn't. (The first graph is non-stationary, just not drifting non-stationary). You can't freely estimate the drift in the indicator since that's unidentified when combined with the means of the four series, so they add what's a fairly arbitrary drift calculation. The non-drifting "cycle" is probably closer to what is done in most state-space models of the kind nowadays.
Re: Stock Watson Example
Now I see that - it is kind of buried in the paper.
Also, do you happen to know if you glue the transition equation together different from the paper? It looks like the error process in the paper are made independent of each other and the common growth rate by assuming the D(L) lag polynomial is a diagonal matrix, but in the program it looks like the same assumption is achieved by a different ordering of the variables. This appears to make it easier to set up the a matrix with:
compute %psubmat(1,2*i+1,2*i+1,t(d(i)))
Thanks!
Also, do you happen to know if you glue the transition equation together different from the paper? It looks like the error process in the paper are made independent of each other and the common growth rate by assuming the D(L) lag polynomial is a diagonal matrix, but in the program it looks like the same assumption is achieved by a different ordering of the variables. This appears to make it easier to set up the a matrix with:
compute %psubmat(1,2*i+1,2*i+1,t(d(i)))
Thanks!
Re: Stock Watson Example
One last question on this code - how does RATS know which parameters of the matrices are fixed and which are free? In other words, the phi's are initially set at 0 but change, whereas fixed components set at zero or one remain fixed. I am just not sure what is the different in the DECLARE functions that distinguishes the fixed from free parameters.
Re: Stock Watson Example
Ordinarily, the ones that vary are distinguished by being FRML's rather than fixed matrices. In this case, because the formulas are complicated (because of the dependence upon the number of variables), it's determined by which matrices are adjusted as part of the %%DLMSETUP function:timduy wrote:One last question on this code - how does RATS know which parameters of the matrices are fixed and which are free? In other words, the phi's are initially set at 0 but change, whereas fixed components set at zero or one remain fixed. I am just not sure what is the different in the DECLARE functions that distinguishes the fixed from free parameters.
Code: Select all
function %%DLMSetup
compute %psubmat(a,1,1,tr(phi))
do i=1,4
compute %psubmat(a,2*i+1,2*i+1,tr(d(i)))
end do i
compute %psubmat(c,1,1,tr(gamma))
compute sw=%diag(sigmac~~sigma)
end %%DLMSetup
Re: Stock Watson Example
No. Their T matrix is the same as ours (other than the added rows/columns in theirs to handle the integration of the deltaC).timduy wrote:Now I see that - it is kind of buried in the paper.
Also, do you happen to know if you glue the transition equation together different from the paper? It looks like the error process in the paper are made independent of each other and the common growth rate by assuming the D(L) lag polynomial is a diagonal matrix, but in the program it looks like the same assumption is achieved by a different ordering of the variables. This appears to make it easier to set up the a matrix with:
compute %psubmat(1,2*i+1,2*i+1,t(d(i)))
Thanks!
Re: Stock Watson Example
OK - so now I am bit confused. The transition equation is:
we ignore the last low and column of the transition matrix. Definitions of PHI* and D*:
k=2,p=2,n=4
The Di's are each a 4x4 diagonal matrix:
Note that D1 sits on top of a 4x4 identity matrix. So if I expand this out I get the 10x10 matrix:
which makes sense given the vectors C*t and U*t, which looks like [Ct Ct-1 U1t U2t U3t U4t U1t-1 U2t-1 U3t-1 U4t-1]. The transition matrix from example 6.1 is:
I am just not seeing that identity matrix or the diagonals matrices. But if I look at this example:
starts to make sense if I reorder the C*t and U*t vector as [Ct Ct-1 U1t U1t-1 U2t U2t-1 U3t U3t-1 U4t U4t-1]. I think other matrices are re-ordered accordingly.
So any idea of what where I am getting lost?
we ignore the last low and column of the transition matrix. Definitions of PHI* and D*:
k=2,p=2,n=4
The Di's are each a 4x4 diagonal matrix:
Note that D1 sits on top of a 4x4 identity matrix. So if I expand this out I get the 10x10 matrix:
which makes sense given the vectors C*t and U*t, which looks like [Ct Ct-1 U1t U2t U3t U4t U1t-1 U2t-1 U3t-1 U4t-1]. The transition matrix from example 6.1 is:
I am just not seeing that identity matrix or the diagonals matrices. But if I look at this example:
starts to make sense if I reorder the C*t and U*t vector as [Ct Ct-1 U1t U1t-1 U2t U2t-1 U3t U3t-1 U4t U4t-1]. I think other matrices are re-ordered accordingly.
So any idea of what where I am getting lost?
Re: Stock Watson Example
Sorry. You're correct. They blocked the D's differently. RATS does a block diagonal with separate 2x2 matrices for each of the U components, so they're blocked by component. S&W blocks by lag. While the two are equivalent, the former is, I think, much easier. For instance, it's quite a bit simpler to vary the lag length of the components. In the S&W setup you would probably need to extend all polynomials out to the maximum lag (with zeros if necessary), or you would lose the structure.
Re: Stock Watson Example
Thank you - yes, your blocking makes the programming easier. Just making sure I can connect the example to the paper.
Re: Stock Watson Example
I think you'll have better luck than I have trying to connect the Gauss code to the paper. It looks like what's posted is from a somewhat different approach.