How to perform regression with random walk coefficients
Moderators: EViews Gareth, EViews Moderator
How to perform regression with random walk coefficients
Hello,
I am trying to find if kalman filter can be used for calculating parameters for combined forecasts.
For example if we have f1,f2 forecasts based on Granger and Ramanathan (1984)
we can calculate a forecast combination of the form of a regression. fc= a0 + a1*f1 + a2*f2+ u. So we are trying to find the parameters of a regression like Y=A0+A1*f1+A2*f2.
Based on Kalman theory I want to calculate the time-varying coefficients with random walk procedure: A(t+1)=A(t) + n(t)
How can I do this through eviews? I know that eviews has kalman filtering but I cannot understand how to apply my data on the following equations, which will be eur/usd returns.
Let's say that we have the Yt= btXt+et
bt=bt-1+nt
1)the H,Q matrixes how are they initialized?
2) What are the Ft,Pt,Vt matrixes?
Thank you in advance!
I am trying to find if kalman filter can be used for calculating parameters for combined forecasts.
For example if we have f1,f2 forecasts based on Granger and Ramanathan (1984)
we can calculate a forecast combination of the form of a regression. fc= a0 + a1*f1 + a2*f2+ u. So we are trying to find the parameters of a regression like Y=A0+A1*f1+A2*f2.
Based on Kalman theory I want to calculate the time-varying coefficients with random walk procedure: A(t+1)=A(t) + n(t)
How can I do this through eviews? I know that eviews has kalman filtering but I cannot understand how to apply my data on the following equations, which will be eur/usd returns.
Let's say that we have the Yt= btXt+et
bt=bt-1+nt
1)the H,Q matrixes how are they initialized?
2) What are the Ft,Pt,Vt matrixes?
Thank you in advance!
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: How to perform regression with random walk coefficients
Have you looked at the EViews chapter on state space models? There's a discussion of exactly the random walk model that you propose, along with a description of how to use the auto-specify tools to build your state space specification.
Re: How to perform regression with random walk coefficients
Yes I looked up but I am still confused.
Any ideas what I could look for more??
Any ideas what I could look for more??
Re: How to perform regression with random walk coefficients
Where do you mean?Have you looked at the EViews chapter on state space models? There's a discussion of exactly the random walk model that you propose, along with a description of how to use the auto-specify tools to build your state space specification.
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: How to perform regression with random walk coefficients
User's Guide II, Chapter 33, State Space Models and the Kalman Filter
esp. p. 500-501.
I looks to me as though you could use the auto-specification tools, entering Y as your dependent variable, C as a recusrive coefficient, and F1 and F2 as variables with random walk coefficients in the stochastic regressors tab.
The example of Recursive and Random coefficients on p. 496 has an example with both a random walk and a pure recursive coefficient.
esp. p. 500-501.
I looks to me as though you could use the auto-specification tools, entering Y as your dependent variable, C as a recusrive coefficient, and F1 and F2 as variables with random walk coefficients in the stochastic regressors tab.
The example of Recursive and Random coefficients on p. 496 has an example with both a random walk and a pure recursive coefficient.
Re: How to perform regression with random walk coefficients
Hi
Can you explain how I can use autospec to get this model? I've tried various way and can't reproduce it. I didn't find the guide much help with this.
Can you explain how I can use autospec to get this model? I've tried various way and can't reproduce it. I didn't find the guide much help with this.
Code: Select all
@SIGNAL LGAP = SV1 + [VAR=EXP(C(1))]
@STATE SV1 = SV1(-1) + SV2(-1)
@STATE SV2 = SV2(-1) + [VAR=EXP(C(3))]
Re: How to perform regression with random walk coefficients
This tool is useful only if your model is a standard regression. Your specification, however, is an example of stochastic smooth trend model.
Re: How to perform regression with random walk coefficients
Yeah, I knew that. I wanted to reproduce in EViews the results that I got in RATS and STAMP. But I was trying to see if the autospec could reproduce it. I assume that it can't from your comment (and Gareth's about the need to edit the spec).This tool is useful only if your model is a standard regression. Your specification, however, is an example of stochastic smooth trend model.
Re: How to perform regression with random walk coefficients
User's Guide II, Chapter 33, State Space Models and the Kalman Filter
esp. p. 500-501.
I looks to me as though you could use the auto-specification tools, entering Y as your dependent variable, C as a recusrive coefficient, and F1 and F2 as variables with random walk coefficients in the stochastic regressors tab.
The example of Recursive and Random coefficients on p. 496 has an example with both a random walk and a pure recursive coefficient.
thank you for the guide now I am having some progress.
now I am having some problems to auto specify the data of the following file.
the regression has to be of the form
lrcons = sv(0) + sv1*lrgdp + sv2*lrprice + resid(????)
the betas of my regression I want to be recursive lige bt=bt-1 + et
1) I go to the autospecification tool and I put in the dependant variables: lrcons
2) regressors with fixed coefficients I assume I leave it blank
3) regressos with recursice coefficients: lrgpd lrprice
4) AR and MA (?????)
Coefficient base name c
In the next tab I assume I have to leave all blanks except the space that says random walk coefficients : should i write c(1)= c(-1) + resid (???)
Thanx a lot in advance!!
- Attachments
-
- kalman housing eviews.WF1
- (12.01 KiB) Downloaded 547 times
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: How to perform regression with random walk coefficients
I'm confused, do you want a random walk coefficient model or something more complicated like the trend model you posted earlier? If the former (answering the last response).
Basic Regression Tab
------------------------
Dependent variable: LRCONS
No fixed
No recursive
Stochastic Regressors Tab
------------------------------
Random walk coefficients: C LRGDP LRPRICE
Note that this assumes you want the SV1, SV2, SV3 to evolve as
SV1(t) = SV1(t-1) + E1_t
etc.
Variance Specification Tab
------------------------------
Diagonal is fine for the signal variance and the state variance (assuming you don't want to restrict the variances in the state equations).
---
But from your response to trubador, this may not be what you want!! As trubador noted, the auto-spec is only an aid to help people set up the simplest types of specifications.
Basic Regression Tab
------------------------
Dependent variable: LRCONS
No fixed
No recursive
Stochastic Regressors Tab
------------------------------
Random walk coefficients: C LRGDP LRPRICE
Note that this assumes you want the SV1, SV2, SV3 to evolve as
SV1(t) = SV1(t-1) + E1_t
etc.
Variance Specification Tab
------------------------------
Diagonal is fine for the signal variance and the state variance (assuming you don't want to restrict the variances in the state equations).
---
But from your response to trubador, this may not be what you want!! As trubador noted, the auto-spec is only an aid to help people set up the simplest types of specifications.
Re: How to perform regression with random walk coefficients
Thanks for the reply,
U are confused i think! Trubadors reply was, i think for another person.
The way you said it worked for me perfectly. I think this is a random walk. But many that implement Kalman Filtering (as I found in many papers) they use random walk procedure as a simple Kalman filter! Am i right? Should Kalman filter use recursive coefficients?
In any way I am interested in recursive ways to do the same.
Then do I have to put : c lrgdp lrprice into the 'recursive coefficients' area and leave the stohastic regressors blank? Probably not right?
Thank you in advance
U are confused i think! Trubadors reply was, i think for another person.
The way you said it worked for me perfectly. I think this is a random walk. But many that implement Kalman Filtering (as I found in many papers) they use random walk procedure as a simple Kalman filter! Am i right? Should Kalman filter use recursive coefficients?
In any way I am interested in recursive ways to do the same.
Then do I have to put : c lrgdp lrprice into the 'recursive coefficients' area and leave the stohastic regressors blank? Probably not right?
Thank you in advance
Re: How to perform regression with random walk coefficients
User's Guide II, Chapter 33, State Space Models and the Kalman Filter
esp. p. 500-501.
I looks to me as though you could use the auto-specification tools, entering Y as your dependent variable, C as a recusrive coefficient, and F1 and F2 as variables with random walk coefficients in the stochastic regressors tab.
The example of Recursive and Random coefficients on p. 496 has an example with both a random walk and a pure recursive coefficient.
For example I run it like you said earlier
Dependant lrcons
Recursive coefficient c
stohastic tab
lrgdo lrprice
And my estimation worked, but i am not really sure about the difference between them??!!
What is closer to a Kalman Filter?
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: How to perform regression with random walk coefficients
Ah, two people posting in the same thread...nice...
When you put variables in the recursive their coefficients are states that don't have an error term. If all of your variables are here, you are doing the equivalent of recursive least squares where the filtered states are the least squares coefficient estimates using information through the period in question.
When you put variables in the stochastic, their coefficients are states that do have an error term. For the latter, you then have a question of how the state evolves. You appear to want them to evolve as random walks, but ARs and RWs with trends are also possible from the auto-spec.
When you put variables in the recursive their coefficients are states that don't have an error term. If all of your variables are here, you are doing the equivalent of recursive least squares where the filtered states are the least squares coefficient estimates using information through the period in question.
When you put variables in the stochastic, their coefficients are states that do have an error term. For the latter, you then have a question of how the state evolves. You appear to want them to evolve as random walks, but ARs and RWs with trends are also possible from the auto-spec.
Re: How to perform regression with random walk coefficients
Thank you for the response!
Re: How to perform regression with random walk coefficients
Using the file that i said earlier, the random walk process with the state auto-specification process works fine, but it does not give me a forecast? Any ideas why?
Who is online
Users browsing this forum: No registered users and 1 guest
