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 computationSat, 15 Dec 2012 06:36:22 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2012/Dec/15/t1355571565w1lp2z0tbey9pp8.htm/, Retrieved Tue, 30 Apr 2024 11:53:21 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=199847, Retrieved Tue, 30 Apr 2024 11:53:21 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact98
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [Paper Arima Forec...] [2012-12-15 11:29:10] [86dcce9422b96d4554cb918e531c1d5d]
- R P     [ARIMA Forecasting] [Paper Arima Forec...] [2012-12-15 11:36:22] [c63d55528b56cf8bb48e0b5d1a959d8e] [Current]
-    D      [ARIMA Forecasting] [Paper Arima Forec...] [2012-12-15 12:14:28] [86dcce9422b96d4554cb918e531c1d5d]
Feedback Forum

Post a new message
Dataseries X:
68.897
38.683
44.720
39.525
45.315
50.380
40.600
36.279
42.438
38.064
31.879
11.379
70.249
39.253
47.060
41.697
38.708
49.267
39.018
32.228
40.870
39.383
34.571
12.066
70.938
34.077
45.409
40.809
37.013
44.953
37.848
32.745
43.412
34.931
33.008
8.620
68.906
39.556
50.669
36.432
40.891
48.428
36.222
33.425
39.401
37.967
34.801
12.657
69.116
41.519
51.321
38.529
41.547
52.073
38.401
40.898
40.439
41.888
37.898
8.771
68.184
50.530
47.221
41.756
45.633
48.138
39.486
39.341
41.117
41.629
29.722
7.054
56.676
34.870
35.117
30.169
30.936
35.699
33.228
27.733
33.666
35.429
27.438
8.170
63.410
38.040
45.389
37.353
37.024
50.957
37.994
36.454
46.080
43.373
37.395
10.963
76.058
50.179
57.452
47.568
50.050
50.856
41.992
39.284




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net

\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 & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=199847&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=199847&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=199847&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 time3 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net







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[92])
8027.733-------
8133.666-------
8235.429-------
8327.438-------
848.17-------
8563.41-------
8638.04-------
8745.389-------
8837.353-------
8937.024-------
9050.957-------
9137.994-------
9236.454-------
9346.0842.807836.294249.32140.16240.97210.9970.9721
9443.37340.776634.023147.53020.22560.06190.93970.8952
9537.39534.629327.099442.15920.23580.01140.96940.3174
9610.96312.4033.540821.26530.375100.82540
9776.05867.26757.903976.63020.032910.79031
9850.17942.967832.79753.13860.082300.82880.8953
9957.45247.682936.73258.63380.04020.32750.65930.9778
10047.56840.05228.525351.57870.10060.00150.67690.7297
10150.0541.340929.138553.54320.08090.15860.7560.7838
10250.85649.99837.185462.81060.44780.49680.44170.9809
10341.99240.491327.122753.860.41290.06430.64290.723
10439.28438.202524.260952.14420.43960.29710.59710.5971

