Help required with State Space model

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

VWalrave
Posts: 2
Joined: Fri Jun 27, 2014 5:00 am

Help required with State Space model

Postby VWalrave » Fri Jun 27, 2014 5:18 am

Hello,

I am currently writing a thesis about the financial performance of Alternative Energy Indices.
To estimate the financial performance i would like to use a state-space market model combined with the Kalman Filter optimization algorithm.

The model i am using is given by the following equations:
(1) Return of index i = alpha + beta * Return of benchmark + error 1
(2) beta (t) = beta (t-1) + error 2
(3) alpha (t) = alpha (t-1) + error 3

I am using the SSpace object method for the first time and i currently came up with:

"@ename e1
@ename e2
@ename e3

@evar var(e1) = exp(C(1))
@evar var(e2) = exp(C(2))
@evar var(e3) = exp(C(3))

@signal r_argae = sv2 + sv1*r_benchmark + e1
@state sv1 = sv1(-1) + e2
@state sv2 = sv2(-1) + e3"


So far, so good ( i think ). However, the problem i have is with the second part, because i have no clue how to put this in EViews.
The second part of the equations is shown in the uploaded attachment. The likelihood function estimates the unknown parameters of the system.

If anyone could give me any tips on how to solve this, it would be very much appreciated.
Kind regards,

Vincent
Attachments
Function 4,5,6 and 7.png
These are the functions i still need to put in the SSpace object
Function 4,5,6 and 7.png (9.68 KiB) Viewed 3984 times

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

Re: Help required with State Space model

Postby startz » Fri Jun 27, 2014 5:25 am

You don't need to put in the likelihood function. EViews already knows it. Just enter what you already have and push Estimate.

VWalrave
Posts: 2
Joined: Fri Jun 27, 2014 5:00 am

Re: Help required with State Space model

Postby VWalrave » Sat Jun 28, 2014 3:13 am

Thank you for your answer. However, i have stumbled upon another problem.
Yesterday evening everything was working fine and i got some good values for C1, C2 and C3.
When i opened the file again today, i decided to change the sample period by 1 year.
I thought this would be no problem, but i am now getting the message "WARNING: Singular Covariance - coefficients are not unique".
I get this message at every one of my sspace models. I already checked the forum and it says i need to state initial values for my coefficients, but even then it does not work.

I don't think it has anything to do with changing the sample period, but i cannot think of anything else that changed overnight.
Anyone might have an idea why this is happening? Yet again, help would me very much appreciated.

Kind regards,

Vincent

jmagomez
Posts: 68
Joined: Wed Aug 08, 2012 10:24 am

Re: Help required with State Space model

Postby jmagomez » Mon Jun 30, 2014 6:08 pm

Dear Vincent and startz,

I have a doubt: How do I do to use Kalman Filter at Eviews? I have a multi dinamic regression model as follows:

ly c lm ls

Could you tell me the steps? Signal and state equations also? Could we use Kalman Filter at VEC Models? Or only at simple models?

All my data is until May 2014 and I wanna forecast until December 2031. Is it possible?

Thanks a lot. And I can send the file.

Best Regards, José.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests