Kalman Filter estimation

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

Aqua
Posts: 14
Joined: Mon Aug 02, 2010 7:17 am

Re: Kalman Filter estimation

Postby Aqua » Thu Aug 05, 2010 8:36 am

I used to specify the variances. When i don't, I have the same error than you.
Put it just before the specification of your state space, like this

c(1)=your value,
c(2)= your value,
.
.
.
Here, define your state space.

king_luca
Posts: 22
Joined: Thu Aug 05, 2010 2:28 am

Re: Kalman Filter estimation

Postby king_luca » Thu Aug 05, 2010 8:45 am

I'm sorry but I still get an error message saying that "coefficients not allowed for signal dependent variable in equation "c(1) = 0.2".

Here is my code to be clear :

c(1) = 0.2
c(2) = 0.2
c(3) = 0.2
c(4) = 0.2
c(5) = 0.2
c(6) = 0.2
c(7) = 0.2
c(8) = 0.2


@signal CONV__ARB_ = sv1*BONDS + sv2*CMDTY + sv3*CREDIT + sv4*EMM_B + sv5*EMM_E + sv6*S_P + sv7*USD + [var = exp(c(1))]

@state sv1 = sv1(-1) + [var = exp(c(2))]
@state sv2 = sv2(-1) + [var = exp(c(3))]
@state sv3 = sv3(-1) + [var = exp(c(4))]
@state sv4 = sv4(-1) + [var = exp(c(5))]
@state sv5 = sv5(-1) + [var = exp(c(6))]
@state sv6 = sv6(-1) + [var = exp(c(7))]
@state sv7 = sv7(-1) + [var = exp(c(8))]

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13584
Joined: Tue Sep 16, 2008 5:38 pm

Re: Kalman Filter estimation

Postby EViews Gareth » Thu Aug 05, 2010 8:59 am

You can't include the c= parts inside the state space specification. Do that outside of the statespace prior to estimation.

i.e. in the command window (the white bit at the top of EViews), type:

Code: Select all

c=0.2
Then open up your State space object and hit Estimate.

king_luca
Posts: 22
Joined: Thu Aug 05, 2010 2:28 am

Re: Kalman Filter estimation

Postby king_luca » Thu Aug 05, 2010 9:07 am

I'm really sorry but it doesn't work...

1) I type c=0.2 in the command window and hit "enter" to compute it
2) I specify my Sspace using "auto-specification", with a diagonal matrix for signal variance and state variance --> gives me the same code as before
3) I hit "estimate" and I get : "Missing valu found in signal transition matrix"

startz
Non-normality and collinearity are NOT problems!
Posts: 3796
Joined: Wed Sep 17, 2008 2:25 pm

Re: Kalman Filter estimation

Postby startz » Thu Aug 05, 2010 10:51 am

Thank you.

But do I need to specify that I want to estimate c(1),...,c(8) ? If yes, could you tell me where ?

Thank you again
No, EViews understands that. Something else mysterious is going on.
You might post your workfile, including the system object that you're trying to estimate.

king_luca
Posts: 22
Joined: Thu Aug 05, 2010 2:28 am

Re: Kalman Filter estimation

Postby king_luca » Thu Aug 05, 2010 11:09 am

Thank you... IHere is my workfile with the code :

@signal CON_AR = sv1*BONDS + sv2*CMDTY + sv3*CREDITS + sv4*EMMB + sv5*EMME + sv6*SP + sv7*USD + [var = exp(c(1))]

@state sv1 = sv1(-1) + [var = exp(c(2))]
@state sv2 = sv2(-1) + [var = exp(c(3))]
@state sv3 = sv3(-1) + [var = exp(c(4))]
@state sv4 = sv4(-1) + [var = exp(c(5))]
@state sv5 = sv5(-1) + [var = exp(c(6))]
@state sv6 = sv6(-1) + [var = exp(c(7))]
@state sv7 = sv7(-1) + [var = exp(c(8))]

My goal would be to get the 7 coefficients (sv1,...,sv7) for each of my observations and an estimation of the unknown paramters c(1),...,c(8).

If you can help me it would be great! Thank you
Attachments
kf.wf1
(26 KiB) Downloaded 733 times

startz
Non-normality and collinearity are NOT problems!
Posts: 3796
Joined: Wed Sep 17, 2008 2:25 pm

Re: Kalman Filter estimation

Postby startz » Thu Aug 05, 2010 11:56 am

Are you running on the most recent update of EViews? On my system the estimate works fine, except that you end up with a singular variance. My guess is that is a data issue. If you run

Code: Select all

ls CON_AR BONDS CMDTY CREDITS EMMB EMME SP USD
you'll see that SP and USD don't much matter.

king_luca
Posts: 22
Joined: Thu Aug 05, 2010 2:28 am

Re: Kalman Filter estimation

Postby king_luca » Thu Aug 05, 2010 12:35 pm

no it's not the most recent update... I'll update it and try again.

I'm sorry, I'm really new in Eviews but is "ls" a least square regression ?

It might be a data issue but I have to use these data anyway...

Thank you for your precious help.

I hope it'll work...

startz
Non-normality and collinearity are NOT problems!
Posts: 3796
Joined: Wed Sep 17, 2008 2:25 pm

Re: Kalman Filter estimation

Postby startz » Thu Aug 05, 2010 12:51 pm

Yes, ls means least squares regression.

You might find the free chapters at http://www.eviews.com/illustrated/illustrated.htmlhelpful in jumpstarting your EViews trip.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Kalman Filter estimation

Postby EViews Glenn » Wed Aug 11, 2010 10:56 am

The C(1) etc are the parameters in the variances. If you look at your equations you'll see where they enter.

And not to ask a silly question, but you do realize that you are estimating with random walk coefficients using CON_AR data that appear to be stationary?

startz
Non-normality and collinearity are NOT problems!
Posts: 3796
Joined: Wed Sep 17, 2008 2:25 pm

Re: Kalman Filter estimation

Postby startz » Wed Aug 11, 2010 11:00 am

Glenn,

Not having thought about this carefully, is there anything wrong with using a random walk for time-varying coefficients of a stationary model? I thought this was pretty standard.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 1 guest