Page 1 of 2
Time varying model with kalman filter
Posted: Thu May 21, 2009 6:15 am
by Aktar
Hi
i want to buil a state space model with time varying coefficient ( return to normailty model so AR (1) process in the box of stochastic regressors ?)
I specify for exemple
Code: Select all
@signal r = sv1*er + [var = exp(c(1))]
@state sv1 = c(3) + c(4)*sv1(-1) + [var = exp(c(2))]
when i proceed to the estimation i have std error = 0 z-statistics = NA and prob = 0
WHY ? it is a probleme of variance or covariance matrix ? someone have a response ?
To conclude How i can specify initial condition and make the kalman filter ?
im student and eviews is new for me. Thanks for your help
Re: Time varying model with kalman filter
Posted: Thu May 21, 2009 6:28 am
by EViews Glenn
Sounds like you have a problem with singularity. Are there any messages about singularity in the output? What starting values did you use? What does the gradients view look like (View/Gradients)?
Re: Time varying model with kalman filter
Posted: Thu May 21, 2009 6:37 am
by Aktar
i don't know how i can specify initial value
but i want take Beta 0/0 = Beta (mean vector of Bt coefficient) and var-cov matrix 0/0 = Identity matrix
for gradient, i don't know how i can interpretate it... it's like that
Coefficient Sum Mean Newton Dir.
C(1) 1.63E+263 1.61E+261 0.000000
C(2) 0.000000 0.000000 0.000000
C(3) -2.5E+272 -2.5E+270 0.000000
C(4) 1.87E+268 1.85E+266 0.000000
Re: Time varying model with kalman filter
Posted: Thu May 21, 2009 8:02 am
by Aktar
yes i have this message " WARNING: Singular covariance - coefficients are not unique"
Coefficient Std. Error z-Statistic Prob.
C(1) 0.000000 NA NA NA
C(2) 0.000000 NA NA NA
C(3) 0.000000 NA NA NA
C(4) 0.000000 NA NA NA
C(5) 0.000000 NA NA NA
C(6) 0.000000 NA NA NA
C(7) 0.000000 NA NA NA
Can you explain what is the problem ?
Re: Time varying model with kalman filter
Posted: Thu May 21, 2009 9:26 am
by EViews Glenn
Your starting values are so bad that we can't find a valid step to start the estimation procedure. You are starting with all of your C values equal to zero, which is equivalent to settin gthe variances to 1 and the remaining coefficients to zero.
You can fiddle with the starting values by putting various things in the C vector prior to estimation.
Re: Time varying model with kalman filter
Posted: Thu May 21, 2009 10:15 am
by Aktar
ok thanks ...
What are the C values and how i can modify the C vector ? it is in the autospec, variance specification ?
in manual how i can specify myself ?
and can you explain me how i must interpretate gradients
thanks a lot
Re: Time varying model with kalman filter
Posted: Thu May 21, 2009 12:19 pm
by EViews Gareth
The C vector is an object in your workfile. Its the little icon with a beta symbol in it, called "C". You can double click on it to open it up and modify.
Re: Time varying model with kalman filter
Posted: Fri May 22, 2009 8:27 am
by Aktar
OK thanks
In c vector we can specify starting values. But instead of specify directly starting values i can enter command for define initial conditions ?
normally i define my initial condition and i take the starting value for make the kalman filter ?
I want specify for example a initial state vector with the the mean Beta and an identity matrix for the variance
so i enter :
Code: Select all
@signal illiq = sv1*libor + sv2*abcp + [var = exp(c(1))]
@state sv1 = c(3) + c(4)*sv1(-1) + [var = exp(c(2))]
@state sv2 = c(6) + c(7)*sv2(-1) + [var = exp(c(5))]
vector(2) svec0
svec0.fill 0, 0
matrix (2,2) svar0
svar0.fill(b=c) 1, 0, 0, 1
@mprior svec0
@vprior svar0
However i have a problem of syntax... i have the message
and if i try with another methods like create vector and matrix with objects/new objects/matrix-vecor-coef i have also a problem because a message tells me that my matrix is not a sym object... even if i declare for example
like that :
Code: Select all
sym matrix01
@mprior svec0
@vprior svar0
with my matrix and my vecto that have created in my workfile
THANKS A LOT

