Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationMon, 10 Dec 2007 10:10:51 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2007/Dec/10/t11973057867hrtquokbz0pood.htm/, Retrieved Mon, 06 May 2024 15:11:54 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2998, Retrieved Mon, 06 May 2024 15:11:54 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact242
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arma forecasting ...] [2007-12-10 17:10:51] [372f82c86cdcc50abc807b137b6a3bca] [Current]
Feedback Forum

Post a new message
Dataseries X:
0
0,2
-0,7
0
0,1
0,6
-0,3
-0,1
-0,6
0,2
0,1
0,1
-1,77636E-15
-0,1
8,88178E-16
-8,88178E-16
0,1
-0,2
0,1
0,1
-0,4
0
0
-1,77636E-15
0,1
0
-0,8
0
0
1,1
-1,77636E-15
0
-0,9
0
-0,1
0,1
0
0
0,8
0,1
-0,2
-1
-0,1
0
0,6
0
0
0
0
-0,1
0,2
0
0,1
-0,8
0
-0,1
0,1
0
-0,2
-8
0
0,2
0,2
0
0
0,2
-0,1
0,1
0
0,2
0,2
7,7




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 4 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2998&T=0

[TABLE]
[ROW][C]Summary of compuational 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]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2998&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2998&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







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[60])
480-------
490-------
50-0.1-------
510.2-------
520-------
530.1-------
54-0.8-------
550-------
56-0.1-------
570.1-------
580-------
59-0.2-------
60-8-------
610-6.9753-9.0338-4.916900.835400.8354
620.2-7.5121-10.2734-4.75080000.6355
630.2-2.6736-6.08830.7410.04950.04950.04950.9989
640-3.8337-7.3254-0.3420.01570.01180.01570.9903
650-3.0796-6.7140.55480.04840.04840.04320.996
660.2-6.0366-9.7552-2.3185e-047e-040.00290.8496
67-0.1-5.0693-9.1193-1.01930.00810.00540.00710.922
680.1-5.8563-10.1201-1.59240.00310.00410.00410.8378
690-3.8598-8.39790.67840.04780.04360.04360.9631
700.2-4.7662-9.4168-0.11560.01820.02230.02230.9135
710.2-3.9924-8.80890.82410.0440.0440.06140.9485
727.7-3.7807-8.71171.150300.05680.95320.9532

