Hi Guys,

Im very inexperienced with EViews and was wondering if you could help me with the following problem.

Im conducting a study of time varying autocorrleation in stock markets using 50 years of data from the S&P500.

I took the log first difference of the data, specified the following equation: y c y(-1) and used this to estimate the first order correlation of monthly returns using a rolling regression model.

I would now like to create a time varying AR model using a state space model to show how the AR coefficients vary through time, however I am unsure as how to go about this.

Any help would be greatly appreciated.

Thank you in advance.

## Time Varying AR Model

**Moderators:** EViews Gareth, EViews Moderator

### Re: Time Varying AR Model

You need to work with State Space object (Object\New Object\SSpace) and write a syntax like the following:

Do not forget to adjust the Sample (start from the second observation) in the Estimation window. Please refer to help files for more details...

Code: Select all

`@signal y = c(1) + ar1*y(-1) + [var=exp(c(2))]`

@state ar1 = ar1(-1) + [var=exp(c(3))]

Do not forget to adjust the Sample (start from the second observation) in the Estimation window. Please refer to help files for more details...

### Re: Time Varying AR Model

Thanks for your help. Being playing around with the syntax and definately made some progress, however I'm still to achieve the desired outcome. To be more specific I'm trying to use the same methodology adopted by Ito and Sugiyama ("Measuring the degree of time varying market inefficiency", 2009) who specify the following equation for their state space model:

Thanks again.

Thanks again.

### Re: Time Varying AR Model

Hey guys,

Sorry to bump this, but does anyone have any recommendations? I would be eternally greatful. Really struggling to come up with the correct syntax by myself.

Thx

Sorry to bump this, but does anyone have any recommendations? I would be eternally greatful. Really struggling to come up with the correct syntax by myself.

Thx

### Re: Time Varying AR Model

You can extend the model as you want. As an example for three lags:

btw. you can drop the constant term in the signal equation if you like...

Code: Select all

`@signal y = c(1) + ar1*y(-1) + ar2*y(-2) + ar3*y(-3) + [var=exp(c(2))]`

@state ar1 = ar1(-1) + [var=exp(c(3))]

@state ar2 = ar2(-1) + [var=exp(c(4))]

@state ar3 = ar3(-1) + [var=exp(c(5))]

btw. you can drop the constant term in the signal equation if you like...

### Re: Time Varying AR Model

Thanks for your prompt reply trubador, i really appreciate your input. I'm now just trying to replicate the results obtained by Ito and Sugiyama (2009) just to make sure the procedure is correct when I apply it to my own sample. I've obtained the same graphical representation as in figure 1 of their study. However, after specifying the state space model which steps should I then take to obtain a kalman smoothed graph like the one in figure 2?

### Re: Time Varying AR Model

Just click on

**View/State Views/Graph State Series...**and select**Smoothed State Estimates**. In order to save these smoothed series, you have to select**Proc**in the sspace toolbar and then click on**Make State Series...**Please refer to users guide for more details.### Who is online

Users browsing this forum: No registered users and 8 guests