Re: Time varying model with kalman filter
Posted: Fri May 22, 2009 9:01 am
by EViews Glenn
There are two sets of "starting values" here. The first are the coefficient starting values for the variance estimation. Those are the ones that you will set using the C vector.
The second are the in
itial conditions for the state vector and state covariance. As the error messages indicate, you need to provide a sym matrix object to your @vprior. The errors you are getting are because you have not done so.
First make certain that you delete your existing MATRIX01 since you have already created it as a matrix object instead of a sym. Then create the sym using
Note that construction of this matrix should
not be part of the sspace specification, but rather should be done in EViews itself.
Lastly, use the
inside your state space specification.
Re: Time varying model with kalman filter
Posted: Fri May 22, 2009 9:08 am
by Aktar
ok thank you very much
but how and where i can specify
i must create an object or what ?
thank you
Re: Time varying model with kalman filter
Posted: Fri May 22, 2009 11:39 am
by EViews Glenn
Object/New Object
or even easier, just type the line in the command window.
Re: Time varying model with kalman filter
Posted: Fri May 22, 2009 1:56 pm
by Aktar
Ok thank you it work
When i specify my initial condition like
state vector
(0)
(0)
and state variance
(1 0)
(0 1)
i find this estimation :
Coefficient Std. Error z-Statistic Prob.
C(1) -8.172025 NA NA NA
C(2) -31.57847 NA NA NA
C(3) 0.201469 NA NA NA
C(4) -0.261210 NA NA NA
C(5) -81.02884 NA NA NA
C(6) -0.231684 NA NA NA
C(7) -0.282587 NA NA NA
My starting value are too bad...and i have the message "WARNING: Singular covariance - coefficients are not unique"
So the probleme come from my initial condition ? or i just must change starting value ?
And when i have good starting value i can make the kalman filter ?
I don't very well understand what's is the starting values because when i proceed to the estimation i have in my C vector just the starting value and after, in the following boxes i have 0 everywhere. How i can know Which are the good starting values ?
and i don't understand why in my C vector i have just starting values and 0
I know that it is a lot of questions but it is for my thesis of master degree thank you very much if you can respond,
I am a little lost with eviews for this kind of model.
I have many other issues but i will see after.
thank you for availability of the member it's very useful
Re: Time varying model with kalman filter
Posted: Fri May 22, 2009 3:34 pm
by EViews Glenn
There's no general rule for setting the starting values, but as I said, your problems are in the C vector not in the initial conditions for the states...
At the moment, you are initializing your variances to whatever is in the C vector. That doesn't appear to be a very good set of starting values. Note in particular that your state innovation variances are very close to zero (exp(c(2)) and exp(c(5))
Re: Time varying model with kalman filter
Posted: Sat May 23, 2009 3:42 am
by Aktar
ok i choose starting value up to have significant coefficient... and after when i have the good starting value i can make kalman filter for have the estimation of sv1 and sv2 ?
In starting value, do you think that i just must change c(2) and c(5) or i must change all the coefficents ? eveni there is no rules for starting values what is the most appropriate globally ?
Re: Time varying model with kalman filter
Posted: Sat May 23, 2009 6:33 am
by Aktar
Coefficient Std. Error z-Statistic Prob.
C(1) -8.311964 0.129936 -63.96987 0.0000
C(2) -10.23589 1.348863 -7.588529 0.0000
C(3) 0.016756 0.004943 3.389727 0.0007
C(4) 0.911299 0.031677 28.76876 0.0000
C(5) -28.93186 1.61E+08 -1.79E-07 1.0000
C(6) -0.032780 0.006146 -5.333850 0.0000
C(7) 0.851091 0.017376 48.98100 0.0000
I find something like this but i don't know how i can have better results... but i don't arrive to have a significativ coefficient for the variance of the state vector... i don't understand difference between intial condition and starting values
thank you