9.5 DLM with seasonal effect
Let’s add a simple fixed quarter effect to the regression model:
yt=αt+βtxt+γqtr+etγqtr={γ1if qtr=1γ2if qtr=2γ3if qtr=3γ4if qtr=4
We can write Equation (9.11) in matrix form. In our model for γ, we will set the variance to 0 so that the γ does not change with time.
yt=[1xt1][αβγqtr]t+et[αβγqtr]t=[αβγqtr]t−1+[wαwβ0]t⇓yt=Ztxt+vtxt=xt−1+wt
How do we select the right quarterly effect? Let’s separate out the quarterly effects and add them to x. We could then select the right γ using 0s and 1s in the Zt matrix. For example, if t is in quarter 1, our model would be
yt=[1xt1000][αtβtγ1γ2γ3γ4]
While if t is in quarter 2, the model is
yt=[1xt0100][αtβtγ1γ2γ3γ4]
This would work, but we would have to have a different Zt matrix and it might get cumbersome to keep track of the 0s and 1s. If we wanted the γ to evolve with time, we might need to do this. However, if the γ are fixed, i.e. the quarterly effect does not change over time, a less cumbersome approach is possible.
We could instead keep the Zt matrix the same, but reorder the γi within x. If t is in quarter 1,
yt=[1xt1000][αtβtγ1γ2γ3γ4] While if t is in quarter 2,
yt=[1xt1000][αtβtγ2γ3γ4γ1]
We can use a non-diagonal G to to shift the correct quarter effect within x.
G=[100000010000000100000010000001001000]
With this G, the γ rotate within x with each time step. If t is in quarter 1, then t+1 is in quarter 2, and we want γ2 to be in the 3rd row.
[αβγ2γ3γ4γ1]t+1=[100000010000000100000010000001001000][αβγ1γ2γ3γ4]t+[wαwβ0000]t
At t+2, we are in quarter 3 and γ3 will be in row 3.
[αβγ3γ4γ1γ2]t+2=[100000010000000100000010000001001000][αβγ2γ3γ4γ1]t+1+[wαwβ0000]t