Do I maybe have an error in the last line of my "period spesification?"
21-period-ahead forecast
%21pers=@otod(@dtoo(%start)+!i+!window-1)
%21pere=@otod(@dtoo(%start)+!i+!window+20)
or should I change how many steps the forecast should move at a time?
'move sample !step obs at a time
for !i=1 to !lenght-!window+1-!step step !step
!j=!j+1
Multi-step ahead forecast
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
Re: Multi-step ahead forecast
hello, Nicole.
I have exactly met the same problem. I have tried hard but can't figure out.
Would you please tell me how you solved it at last ?
Thank you very much.
ying
I have exactly met the same problem. I have tried hard but can't figure out.
Would you please tell me how you solved it at last ?
Thank you very much.
ying
-
- Posts: 2
- Joined: Tue Jun 13, 2017 11:07 am
Re: Multi-step ahead forecast
Hi guys,
I would like to model a regime switching with a rolling window of 1000 days, my problem is how to store the regime probabilities for each one of the iterations in the loop. I know that with
eq01.makergmprobs(type=smooth) rprob1 rprob2
I can store but only for the last iteration.
I'm adapting a code posted in this forum Multi-step ahead forecast by EViews Gareth on Jan 29, 2014.
'rolling Markov Switching regression
group y variable
' set window size
!window = 1000
' declare equation for estimation
equation eq01
' get size of workfile
!length = @obsrange
'calculate number of rolls
!nrolls = @floor(!length-!window)
'matrix to store coefficient estimates
matrix(5,!nrolls) coefmat
'matrix to store regime probabilities
matrix(1000,!nrolls) regime_probabilities
' loop
for !i = 1 to !nrolls
' dynamic sample
smpl @first+!i @first+!i+!window
equation eq01.switchreg(type=markov) y c
eq01.rgmprobs(type=smooth) 1 2
' estimate equation -
colplace(coefmat,eq01.@coefs,!j) 'store coefficients
eq01.makergmprobs(type=smooth) rprob1 rprob2
colplace(regime_probabilities,eq01@..... ????? ‘ how to store the regime probabilities rprob1 e rprob2????
'in this point, I would like to store rprob1 e rprob2 in matrix regime_probabilities for each loop
next
Thanks for any help,
Walmir
I would like to model a regime switching with a rolling window of 1000 days, my problem is how to store the regime probabilities for each one of the iterations in the loop. I know that with
eq01.makergmprobs(type=smooth) rprob1 rprob2
I can store but only for the last iteration.
I'm adapting a code posted in this forum Multi-step ahead forecast by EViews Gareth on Jan 29, 2014.
'rolling Markov Switching regression
group y variable
' set window size
!window = 1000
' declare equation for estimation
equation eq01
' get size of workfile
!length = @obsrange
'calculate number of rolls
!nrolls = @floor(!length-!window)
'matrix to store coefficient estimates
matrix(5,!nrolls) coefmat
'matrix to store regime probabilities
matrix(1000,!nrolls) regime_probabilities
' loop
for !i = 1 to !nrolls
' dynamic sample
smpl @first+!i @first+!i+!window
equation eq01.switchreg(type=markov) y c
eq01.rgmprobs(type=smooth) 1 2
' estimate equation -
colplace(coefmat,eq01.@coefs,!j) 'store coefficients
eq01.makergmprobs(type=smooth) rprob1 rprob2
colplace(regime_probabilities,eq01@..... ????? ‘ how to store the regime probabilities rprob1 e rprob2????
'in this point, I would like to store rprob1 e rprob2 in matrix regime_probabilities for each loop
next
Thanks for any help,
Walmir
Who is online
Users browsing this forum: No registered users and 44 guests