Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 24 Dec 2010 12:02:37 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/24/t1293192015kc84x101t23bxqs.htm/, Retrieved Tue, 30 Apr 2024 07:55:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114795, Retrieved Tue, 30 Apr 2024 07:55:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact114
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [paperFOR_werk] [2010-12-24 12:02:37] [13dfa60174f50d862e8699db2153bfc5] [Current]
Feedback Forum

Post a new message
Dataseries X:
6,7
6,7
6,5
6,3
6,3
6,3
6,5
6,6
6,5
6,3
6,3
6,5
7
7,1
7,3
7,3
7,4
7,4
7,3
7,4
7,5
7,7
7,7
7,7
7,7
7,7
7,8
8
8,1
8,1
8,2
8,2
8,2
8,1
8,1
8,2
8,3
8,3
8,4
8,5
8,5
8,4
8
7,9
8,1
8,5
8,8
8,8
8,6
8,3
8,3
8,3
8,4
8,4
8,5
8,6
8,6
8,6
8,6
8,6
8,5
8,4
8,4
8,4
8,5
8,5
8,6
8,6
8,4
8,2
8
8
8
8
7,9
7,9
7,8
7,8
8
7,8
7,4
7,2
7
7
7,2
7,2
7,2
7
6,9
6,8
6,8
6,8
6,9
7,2
7,2
7,2
7,1
7,2
7,3
7,5
7,6
7,7
7,7
7,7
7,8
8
8,1
8,1
8
8,1
8,2
8,3
8,4
8,4
8,4
8,5
8,5
8,6
8,6
8,5
8,5




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 2 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114795&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114795&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114795&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24







Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[109])
977.1-------
987.2-------
997.3-------
1007.5-------
1017.6-------
1027.7-------
1037.7-------
1047.7-------
1057.8-------
1068-------
1078.1-------
1088.1-------
1098-------
1108.17.91677.69138.14210.05550.234510.2345
1118.27.88147.47138.29150.06390.14810.99730.2854
1128.37.9017.33828.46380.08230.14890.91870.3651
1138.47.947.28868.59150.08320.13940.84690.4284
1148.47.96987.26928.67050.11440.11440.77480.4664
1158.47.97617.24388.70830.12820.12820.770.4745
1168.57.96477.20228.72720.08440.13160.75190.4639
1178.57.9497.15018.74790.08820.08820.64270.4502
1188.67.93987.09788.78170.06220.09610.44430.4443
1198.67.93987.05318.82650.07220.07220.36160.4471
1208.57.94557.01748.87350.12080.08340.37210.4542
1218.57.95136.98688.91580.13240.13240.46060.4606

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast \tabularnewline
time & Y[t] & F[t] & 95% LB & 95% UB & p-value(H0: Y[t] = F[t]) & P(F[t]>Y[t-1]) & P(F[t]>Y[t-s]) & P(F[t]>Y[109]) \tabularnewline
97 & 7.1 & - & - & - & - & - & - & - \tabularnewline
98 & 7.2 & - & - & - & - & - & - & - \tabularnewline
99 & 7.3 & - & - & - & - & - & - & - \tabularnewline
100 & 7.5 & - & - & - & - & - & - & - \tabularnewline
101 & 7.6 & - & - & - & - & - & - & - \tabularnewline
102 & 7.7 & - & - & - & - & - & - & - \tabularnewline
103 & 7.7 & - & - & - & - & - & - & - \tabularnewline
104 & 7.7 & - & - & - & - & - & - & - \tabularnewline
105 & 7.8 & - & - & - & - & - & - & - \tabularnewline
106 & 8 & - & - & - & - & - & - & - \tabularnewline
107 & 8.1 & - & - & - & - & - & - & - \tabularnewline
108 & 8.1 & - & - & - & - & - & - & - \tabularnewline
109 & 8 & - & - & - & - & - & - & - \tabularnewline
110 & 8.1 & 7.9167 & 7.6913 & 8.1421 & 0.0555 & 0.2345 & 1 & 0.2345 \tabularnewline
111 & 8.2 & 7.8814 & 7.4713 & 8.2915 & 0.0639 & 0.1481 & 0.9973 & 0.2854 \tabularnewline
112 & 8.3 & 7.901 & 7.3382 & 8.4638 & 0.0823 & 0.1489 & 0.9187 & 0.3651 \tabularnewline
113 & 8.4 & 7.94 & 7.2886 & 8.5915 & 0.0832 & 0.1394 & 0.8469 & 0.4284 \tabularnewline
114 & 8.4 & 7.9698 & 7.2692 & 8.6705 & 0.1144 & 0.1144 & 0.7748 & 0.4664 \tabularnewline
115 & 8.4 & 7.9761 & 7.2438 & 8.7083 & 0.1282 & 0.1282 & 0.77 & 0.4745 \tabularnewline
116 & 8.5 & 7.9647 & 7.2022 & 8.7272 & 0.0844 & 0.1316 & 0.7519 & 0.4639 \tabularnewline
117 & 8.5 & 7.949 & 7.1501 & 8.7479 & 0.0882 & 0.0882 & 0.6427 & 0.4502 \tabularnewline
118 & 8.6 & 7.9398 & 7.0978 & 8.7817 & 0.0622 & 0.0961 & 0.4443 & 0.4443 \tabularnewline
119 & 8.6 & 7.9398 & 7.0531 & 8.8265 & 0.0722 & 0.0722 & 0.3616 & 0.4471 \tabularnewline
120 & 8.5 & 7.9455 & 7.0174 & 8.8735 & 0.1208 & 0.0834 & 0.3721 & 0.4542 \tabularnewline
121 & 8.5 & 7.9513 & 6.9868 & 8.9158 & 0.1324 & 0.1324 & 0.4606 & 0.4606 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114795&T=1

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast[/C][/ROW]
[ROW][C]time[/C][C]Y[t][/C][C]F[t][/C][C]95% LB[/C][C]95% UB[/C][C]p-value(H0: Y[t] = F[t])[/C][C]P(F[t]>Y[t-1])[/C][C]P(F[t]>Y[t-s])[/C][C]P(F[t]>Y[109])[/C][/ROW]
[ROW][C]97[/C][C]7.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]7.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]7.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]7.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]7.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]7.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]7.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]7.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]7.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]8.1[/C][C]7.9167[/C][C]7.6913[/C][C]8.1421[/C][C]0.0555[/C][C]0.2345[/C][C]1[/C][C]0.2345[/C][/ROW]
[ROW][C]111[/C][C]8.2[/C][C]7.8814[/C][C]7.4713[/C][C]8.2915[/C][C]0.0639[/C][C]0.1481[/C][C]0.9973[/C][C]0.2854[/C][/ROW]
[ROW][C]112[/C][C]8.3[/C][C]7.901[/C][C]7.3382[/C][C]8.4638[/C][C]0.0823[/C][C]0.1489[/C][C]0.9187[/C][C]0.3651[/C][/ROW]
[ROW][C]113[/C][C]8.4[/C][C]7.94[/C][C]7.2886[/C][C]8.5915[/C][C]0.0832[/C][C]0.1394[/C][C]0.8469[/C][C]0.4284[/C][/ROW]
[ROW][C]114[/C][C]8.4[/C][C]7.9698[/C][C]7.2692[/C][C]8.6705[/C][C]0.1144[/C][C]0.1144[/C][C]0.7748[/C][C]0.4664[/C][/ROW]
[ROW][C]115[/C][C]8.4[/C][C]7.9761[/C][C]7.2438[/C][C]8.7083[/C][C]0.1282[/C][C]0.1282[/C][C]0.77[/C][C]0.4745[/C][/ROW]
[ROW][C]116[/C][C]8.5[/C][C]7.9647[/C][C]7.2022[/C][C]8.7272[/C][C]0.0844[/C][C]0.1316[/C][C]0.7519[/C][C]0.4639[/C][/ROW]
[ROW][C]117[/C][C]8.5[/C][C]7.949[/C][C]7.1501[/C][C]8.7479[/C][C]0.0882[/C][C]0.0882[/C][C]0.6427[/C][C]0.4502[/C][/ROW]
[ROW][C]118[/C][C]8.6[/C][C]7.9398[/C][C]7.0978[/C][C]8.7817[/C][C]0.0622[/C][C]0.0961[/C][C]0.4443[/C][C]0.4443[/C][/ROW]
[ROW][C]119[/C][C]8.6[/C][C]7.9398[/C][C]7.0531[/C][C]8.8265[/C][C]0.0722[/C][C]0.0722[/C][C]0.3616[/C][C]0.4471[/C][/ROW]
[ROW][C]120[/C][C]8.5[/C][C]7.9455[/C][C]7.0174[/C][C]8.8735[/C][C]0.1208[/C][C]0.0834[/C][C]0.3721[/C][C]0.4542[/C][/ROW]
[ROW][C]121[/C][C]8.5[/C][C]7.9513[/C][C]6.9868[/C][C]8.9158[/C][C]0.1324[/C][C]0.1324[/C][C]0.4606[/C][C]0.4606[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114795&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114795&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[109])
977.1-------
987.2-------
997.3-------
1007.5-------
1017.6-------
1027.7-------
1037.7-------
1047.7-------
1057.8-------
1068-------
1078.1-------
1088.1-------
1098-------
1108.17.91677.69138.14210.05550.234510.2345
1118.27.88147.47138.29150.06390.14810.99730.2854
1128.37.9017.33828.46380.08230.14890.91870.3651
1138.47.947.28868.59150.08320.13940.84690.4284
1148.47.96987.26928.67050.11440.11440.77480.4664
1158.47.97617.24388.70830.12820.12820.770.4745
1168.57.96477.20228.72720.08440.13160.75190.4639
1178.57.9497.15018.74790.08820.08820.64270.4502
1188.67.93987.09788.78170.06220.09610.44430.4443
1198.67.93987.05318.82650.07220.07220.36160.4471
1208.57.94557.01748.87350.12080.08340.37210.4542
1218.57.95136.98688.91580.13240.13240.46060.4606







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1100.01450.023200.033600
1110.02650.04040.03180.10150.06750.2599
1120.03630.05050.0380.15920.09810.3132
1130.04190.05790.0430.21160.12650.3556
1140.04490.0540.04520.1850.13820.3717
1150.04680.05320.04650.17970.14510.3809
1160.04880.06720.04950.28650.16530.4066
1170.05130.06930.0520.30360.18260.4273
1180.05410.08320.05540.43590.21070.4591
1190.0570.08320.05820.43590.23320.483
1200.05960.06980.05920.30750.240.4899
1210.06190.0690.06010.30110.24510.4951

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
110 & 0.0145 & 0.0232 & 0 & 0.0336 & 0 & 0 \tabularnewline
111 & 0.0265 & 0.0404 & 0.0318 & 0.1015 & 0.0675 & 0.2599 \tabularnewline
112 & 0.0363 & 0.0505 & 0.038 & 0.1592 & 0.0981 & 0.3132 \tabularnewline
113 & 0.0419 & 0.0579 & 0.043 & 0.2116 & 0.1265 & 0.3556 \tabularnewline
114 & 0.0449 & 0.054 & 0.0452 & 0.185 & 0.1382 & 0.3717 \tabularnewline
115 & 0.0468 & 0.0532 & 0.0465 & 0.1797 & 0.1451 & 0.3809 \tabularnewline
116 & 0.0488 & 0.0672 & 0.0495 & 0.2865 & 0.1653 & 0.4066 \tabularnewline
117 & 0.0513 & 0.0693 & 0.052 & 0.3036 & 0.1826 & 0.4273 \tabularnewline
118 & 0.0541 & 0.0832 & 0.0554 & 0.4359 & 0.2107 & 0.4591 \tabularnewline
119 & 0.057 & 0.0832 & 0.0582 & 0.4359 & 0.2332 & 0.483 \tabularnewline
120 & 0.0596 & 0.0698 & 0.0592 & 0.3075 & 0.24 & 0.4899 \tabularnewline
121 & 0.0619 & 0.069 & 0.0601 & 0.3011 & 0.2451 & 0.4951 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114795&T=2

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast Performance[/C][/ROW]
[ROW][C]time[/C][C]% S.E.[/C][C]PE[/C][C]MAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]110[/C][C]0.0145[/C][C]0.0232[/C][C]0[/C][C]0.0336[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]111[/C][C]0.0265[/C][C]0.0404[/C][C]0.0318[/C][C]0.1015[/C][C]0.0675[/C][C]0.2599[/C][/ROW]
[ROW][C]112[/C][C]0.0363[/C][C]0.0505[/C][C]0.038[/C][C]0.1592[/C][C]0.0981[/C][C]0.3132[/C][/ROW]
[ROW][C]113[/C][C]0.0419[/C][C]0.0579[/C][C]0.043[/C][C]0.2116[/C][C]0.1265[/C][C]0.3556[/C][/ROW]
[ROW][C]114[/C][C]0.0449[/C][C]0.054[/C][C]0.0452[/C][C]0.185[/C][C]0.1382[/C][C]0.3717[/C][/ROW]
[ROW][C]115[/C][C]0.0468[/C][C]0.0532[/C][C]0.0465[/C][C]0.1797[/C][C]0.1451[/C][C]0.3809[/C][/ROW]
[ROW][C]116[/C][C]0.0488[/C][C]0.0672[/C][C]0.0495[/C][C]0.2865[/C][C]0.1653[/C][C]0.4066[/C][/ROW]
[ROW][C]117[/C][C]0.0513[/C][C]0.0693[/C][C]0.052[/C][C]0.3036[/C][C]0.1826[/C][C]0.4273[/C][/ROW]
[ROW][C]118[/C][C]0.0541[/C][C]0.0832[/C][C]0.0554[/C][C]0.4359[/C][C]0.2107[/C][C]0.4591[/C][/ROW]
[ROW][C]119[/C][C]0.057[/C][C]0.0832[/C][C]0.0582[/C][C]0.4359[/C][C]0.2332[/C][C]0.483[/C][/ROW]
[ROW][C]120[/C][C]0.0596[/C][C]0.0698[/C][C]0.0592[/C][C]0.3075[/C][C]0.24[/C][C]0.4899[/C][/ROW]
[ROW][C]121[/C][C]0.0619[/C][C]0.069[/C][C]0.0601[/C][C]0.3011[/C][C]0.2451[/C][C]0.4951[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114795&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114795&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1100.01450.023200.033600
1110.02650.04040.03180.10150.06750.2599
1120.03630.05050.0380.15920.09810.3132
1130.04190.05790.0430.21160.12650.3556
1140.04490.0540.04520.1850.13820.3717
1150.04680.05320.04650.17970.14510.3809
1160.04880.06720.04950.28650.16530.4066
1170.05130.06930.0520.30360.18260.4273
1180.05410.08320.05540.43590.21070.4591
1190.0570.08320.05820.43590.23320.483
1200.05960.06980.05920.30750.240.4899
1210.06190.0690.06010.30110.24510.4951



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par1 <- as.numeric(par1) #cut off periods
par2 <- as.numeric(par2) #lambda
par3 <- as.numeric(par3) #degree of non-seasonal differencing
par4 <- as.numeric(par4) #degree of seasonal differencing
par5 <- as.numeric(par5) #seasonal period
par6 <- as.numeric(par6) #p
par7 <- as.numeric(par7) #q
par8 <- as.numeric(par8) #P
par9 <- as.numeric(par9) #Q
if (par10 == 'TRUE') par10 <- TRUE
if (par10 == 'FALSE') par10 <- FALSE
if (par2 == 0) x <- log(x)
if (par2 != 0) x <- x^par2
lx <- length(x)
first <- lx - 2*par1
nx <- lx - par1
nx1 <- nx + 1
fx <- lx - nx
if (fx < 1) {
fx <- par5
nx1 <- lx + fx - 1
first <- lx - 2*fx
}
first <- 1
if (fx < 3) fx <- round(lx/10,0)
(arima.out <- arima(x[1:nx], order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5), include.mean=par10, method='ML'))
(forecast <- predict(arima.out,par1))
(lb <- forecast$pred - 1.96 * forecast$se)
(ub <- forecast$pred + 1.96 * forecast$se)
if (par2 == 0) {
x <- exp(x)
forecast$pred <- exp(forecast$pred)
lb <- exp(lb)
ub <- exp(ub)
}
if (par2 != 0) {
x <- x^(1/par2)
forecast$pred <- forecast$pred^(1/par2)
lb <- lb^(1/par2)
ub <- ub^(1/par2)
}
if (par2 < 0) {
olb <- lb
lb <- ub
ub <- olb
}
(actandfor <- c(x[1:nx], forecast$pred))
(perc.se <- (ub-forecast$pred)/1.96/forecast$pred)
bitmap(file='test1.png')
opar <- par(mar=c(4,4,2,2),las=1)
ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub))
plot(x,ylim=ylim,type='n',xlim=c(first,lx))
usr <- par('usr')
rect(usr[1],usr[3],nx+1,usr[4],border=NA,col='lemonchiffon')
rect(nx1,usr[3],usr[2],usr[4],border=NA,col='lavender')
abline(h= (-3:3)*2 , col ='gray', lty =3)
polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = 'orange', lty=2,border=NA)
lines(nx1:lx, lb , lty=2)
lines(nx1:lx, ub , lty=2)
lines(x, lwd=2)
lines(nx1:lx, forecast$pred , lwd=2 , col ='white')
box()
par(opar)
dev.off()
prob.dec <- array(NA, dim=fx)
prob.sdec <- array(NA, dim=fx)
prob.ldec <- array(NA, dim=fx)
prob.pval <- array(NA, dim=fx)
perf.pe <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i]
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD)
prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD)
prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD)
prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD)
}
perf.mape[1] = abs(perf.pe[1])
perf.mse[1] = abs(perf.se[1])
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
}
perf.rmse = sqrt(perf.mse1)
bitmap(file='test2.png')
plot(forecast$pred, pch=19, type='b',main='ARIMA Extrapolation Forecast', ylab='Forecast and 95% CI', xlab='time',ylim=c(min(lb),max(ub)))
dum <- forecast$pred
dum[1:par1] <- x[(nx+1):lx]
lines(dum, lty=1)
lines(ub,lty=3)
lines(lb,lty=3)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast',9,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'Y[t]',1,header=TRUE)
a<-table.element(a,'F[t]',1,header=TRUE)
a<-table.element(a,'95% LB',1,header=TRUE)
a<-table.element(a,'95% UB',1,header=TRUE)
a<-table.element(a,'p-value
(H0: Y[t] = F[t])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-1])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-s])',1,header=TRUE)
mylab <- paste('P(F[t]>Y[',nx,sep='')
mylab <- paste(mylab,'])',sep='')
a<-table.element(a,mylab,1,header=TRUE)
a<-table.row.end(a)
for (i in (nx-par5):nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.row.end(a)
}
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(x[nx+i],4))
a<-table.element(a,round(forecast$pred[i],4))
a<-table.element(a,round(lb[i],4))
a<-table.element(a,round(ub[i],4))
a<-table.element(a,round((1-prob.pval[i]),4))
a<-table.element(a,round((1-prob.dec[i]),4))
a<-table.element(a,round((1-prob.sdec[i]),4))
a<-table.element(a,round((1-prob.ldec[i]),4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast Performance',7,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'% S.E.',1,header=TRUE)
a<-table.element(a,'PE',1,header=TRUE)
a<-table.element(a,'MAPE',1,header=TRUE)
a<-table.element(a,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',1,header=TRUE)
a<-table.row.end(a)
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(perc.se[i],4))
a<-table.element(a,round(perf.pe[i],4))
a<-table.element(a,round(perf.mape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')