Random Walk+Trigonometric Seasonality in State Space Form

Discussion of State Space and Dynamic Stochastic General Equilibrium Models
Jennylai
Posts: 35
Joined: Sun Feb 08, 2009 8:40 pm

Random Walk+Trigonometric Seasonality in State Space Form

Unread post by Jennylai »

Dear Tom,

May I ask you question about putting a Random Walk + Trigonometric Seasonality in State Space Form?

The model is basically like this:

y(t) = y(t-1) + trigonometric seasonal component + epsilon(t) ---- (this is the measurement equation.)

y(t-1)=y(t-2)+trigonometric seasonal component + epsilon(t-1)

11 equations for trigonometric seasonal component (s=12) (these 11 equation plus the above equation are transition equations).

May I ask if this State space model could be estimated in RATS? Because I already know one component y(t-1) in the state vectors, and the error term in the first equation in the transition equations has the same variance as in the measurement equation.

Thank you very much for your kind help !
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Random Walk+Trigonometric Seasonality in State Space Form

Unread post by TomDoan »

It sounds as if you want to use @seasonaldlm with the option type=fourier to generate the seasonal component.

Code: Select all

@localdlm(type=level,a=at,c=ct,f=ft)
@seasonaldlm(type=fourier,a=as,c=cs,f=fs)
compute a=at~\as,c=ct~~cs,f=ft~\fs
Jennylai
Posts: 35
Joined: Sun Feb 08, 2009 8:40 pm

Re: Random Walk+Trigonometric Seasonality in State Space Form

Unread post by Jennylai »

Dear Tom,

Thank you for your reply. However, What I want is a little bit different from the original Ramdom walk component + Trigonometric seasonal component.

My model looks like this: y(t) = y(t-1) + trigonometric seasonal component + epsilon(t) (This is the measurement equation)
Here the Ramdom Walk component doesn't need to be estimated as it is y(t-1) and is observable.

This is a little different from the model you listed in your code, which is: y(t)=Mu(t) + trigonometric seasonal component, where mu(t) itself is modeled as a random walk and has to be estimated by the State Space Model.

So may I return to my original question: if I use the model I mentioned, how shall I estimate it use DLM, as one of the element in the state vector X is observable (y(t-1)).
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Random Walk+Trigonometric Seasonality in State Space Form

Unread post by TomDoan »

Just use y(t)-y(t-1) as your observable.
Jennylai
Posts: 35
Joined: Sun Feb 08, 2009 8:40 pm

Re: Random Walk+Trigonometric Seasonality in State Space Form

Unread post by Jennylai »

Dear Tom,

Thank you very much! You are a genius!!!
Post Reply