\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[60]) \tabularnewline
48 & 0 & - & - & - & - & - & - & - \tabularnewline
49 & 0 & - & - & - & - & - & - & - \tabularnewline
50 & -0.1 & - & - & - & - & - & - & - \tabularnewline
51 & 0.2 & - & - & - & - & - & - & - \tabularnewline
52 & 0 & - & - & - & - & - & - & - \tabularnewline
53 & 0.1 & - & - & - & - & - & - & - \tabularnewline
54 & -0.8 & - & - & - & - & - & - & - \tabularnewline
55 & 0 & - & - & - & - & - & - & - \tabularnewline
56 & -0.1 & - & - & - & - & - & - & - \tabularnewline
57 & 0.1 & - & - & - & - & - & - & - \tabularnewline
58 & 0 & - & - & - & - & - & - & - \tabularnewline
59 & -0.2 & - & - & - & - & - & - & - \tabularnewline
60 & -8 & - & - & - & - & - & - & - \tabularnewline
61 & 0 & -6.9753 & -9.0338 & -4.9169 & 0 & 0.8354 & 0 & 0.8354 \tabularnewline
62 & 0.2 & -7.5121 & -10.2734 & -4.7508 & 0 & 0 & 0 & 0.6355 \tabularnewline
63 & 0.2 & -2.6736 & -6.0883 & 0.741 & 0.0495 & 0.0495 & 0.0495 & 0.9989 \tabularnewline
64 & 0 & -3.8337 & -7.3254 & -0.342 & 0.0157 & 0.0118 & 0.0157 & 0.9903 \tabularnewline
65 & 0 & -3.0796 & -6.714 & 0.5548 & 0.0484 & 0.0484 & 0.0432 & 0.996 \tabularnewline
66 & 0.2 & -6.0366 & -9.7552 & -2.318 & 5e-04 & 7e-04 & 0.0029 & 0.8496 \tabularnewline
67 & -0.1 & -5.0693 & -9.1193 & -1.0193 & 0.0081 & 0.0054 & 0.0071 & 0.922 \tabularnewline
68 & 0.1 & -5.8563 & -10.1201 & -1.5924 & 0.0031 & 0.0041 & 0.0041 & 0.8378 \tabularnewline
69 & 0 & -3.8598 & -8.3979 & 0.6784 & 0.0478 & 0.0436 & 0.0436 & 0.9631 \tabularnewline
70 & 0.2 & -4.7662 & -9.4168 & -0.1156 & 0.0182 & 0.0223 & 0.0223 & 0.9135 \tabularnewline
71 & 0.2 & -3.9924 & -8.8089 & 0.8241 & 0.044 & 0.044 & 0.0614 & 0.9485 \tabularnewline
72 & 7.7 & -3.7807 & -8.7117 & 1.1503 & 0 & 0.0568 & 0.9532 & 0.9532 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2998&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[60])[/C][/ROW]
[ROW][C]48[/C][C]0[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]0[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]-0.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]0.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]0[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]0.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]-0.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]0[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]-0.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]0.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]0[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]-0.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]-8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]0[/C][C]-6.9753[/C][C]-9.0338[/C][C]-4.9169[/C][C]0[/C][C]0.8354[/C][C]0[/C][C]0.8354[/C][/ROW]
[ROW][C]62[/C][C]0.2[/C][C]-7.5121[/C][C]-10.2734[/C][C]-4.7508[/C][C]0[/C][C]0[/C][C]0[/C][C]0.6355[/C][/ROW]
[ROW][C]63[/C][C]0.2[/C][C]-2.6736[/C][C]-6.0883[/C][C]0.741[/C][C]0.0495[/C][C]0.0495[/C][C]0.0495[/C][C]0.9989[/C][/ROW]
[ROW][C]64[/C][C]0[/C][C]-3.8337[/C][C]-7.3254[/C][C]-0.342[/C][C]0.0157[/C][C]0.0118[/C][C]0.0157[/C][C]0.9903[/C][/ROW]
[ROW][C]65[/C][C]0[/C][C]-3.0796[/C][C]-6.714[/C][C]0.5548[/C][C]0.0484[/C][C]0.0484[/C][C]0.0432[/C][C]0.996[/C][/ROW]
[ROW][C]66[/C][C]0.2[/C][C]-6.0366[/C][C]-9.7552[/C][C]-2.318[/C][C]5e-04[/C][C]7e-04[/C][C]0.0029[/C][C]0.8496[/C][/ROW]
[ROW][C]67[/C][C]-0.1[/C][C]-5.0693[/C][C]-9.1193[/C][C]-1.0193[/C][C]0.0081[/C][C]0.0054[/C][C]0.0071[/C][C]0.922[/C][/ROW]
[ROW][C]68[/C][C]0.1[/C][C]-5.8563[/C][C]-10.1201[/C][C]-1.5924[/C][C]0.0031[/C][C]0.0041[/C][C]0.0041[/C][C]0.8378[/C][/ROW]
[ROW][C]69[/C][C]0[/C][C]-3.8598[/C][C]-8.3979[/C][C]0.6784[/C][C]0.0478[/C][C]0.0436[/C][C]0.0436[/C][C]0.9631[/C][/ROW]
[ROW][C]70[/C][C]0.2[/C][C]-4.7662[/C][C]-9.4168[/C][C]-0.1156[/C][C]0.0182[/C][C]0.0223[/C][C]0.0223[/C][C]0.9135[/C][/ROW]
[ROW][C]71[/C][C]0.2[/C][C]-3.9924[/C][C]-8.8089[/C][C]0.8241[/C][C]0.044[/C][C]0.044[/C][C]0.0614[/C][C]0.9485[/C][/ROW]
[ROW][C]72[/C][C]7.7[/C][C]-3.7807[/C][C]-8.7117[/C][C]1.1503[/C][C]0[/C][C]0.0568[/C][C]0.9532[/C][C]0.9532[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2998&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2998&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[60])
480-------
490-------
50-0.1-------
510.2-------
520-------
530.1-------
54-0.8-------
550-------
56-0.1-------
570.1-------
580-------
59-0.2-------
60-8-------
610-6.9753-9.0338-4.916900.835400.8354
620.2-7.5121-10.2734-4.75080000.6355
630.2-2.6736-6.08830.7410.04950.04950.04950.9989
640-3.8337-7.3254-0.3420.01570.01180.01570.9903
650-3.0796-6.7140.55480.04840.04840.04320.996
660.2-6.0366-9.7552-2.3185e-047e-040.00290.8496
67-0.1-5.0693-9.1193-1.01930.00810.00540.00710.922
680.1-5.8563-10.1201-1.59240.00310.00410.00410.8378
690-3.8598-8.39790.67840.04780.04360.04360.9631
700.2-4.7662-9.4168-0.11560.01820.02230.02230.9135
710.2-3.9924-8.80890.82410.0440.0440.06140.9485
727.7-3.7807-8.71171.150300.05680.95320.9532







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
61-0.1506-10.083348.65534.05462.0136
62-0.1875-1.02660.085659.4764.95632.2263
63-0.6516-1.07480.08968.25770.68810.8295
64-0.4647-10.083314.69731.22481.1067
65-0.6021-10.08339.48420.79030.889
66-0.3143-1.03310.086138.89483.24121.8003
67-0.4076-0.98030.081724.69382.05781.4345
68-0.3715-1.01710.084835.47692.95641.7194
69-0.5999-10.083314.89791.24151.1142
70-0.4978-1.0420.086824.66322.05531.4336
71-0.6155-1.05010.087517.57631.46471.2102
72-0.6654-3.03670.2531131.805810.98383.3142

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & -0.1506 & -1 & 0.0833 & 48.6553 & 4.0546 & 2.0136 \tabularnewline
62 & -0.1875 & -1.0266 & 0.0856 & 59.476 & 4.9563 & 2.2263 \tabularnewline
63 & -0.6516 & -1.0748 & 0.0896 & 8.2577 & 0.6881 & 0.8295 \tabularnewline
64 & -0.4647 & -1 & 0.0833 & 14.6973 & 1.2248 & 1.1067 \tabularnewline
65 & -0.6021 & -1 & 0.0833 & 9.4842 & 0.7903 & 0.889 \tabularnewline
66 & -0.3143 & -1.0331 & 0.0861 & 38.8948 & 3.2412 & 1.8003 \tabularnewline
67 & -0.4076 & -0.9803 & 0.0817 & 24.6938 & 2.0578 & 1.4345 \tabularnewline
68 & -0.3715 & -1.0171 & 0.0848 & 35.4769 & 2.9564 & 1.7194 \tabularnewline
69 & -0.5999 & -1 & 0.0833 & 14.8979 & 1.2415 & 1.1142 \tabularnewline
70 & -0.4978 & -1.042 & 0.0868 & 24.6632 & 2.0553 & 1.4336 \tabularnewline
71 & -0.6155 & -1.0501 & 0.0875 & 17.5763 & 1.4647 & 1.2102 \tabularnewline
72 & -0.6654 & -3.0367 & 0.2531 & 131.8058 & 10.9838 & 3.3142 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2998&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]61[/C][C]-0.1506[/C][C]-1[/C][C]0.0833[/C][C]48.6553[/C][C]4.0546[/C][C]2.0136[/C][/ROW]
[ROW][C]62[/C][C]-0.1875[/C][C]-1.0266[/C][C]0.0856[/C][C]59.476[/C][C]4.9563[/C][C]2.2263[/C][/ROW]
[ROW][C]63[/C][C]-0.6516[/C][C]-1.0748[/C][C]0.0896[/C][C]8.2577[/C][C]0.6881[/C][C]0.8295[/C][/ROW]
[ROW][C]64[/C][C]-0.4647[/C][C]-1[/C][C]0.0833[/C][C]14.6973[/C][C]1.2248[/C][C]1.1067[/C][/ROW]
[ROW][C]65[/C][C]-0.6021[/C][C]-1[/C][C]0.0833[/C][C]9.4842[/C][C]0.7903[/C][C]0.889[/C][/ROW]
[ROW][C]66[/C][C]-0.3143[/C][C]-1.0331[/C][C]0.0861[/C][C]38.8948[/C][C]3.2412[/C][C]1.8003[/C][/ROW]
[ROW][C]67[/C][C]-0.4076[/C][C]-0.9803[/C][C]0.0817[/C][C]24.6938[/C][C]2.0578[/C][C]1.4345[/C][/ROW]
[ROW][C]68[/C][C]-0.3715[/C][C]-1.0171[/C][C]0.0848[/C][C]35.4769[/C][C]2.9564[/C][C]1.7194[/C][/ROW]
[ROW][C]69[/C][C]-0.5999[/C][C]-1[/C][C]0.0833[/C][C]14.8979[/C][C]1.2415[/C][C]1.1142[/C][/ROW]
[ROW][C]70[/C][C]-0.4978[/C][C]-1.042[/C][C]0.0868[/C][C]24.6632[/C][C]2.0553[/C][C]1.4336[/C][/ROW]
[ROW][C]71[/C][C]-0.6155[/C][C]-1.0501[/C][C]0.0875[/C][C]17.5763[/C][C]1.4647[/C][C]1.2102[/C][/ROW]
[ROW][C]72[/C][C]-0.6654[/C][C]-3.0367[/C][C]0.2531[/C][C]131.8058[/C][C]10.9838[/C][C]3.3142[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2998&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2998&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
61-0.1506-10.083348.65534.05462.0136
62-0.1875-1.02660.085659.4764.95632.2263
63-0.6516-1.07480.08968.25770.68810.8295
64-0.4647-10.083314.69731.22481.1067
65-0.6021-10.08339.48420.79030.889
66-0.3143-1.03310.086138.89483.24121.8003
67-0.4076-0.98030.081724.69382.05781.4345
68-0.3715-1.01710.084835.47692.95641.7194
69-0.5999-10.083314.89791.24151.1142
70-0.4978-1.0420.086824.66322.05531.4336
71-0.6155-1.05010.087517.57631.46471.2102
72-0.6654-3.03670.2531131.805810.98383.3142



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 1 ; 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,fx))
(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)
}
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')