Stability tests with kalman filter
Stability tests with kalman filter
Hi
i have make my kalman filter estimate with eviews, and i want make cusum and chow test. How i can perfom these without make estimate with rats ?
And if i want make test over residuals which programms i must take ?
thank you
i have make my kalman filter estimate with eviews, and i want make cusum and chow test. How i can perfom these without make estimate with rats ?
And if i want make test over residuals which programms i must take ?
thank you
Re: Stability tests with kalman filter
Once you have the recursive residuals, you can do the CUSUM and Chow tests using anything that can do squares and sums. If you don't have the recursive residuals, you can't get them without redoing the model in RATS. So I'm rather puzzled about why you want to do this by moving the easy part to a different program.
Re: Stability tests with kalman filter
I don't know if i can have recursive residuals but i think have find
im not sure between all these choice :
smoothed state disturbance estimates
the standardized smoothed state disturbances
i have ask in the forums of eviews but don't have a response
and after which programms i must run ?
thank you very much
im not sure between all these choice :
smoothed state disturbance estimates
the standardized smoothed state disturbances
i have ask in the forums of eviews but don't have a response
and after which programms i must run ?
thank you very much
Re: Stability tests with kalman filter
The recursive residuals are the "one-step ahead standardized residuals."
Re: Stability tests with kalman filter
ok thanks so it is std. residual of signal series ?
after i take the prog constant.prg ?
thank you very much
after i take the prog constant.prg ?
thank you very much
Re: Stability tests with kalman filter
You can't use CONSTANT.PRG directly, since it uses RLS, which generates some additional statistics (like the CUSUM). You also can't use the "STABTEST" procedure, since that is specific to an OLS regression.
If you're just starting with the recursive residuals (recresids below, defined over rstart to rend), the CUSUM test would be:
You can generate the CUSUMSQ with this:
That can be used to form various stability tests like Chow-predictive tests. For instance, a test for the last eight periods can be done with
If you're just starting with the recursive residuals (recresids below, defined over rstart to rend), the CUSUM test would be:
Code: Select all
compute %ndf=(rend-rstart+1)
acc recresids rstart rend cusum
set upper5 rstart rend = .948*sqrt(%ndf)*(1+2.0*(t-rstart+1)/%ndf)
set lower5 rstart rend = -upper5
graph(header="CUSUM test") 3
# cusum
# lower5 / 2
# upper5 / 2Code: Select all
set recresidsqr = recresids^2
acc recresidsqr rstart rend cusumsqCode: Select all
compute f=((cusumsq(rend)-cusumsq(rend-8))/8)/(cusumsq(rend-8)/(%ndf-8))
cdf(title="Post-Sample Predictive Test") ftest f 8 %ndf-8Re: Stability tests with kalman filter
thank you very much you are magic !
but i don't know how i must set rend and rstart. I have this
thank you
but i don't know how i must set rend and rstart. I have this
Code: Select all
calendar 2002 1 1
allocate 85
open data Classeur1.xls
data(for=xls, org=obs) / recresids
table
set rend =
set rsart =
compute %ndf=(rend-rstart+1)
acc recresids rstart rend cusum
set upper5 rstart rend = .948*sqrt(%ndf)*(1+2.0*(t-rstart+1)/%ndf)
set lower5 rstart rend = -upper5
graph(header="CUSUM test") 3
# cusum
# lower5 / 2
# upper5 / 2
Re: Stability tests with kalman filter
Assuming the residuals start right at the beginning of the file, rstart=1, rend=85
Re: Stability tests with kalman filter
RSTART and REND would need to be integers, not series, so you would use COMPUTE rather than SET to set them.
You want to set them equal to the desired starting and ending entry numbers or dates, as Tom Doan noted.
You want to set them equal to the desired starting and ending entry numbers or dates, as Tom Doan noted.
Re: Stability tests with kalman filter
than you very much it run !
a last question ;
I have the same thing when i compute cusum square test, it is something wrong in my prog ?
a last question ;
Code: Select all
calendar 2000 1 12
allocate 108
open data Classeur1.xls
data(for=xls, org=obs) / recresids
table
compute rstart=2000:1
compute rend=2008:12
compute %ndf=(rend-rstart+1)
acc recresids rstart rend cusum
set upper5 rstart rend = .948*sqrt(%ndf)*(1+2.0*(t-rstart+1)/%ndf)
set lower5 rstart rend = -upper5
graph(header="CUSUM test") 3
# cusum
# lower5 / 2
# upper5 / 2
**cusum square
set recresidsqr = recresids^2
acc recresidsqr rstart rend cusumsq
set upper5 rstart rend = .948*sqrt(%ndf)*(1+2.0*(t-rstart+1)/%ndf)
set lower5 rstart rend = -upper5
graph(header="CUSUMQ test") 3
# cusum
# lower5 / 2
# upper5 / 2
Re: Stability tests with kalman filter
The same thing as what? Please clarify.Aktar wrote:I have the same thing when i compute cusum square test
Re: Stability tests with kalman filter
sorry, i have the same graphic "cusum" when i compute the prog for cusum square and cusum
For cusum
and for cusum square :
For cusum
Code: Select all
calendar 2000 1 12
allocate 108
open data Classeur1.xls
data(for=xls, org=obs) / recresids
table
compute rstart=2000:1
compute rend=2008:12
compute %ndf=(rend-rstart+1)
acc recresids rstart rend cusum
set upper5 rstart rend = .948*sqrt(%ndf)*(1+2.0*(t-rstart+1)/%ndf)
set lower5 rstart rend = -upper5
graph(header="CUSUM test") 3
# cusum
# lower5 / 2
# upper5 / 2Code: Select all
calendar 2000 1 12
allocate 108
open data Classeur1.xls
data(for=xls, org=obs) / recresids
table
**cusum square
compute rstart=2002:2
compute rend=2008:12
compute %ndf=(rend-rstart+1)
set recresidsqr = recresids^2
acc recresidsqr rstart rend cusumsq
set upper5 rstart rend = .948*sqrt(%ndf)*(1+2.0*(t-rstart+1)/%ndf)
set lower5 rstart rend = -upper5
graph(header="CUSUMQ test") 3
# cusum
# lower5 / 2
# upper5 / 2Re: Stability tests with kalman filter
It appears from the GRAPH instruction above that you are graphing the series CUSUM, when you meant to graph the series CUSUMSQ.Aktar wrote:sorry, i have the same graphic "cusum" when i compute the prog for cusum square and cusum
...
Code: Select all
graph(header="CUSUMQ test") 3 # cusum # lower5 / 2 # upper5 / 2
Re: Stability tests with kalman filter
ok thanks but it normal that the corridor is the same for the 2 tests ?
Re: Stability tests with kalman filter
No, they're quite different (rather obviously, since the sums of squares can't be negative). The CUSUMQ is based upon the maximum gap between a straight line and the cumulated sum of squares, standardized to end at 1.0:Aktar wrote:ok thanks but it normal that the corridor is the same for the 2 tests ?
Code: Select all
set recresidsqr = recresids^2
acc(standardize) recresidsqr rstart rend cusumsq
set target rstart rend = (t-rstart+1.0)/(rend-rstart+1.0)
graph 2
# cusumsq
# target