Forecast Performance using Loop
Posted: Fri Sep 19, 2014 1:27 am
Dear;
I wanted to compare the 1-step ahead mean square prediction errors for an AR(1) and an AR(2) model of Automobile. For this I have written the following:
set f_ar1 = 0.
set f_ar2 = 0.
do i = 100,168
lin(noprint,define=ar1) Automobile 3 i; # constant Automobile {1}
forecast 1 1
# ar1 f_ar1
lin(noprint,define=ar2) Automobile 3 i; # constant Automobile {1 to 2}
forecast 1 1
# ar2 f_ar2
end do i
Then for the calculation of squared prediction errors from the AR(1) and the AR(2), to calculate and display the mean square prediction error for the AR(1) and lines and to calculate and display the mean square prediction error for the AR(2), I have written in RATS the following.
set pe_1 101 169 = (Automobile - f_ar1)**2
set pe_2 101 169 = (Automobile - f_ar2)**2
sta(noprint) pe_1
dis ‘The MSPE from the AR(1) is: ‘ %mean
sta(noprint) pe_2
dis ‘The MSPE from the AR(2) is: ‘ %mean
The upper half of the program ran successfully and even up to the command "sta(noprint) pe_1" its ok. But I am not able to ran the following two commands:
dis ‘The MSPE from the AR(1) is: ‘ %mean
sta(noprint) pe_2
dis ‘The MSPE from the AR(2) is: ‘ %mean
When I press Enter for the command "dis ‘The MSPE from the AR(1) is: ‘ %mean" I got the following message:
## SX19. This Character is Illegal Here
>>>>dis ‘<<<<
The reason I identify is that in my RATS I am not able to write the symbol "(‘)". This symbol I can pasted from manual in Notepad, MS Word and even in this window of software forum. In RATS it is pasted in some different way 70% like the word (a). Even when I copy the (‘) from notepad to RATS it becomes different symbol and if again I copied from RATS to notepad then it will be fine and looks like (‘).
Kindly Help me out how I am able to write this command/symbol.
Further,i also want to compare the 1-step ahead mean square prediction errors for an AR(3) and ARMA(2,3) and ARMA(0,4). Then for adding the MA term in above program what will be the procedure.
A thousands thanks
Waiting your hopeful response.
I wanted to compare the 1-step ahead mean square prediction errors for an AR(1) and an AR(2) model of Automobile. For this I have written the following:
set f_ar1 = 0.
set f_ar2 = 0.
do i = 100,168
lin(noprint,define=ar1) Automobile 3 i; # constant Automobile {1}
forecast 1 1
# ar1 f_ar1
lin(noprint,define=ar2) Automobile 3 i; # constant Automobile {1 to 2}
forecast 1 1
# ar2 f_ar2
end do i
Then for the calculation of squared prediction errors from the AR(1) and the AR(2), to calculate and display the mean square prediction error for the AR(1) and lines and to calculate and display the mean square prediction error for the AR(2), I have written in RATS the following.
set pe_1 101 169 = (Automobile - f_ar1)**2
set pe_2 101 169 = (Automobile - f_ar2)**2
sta(noprint) pe_1
dis ‘The MSPE from the AR(1) is: ‘ %mean
sta(noprint) pe_2
dis ‘The MSPE from the AR(2) is: ‘ %mean
The upper half of the program ran successfully and even up to the command "sta(noprint) pe_1" its ok. But I am not able to ran the following two commands:
dis ‘The MSPE from the AR(1) is: ‘ %mean
sta(noprint) pe_2
dis ‘The MSPE from the AR(2) is: ‘ %mean
When I press Enter for the command "dis ‘The MSPE from the AR(1) is: ‘ %mean" I got the following message:
## SX19. This Character is Illegal Here
>>>>dis ‘<<<<
The reason I identify is that in my RATS I am not able to write the symbol "(‘)". This symbol I can pasted from manual in Notepad, MS Word and even in this window of software forum. In RATS it is pasted in some different way 70% like the word (a). Even when I copy the (‘) from notepad to RATS it becomes different symbol and if again I copied from RATS to notepad then it will be fine and looks like (‘).
Kindly Help me out how I am able to write this command/symbol.
Further,i also want to compare the 1-step ahead mean square prediction errors for an AR(3) and ARMA(2,3) and ARMA(0,4). Then for adding the MA term in above program what will be the procedure.
A thousands thanks
Waiting your hopeful response.