\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[92]) \tabularnewline
80 & 27.733 & - & - & - & - & - & - & - \tabularnewline
81 & 33.666 & - & - & - & - & - & - & - \tabularnewline
82 & 35.429 & - & - & - & - & - & - & - \tabularnewline
83 & 27.438 & - & - & - & - & - & - & - \tabularnewline
84 & 8.17 & - & - & - & - & - & - & - \tabularnewline
85 & 63.41 & - & - & - & - & - & - & - \tabularnewline
86 & 38.04 & - & - & - & - & - & - & - \tabularnewline
87 & 45.389 & - & - & - & - & - & - & - \tabularnewline
88 & 37.353 & - & - & - & - & - & - & - \tabularnewline
89 & 37.024 & - & - & - & - & - & - & - \tabularnewline
90 & 50.957 & - & - & - & - & - & - & - \tabularnewline
91 & 37.994 & - & - & - & - & - & - & - \tabularnewline
92 & 36.454 & - & - & - & - & - & - & - \tabularnewline
93 & 46.08 & 42.8078 & 36.2942 & 49.3214 & 0.1624 & 0.9721 & 0.997 & 0.9721 \tabularnewline
94 & 43.373 & 40.7766 & 34.0231 & 47.5302 & 0.2256 & 0.0619 & 0.9397 & 0.8952 \tabularnewline
95 & 37.395 & 34.6293 & 27.0994 & 42.1592 & 0.2358 & 0.0114 & 0.9694 & 0.3174 \tabularnewline
96 & 10.963 & 12.403 & 3.5408 & 21.2653 & 0.3751 & 0 & 0.8254 & 0 \tabularnewline
97 & 76.058 & 67.267 & 57.9039 & 76.6302 & 0.0329 & 1 & 0.7903 & 1 \tabularnewline
98 & 50.179 & 42.9678 & 32.797 & 53.1386 & 0.0823 & 0 & 0.8288 & 0.8953 \tabularnewline
99 & 57.452 & 47.6829 & 36.732 & 58.6338 & 0.0402 & 0.3275 & 0.6593 & 0.9778 \tabularnewline
100 & 47.568 & 40.052 & 28.5253 & 51.5787 & 0.1006 & 0.0015 & 0.6769 & 0.7297 \tabularnewline
101 & 50.05 & 41.3409 & 29.1385 & 53.5432 & 0.0809 & 0.1586 & 0.756 & 0.7838 \tabularnewline
102 & 50.856 & 49.998 & 37.1854 & 62.8106 & 0.4478 & 0.4968 & 0.4417 & 0.9809 \tabularnewline
103 & 41.992 & 40.4913 & 27.1227 & 53.86 & 0.4129 & 0.0643 & 0.6429 & 0.723 \tabularnewline
104 & 39.284 & 38.2025 & 24.2609 & 52.1442 & 0.4396 & 0.2971 & 0.5971 & 0.5971 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=199847&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[92])[/C][/ROW]
[ROW][C]80[/C][C]27.733[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]33.666[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]35.429[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]27.438[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]8.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]63.41[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]38.04[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]45.389[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]37.353[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]37.024[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]50.957[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]37.994[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]36.454[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]46.08[/C][C]42.8078[/C][C]36.2942[/C][C]49.3214[/C][C]0.1624[/C][C]0.9721[/C][C]0.997[/C][C]0.9721[/C][/ROW]
[ROW][C]94[/C][C]43.373[/C][C]40.7766[/C][C]34.0231[/C][C]47.5302[/C][C]0.2256[/C][C]0.0619[/C][C]0.9397[/C][C]0.8952[/C][/ROW]
[ROW][C]95[/C][C]37.395[/C][C]34.6293[/C][C]27.0994[/C][C]42.1592[/C][C]0.2358[/C][C]0.0114[/C][C]0.9694[/C][C]0.3174[/C][/ROW]
[ROW][C]96[/C][C]10.963[/C][C]12.403[/C][C]3.5408[/C][C]21.2653[/C][C]0.3751[/C][C]0[/C][C]0.8254[/C][C]0[/C][/ROW]
[ROW][C]97[/C][C]76.058[/C][C]67.267[/C][C]57.9039[/C][C]76.6302[/C][C]0.0329[/C][C]1[/C][C]0.7903[/C][C]1[/C][/ROW]
[ROW][C]98[/C][C]50.179[/C][C]42.9678[/C][C]32.797[/C][C]53.1386[/C][C]0.0823[/C][C]0[/C][C]0.8288[/C][C]0.8953[/C][/ROW]
[ROW][C]99[/C][C]57.452[/C][C]47.6829[/C][C]36.732[/C][C]58.6338[/C][C]0.0402[/C][C]0.3275[/C][C]0.6593[/C][C]0.9778[/C][/ROW]
[ROW][C]100[/C][C]47.568[/C][C]40.052[/C][C]28.5253[/C][C]51.5787[/C][C]0.1006[/C][C]0.0015[/C][C]0.6769[/C][C]0.7297[/C][/ROW]
[ROW][C]101[/C][C]50.05[/C][C]41.3409[/C][C]29.1385[/C][C]53.5432[/C][C]0.0809[/C][C]0.1586[/C][C]0.756[/C][C]0.7838[/C][/ROW]
[ROW][C]102[/C][C]50.856[/C][C]49.998[/C][C]37.1854[/C][C]62.8106[/C][C]0.4478[/C][C]0.4968[/C][C]0.4417[/C][C]0.9809[/C][/ROW]
[ROW][C]103[/C][C]41.992[/C][C]40.4913[/C][C]27.1227[/C][C]53.86[/C][C]0.4129[/C][C]0.0643[/C][C]0.6429[/C][C]0.723[/C][/ROW]
[ROW][C]104[/C][C]39.284[/C][C]38.2025[/C][C]24.2609[/C][C]52.1442[/C][C]0.4396[/C][C]0.2971[/C][C]0.5971[/C][C]0.5971[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=199847&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=199847&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[92])
8027.733-------
8133.666-------
8235.429-------
8327.438-------
848.17-------
8563.41-------
8638.04-------
8745.389-------
8837.353-------
8937.024-------
9050.957-------
9137.994-------
9236.454-------
9346.0842.807836.294249.32140.16240.97210.9970.9721
9443.37340.776634.023147.53020.22560.06190.93970.8952
9537.39534.629327.099442.15920.23580.01140.96940.3174
9610.96312.4033.540821.26530.375100.82540
9776.05867.26757.903976.63020.032910.79031
9850.17942.967832.79753.13860.082300.82880.8953
9957.45247.682936.73258.63380.04020.32750.65930.9778
10047.56840.05228.525351.57870.10060.00150.67690.7297
10150.0541.340929.138553.54320.08090.15860.7560.7838
10250.85649.99837.185462.81060.44780.49680.44170.9809
10341.99240.491327.122753.860.41290.06430.64290.723
10439.28438.202524.260952.14420.43960.29710.59710.5971







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
930.07760.0764010.707200
940.08450.06370.07016.74128.72422.9537
950.11090.07990.07337.64918.36582.8924
960.3646-0.11610.0842.07376.79282.6063
970.0710.13070.093477.280920.89044.5706
980.12080.16780.105852.001526.07565.1064
990.11720.20490.119995.435635.98425.9987
1000.14680.18770.128456.490138.54746.2087
1010.15060.21070.137575.849142.6926.5339
1020.13070.01720.12550.736238.49656.2046
1030.16840.03710.11752.25235.20155.9331
1040.18620.02830.111.169632.36555.6891

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
93 & 0.0776 & 0.0764 & 0 & 10.7072 & 0 & 0 \tabularnewline
94 & 0.0845 & 0.0637 & 0.0701 & 6.7412 & 8.7242 & 2.9537 \tabularnewline
95 & 0.1109 & 0.0799 & 0.0733 & 7.6491 & 8.3658 & 2.8924 \tabularnewline
96 & 0.3646 & -0.1161 & 0.084 & 2.0737 & 6.7928 & 2.6063 \tabularnewline
97 & 0.071 & 0.1307 & 0.0934 & 77.2809 & 20.8904 & 4.5706 \tabularnewline
98 & 0.1208 & 0.1678 & 0.1058 & 52.0015 & 26.0756 & 5.1064 \tabularnewline
99 & 0.1172 & 0.2049 & 0.1199 & 95.4356 & 35.9842 & 5.9987 \tabularnewline
100 & 0.1468 & 0.1877 & 0.1284 & 56.4901 & 38.5474 & 6.2087 \tabularnewline
101 & 0.1506 & 0.2107 & 0.1375 & 75.8491 & 42.692 & 6.5339 \tabularnewline
102 & 0.1307 & 0.0172 & 0.1255 & 0.7362 & 38.4965 & 6.2046 \tabularnewline
103 & 0.1684 & 0.0371 & 0.1175 & 2.252 & 35.2015 & 5.9331 \tabularnewline
104 & 0.1862 & 0.0283 & 0.11 & 1.1696 & 32.3655 & 5.6891 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=199847&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]93[/C][C]0.0776[/C][C]0.0764[/C][C]0[/C][C]10.7072[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]94[/C][C]0.0845[/C][C]0.0637[/C][C]0.0701[/C][C]6.7412[/C][C]8.7242[/C][C]2.9537[/C][/ROW]
[ROW][C]95[/C][C]0.1109[/C][C]0.0799[/C][C]0.0733[/C][C]7.6491[/C][C]8.3658[/C][C]2.8924[/C][/ROW]
[ROW][C]96[/C][C]0.3646[/C][C]-0.1161[/C][C]0.084[/C][C]2.0737[/C][C]6.7928[/C][C]2.6063[/C][/ROW]
[ROW][C]97[/C][C]0.071[/C][C]0.1307[/C][C]0.0934[/C][C]77.2809[/C][C]20.8904[/C][C]4.5706[/C][/ROW]
[ROW][C]98[/C][C]0.1208[/C][C]0.1678[/C][C]0.1058[/C][C]52.0015[/C][C]26.0756[/C][C]5.1064[/C][/ROW]
[ROW][C]99[/C][C]0.1172[/C][C]0.2049[/C][C]0.1199[/C][C]95.4356[/C][C]35.9842[/C][C]5.9987[/C][/ROW]
[ROW][C]100[/C][C]0.1468[/C][C]0.1877[/C][C]0.1284[/C][C]56.4901[/C][C]38.5474[/C][C]6.2087[/C][/ROW]
[ROW][C]101[/C][C]0.1506[/C][C]0.2107[/C][C]0.1375[/C][C]75.8491[/C][C]42.692[/C][C]6.5339[/C][/ROW]
[ROW][C]102[/C][C]0.1307[/C][C]0.0172[/C][C]0.1255[/C][C]0.7362[/C][C]38.4965[/C][C]6.2046[/C][/ROW]
[ROW][C]103[/C][C]0.1684[/C][C]0.0371[/C][C]0.1175[/C][C]2.252[/C][C]35.2015[/C][C]5.9331[/C][/ROW]
[ROW][C]104[/C][C]0.1862[/C][C]0.0283[/C][C]0.11[/C][C]1.1696[/C][C]32.3655[/C][C]5.6891[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=199847&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=199847&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
930.07760.0764010.707200
940.08450.06370.07016.74128.72422.9537
950.11090.07990.07337.64918.36582.8924
960.3646-0.11610.0842.07376.79282.6063
970.0710.13070.093477.280920.89044.5706
980.12080.16780.105852.001526.07565.1064
990.11720.20490.119995.435635.98425.9987
1000.14680.18770.128456.490138.54746.2087
1010.15060.21070.137575.849142.6926.5339
1020.13070.01720.12550.736238.49656.2046
1030.16840.03710.11752.25235.20155.9331
1040.18620.02830.111.169632.36555.6891



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 0 ; 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,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')