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 computationTue, 12 Dec 2017 15:30:40 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2017/Dec/12/t1513089296706pcv3ic2ymx1k.htm/, Retrieved Wed, 15 May 2024 14:56:07 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=309112, Retrieved Wed, 15 May 2024 14:56:07 +0000
QR Codes:

Original text written by user:Textile etc. Forecast for 2007
IsPrivate?No (this computation is public)
User-defined keywordsDataset 3
Estimated Impact96
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2017-12-12 14:30:40] [79eb5143bcf363cf12f20cb866038ece] [Current]
Feedback Forum

Post a new message
Dataseries X:
122.2
136.1
145.5
116.7
137.1
125.5
112.4
106.3
145.7
151.5
144.6
116.4
137.7
138.8
149.5
125
133.4
134.4
124.8
110.6
142.4
149.6
134.6
103.3
136.5
137.1
140.7
131.4
126.2
125.3
126.6
107.7
144.5
154.2
131.4
105.7
136.2
133.3
130
129.3
113.1
117.7
116.3
97.3
140.6
141.2
120.8
106.2
121.5
122.6
137.2
118.9
107.2
127.4
111.8
100
138.3
128
121.2
105.9
112.5
123.1
129
115.5
105.7
122.3
106.4
101.1
131.6
119.5
127
106.9
115.9
122.7
137.2
108.5
115.2
129.4
112.3
104.3
140
139.9
134.9
105.1




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309112&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=309112&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309112&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center







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[72])
60105.9-------
61112.5-------
62123.1-------
63129-------
64115.5-------
65105.7-------
66122.3-------
67106.4-------
68101.1-------
69131.6-------
70119.5-------
71127-------
72106.9-------
73115.9110.1221102.5233119.22960.10690.7560.30440.756
74122.7126.4309116.0016139.43580.2870.94380.69220.9984
75137.2130.377119.1068144.59920.17350.8550.57530.9994
76108.5113.7813104.3577125.54380.189400.38730.8742
77115.2108.8434100.2913119.38380.11860.52550.72060.6411
78129.4122.2268111.0215136.59490.16390.83110.4960.9817
79112.3106.369297.8615116.89890.134800.49770.4606
80104.3101.704793.9956111.12870.29470.01380.550.14
81140132.5319118.4611151.41830.21920.99830.53850.9961
82139.9121.4342109.7027136.70940.00890.00860.5980.9689
83134.9127.9648114.745145.54670.21970.09170.54280.9906
84105.1107.085698.1917118.19480.36300.51310.5131

\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[72]) \tabularnewline
60 & 105.9 & - & - & - & - & - & - & - \tabularnewline
61 & 112.5 & - & - & - & - & - & - & - \tabularnewline
62 & 123.1 & - & - & - & - & - & - & - \tabularnewline
63 & 129 & - & - & - & - & - & - & - \tabularnewline
64 & 115.5 & - & - & - & - & - & - & - \tabularnewline
65 & 105.7 & - & - & - & - & - & - & - \tabularnewline
66 & 122.3 & - & - & - & - & - & - & - \tabularnewline
67 & 106.4 & - & - & - & - & - & - & - \tabularnewline
68 & 101.1 & - & - & - & - & - & - & - \tabularnewline
69 & 131.6 & - & - & - & - & - & - & - \tabularnewline
70 & 119.5 & - & - & - & - & - & - & - \tabularnewline
71 & 127 & - & - & - & - & - & - & - \tabularnewline
72 & 106.9 & - & - & - & - & - & - & - \tabularnewline
73 & 115.9 & 110.1221 & 102.5233 & 119.2296 & 0.1069 & 0.756 & 0.3044 & 0.756 \tabularnewline
74 & 122.7 & 126.4309 & 116.0016 & 139.4358 & 0.287 & 0.9438 & 0.6922 & 0.9984 \tabularnewline
75 & 137.2 & 130.377 & 119.1068 & 144.5992 & 0.1735 & 0.855 & 0.5753 & 0.9994 \tabularnewline
76 & 108.5 & 113.7813 & 104.3577 & 125.5438 & 0.1894 & 0 & 0.3873 & 0.8742 \tabularnewline
77 & 115.2 & 108.8434 & 100.2913 & 119.3838 & 0.1186 & 0.5255 & 0.7206 & 0.6411 \tabularnewline
78 & 129.4 & 122.2268 & 111.0215 & 136.5949 & 0.1639 & 0.8311 & 0.496 & 0.9817 \tabularnewline
79 & 112.3 & 106.3692 & 97.8615 & 116.8989 & 0.1348 & 0 & 0.4977 & 0.4606 \tabularnewline
80 & 104.3 & 101.7047 & 93.9956 & 111.1287 & 0.2947 & 0.0138 & 0.55 & 0.14 \tabularnewline
81 & 140 & 132.5319 & 118.4611 & 151.4183 & 0.2192 & 0.9983 & 0.5385 & 0.9961 \tabularnewline
82 & 139.9 & 121.4342 & 109.7027 & 136.7094 & 0.0089 & 0.0086 & 0.598 & 0.9689 \tabularnewline
83 & 134.9 & 127.9648 & 114.745 & 145.5467 & 0.2197 & 0.0917 & 0.5428 & 0.9906 \tabularnewline
84 & 105.1 & 107.0856 & 98.1917 & 118.1948 & 0.363 & 0 & 0.5131 & 0.5131 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309112&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[72])[/C][/ROW]
[ROW][C]60[/C][C]105.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]112.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]123.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]129[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]115.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]105.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]122.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]106.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]101.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]131.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]119.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]127[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]106.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]115.9[/C][C]110.1221[/C][C]102.5233[/C][C]119.2296[/C][C]0.1069[/C][C]0.756[/C][C]0.3044[/C][C]0.756[/C][/ROW]
[ROW][C]74[/C][C]122.7[/C][C]126.4309[/C][C]116.0016[/C][C]139.4358[/C][C]0.287[/C][C]0.9438[/C][C]0.6922[/C][C]0.9984[/C][/ROW]
[ROW][C]75[/C][C]137.2[/C][C]130.377[/C][C]119.1068[/C][C]144.5992[/C][C]0.1735[/C][C]0.855[/C][C]0.5753[/C][C]0.9994[/C][/ROW]
[ROW][C]76[/C][C]108.5[/C][C]113.7813[/C][C]104.3577[/C][C]125.5438[/C][C]0.1894[/C][C]0[/C][C]0.3873[/C][C]0.8742[/C][/ROW]
[ROW][C]77[/C][C]115.2[/C][C]108.8434[/C][C]100.2913[/C][C]119.3838[/C][C]0.1186[/C][C]0.5255[/C][C]0.7206[/C][C]0.6411[/C][/ROW]
[ROW][C]78[/C][C]129.4[/C][C]122.2268[/C][C]111.0215[/C][C]136.5949[/C][C]0.1639[/C][C]0.8311[/C][C]0.496[/C][C]0.9817[/C][/ROW]
[ROW][C]79[/C][C]112.3[/C][C]106.3692[/C][C]97.8615[/C][C]116.8989[/C][C]0.1348[/C][C]0[/C][C]0.4977[/C][C]0.4606[/C][/ROW]
[ROW][C]80[/C][C]104.3[/C][C]101.7047[/C][C]93.9956[/C][C]111.1287[/C][C]0.2947[/C][C]0.0138[/C][C]0.55[/C][C]0.14[/C][/ROW]
[ROW][C]81[/C][C]140[/C][C]132.5319[/C][C]118.4611[/C][C]151.4183[/C][C]0.2192[/C][C]0.9983[/C][C]0.5385[/C][C]0.9961[/C][/ROW]
[ROW][C]82[/C][C]139.9[/C][C]121.4342[/C][C]109.7027[/C][C]136.7094[/C][C]0.0089[/C][C]0.0086[/C][C]0.598[/C][C]0.9689[/C][/ROW]
[ROW][C]83[/C][C]134.9[/C][C]127.9648[/C][C]114.745[/C][C]145.5467[/C][C]0.2197[/C][C]0.0917[/C][C]0.5428[/C][C]0.9906[/C][/ROW]
[ROW][C]84[/C][C]105.1[/C][C]107.0856[/C][C]98.1917[/C][C]118.1948[/C][C]0.363[/C][C]0[/C][C]0.5131[/C][C]0.5131[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309112&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309112&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[72])
60105.9-------
61112.5-------
62123.1-------
63129-------
64115.5-------
65105.7-------
66122.3-------
67106.4-------
68101.1-------
69131.6-------
70119.5-------
71127-------
72106.9-------
73115.9110.1221102.5233119.22960.10690.7560.30440.756
74122.7126.4309116.0016139.43580.2870.94380.69220.9984
75137.2130.377119.1068144.59920.17350.8550.57530.9994
76108.5113.7813104.3577125.54380.189400.38730.8742
77115.2108.8434100.2913119.38380.11860.52550.72060.6411
78129.4122.2268111.0215136.59490.16390.83110.4960.9817
79112.3106.369297.8615116.89890.134800.49770.4606
80104.3101.704793.9956111.12870.29470.01380.550.14
81140132.5319118.4611151.41830.21920.99830.53850.9961
82139.9121.4342109.7027136.70940.00890.00860.5980.9689
83134.9127.9648114.745145.54670.21970.09170.54280.9906
84105.1107.085698.1917118.19480.36300.51310.5131







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
730.04220.04990.04990.051133.3838000.38150.3815
740.0525-0.03040.04010.040513.919523.65174.8633-0.24630.3139
750.05570.04970.04330.04446.552831.28545.59330.45050.3594
760.0527-0.04870.04470.044927.891830.4375.517-0.34870.3568
770.04940.05520.04680.047340.406532.43095.69480.41970.3693
780.060.05540.04820.048951.45535.60165.96670.47360.3867
790.05050.05280.04890.049735.174835.54065.96160.39160.3874
800.04730.02490.04590.04666.735631.945.65150.17140.3604
810.07270.05330.04670.047555.773234.58815.88120.49310.3752
820.06420.1320.05520.0569340.98765.2288.07641.21920.4596
830.07010.05140.05490.056548.097463.67077.97940.45790.4594
840.0529-0.01890.05190.05343.942758.69337.6612-0.13110.4321

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
73 & 0.0422 & 0.0499 & 0.0499 & 0.0511 & 33.3838 & 0 & 0 & 0.3815 & 0.3815 \tabularnewline
74 & 0.0525 & -0.0304 & 0.0401 & 0.0405 & 13.9195 & 23.6517 & 4.8633 & -0.2463 & 0.3139 \tabularnewline
75 & 0.0557 & 0.0497 & 0.0433 & 0.044 & 46.5528 & 31.2854 & 5.5933 & 0.4505 & 0.3594 \tabularnewline
76 & 0.0527 & -0.0487 & 0.0447 & 0.0449 & 27.8918 & 30.437 & 5.517 & -0.3487 & 0.3568 \tabularnewline
77 & 0.0494 & 0.0552 & 0.0468 & 0.0473 & 40.4065 & 32.4309 & 5.6948 & 0.4197 & 0.3693 \tabularnewline
78 & 0.06 & 0.0554 & 0.0482 & 0.0489 & 51.455 & 35.6016 & 5.9667 & 0.4736 & 0.3867 \tabularnewline
79 & 0.0505 & 0.0528 & 0.0489 & 0.0497 & 35.1748 & 35.5406 & 5.9616 & 0.3916 & 0.3874 \tabularnewline
80 & 0.0473 & 0.0249 & 0.0459 & 0.0466 & 6.7356 & 31.94 & 5.6515 & 0.1714 & 0.3604 \tabularnewline
81 & 0.0727 & 0.0533 & 0.0467 & 0.0475 & 55.7732 & 34.5881 & 5.8812 & 0.4931 & 0.3752 \tabularnewline
82 & 0.0642 & 0.132 & 0.0552 & 0.0569 & 340.987 & 65.228 & 8.0764 & 1.2192 & 0.4596 \tabularnewline
83 & 0.0701 & 0.0514 & 0.0549 & 0.0565 & 48.0974 & 63.6707 & 7.9794 & 0.4579 & 0.4594 \tabularnewline
84 & 0.0529 & -0.0189 & 0.0519 & 0.0534 & 3.9427 & 58.6933 & 7.6612 & -0.1311 & 0.4321 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309112&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]73[/C][C]0.0422[/C][C]0.0499[/C][C]0.0499[/C][C]0.0511[/C][C]33.3838[/C][C]0[/C][C]0[/C][C]0.3815[/C][C]0.3815[/C][/ROW]
[ROW][C]74[/C][C]0.0525[/C][C]-0.0304[/C][C]0.0401[/C][C]0.0405[/C][C]13.9195[/C][C]23.6517[/C][C]4.8633[/C][C]-0.2463[/C][C]0.3139[/C][/ROW]
[ROW][C]75[/C][C]0.0557[/C][C]0.0497[/C][C]0.0433[/C][C]0.044[/C][C]46.5528[/C][C]31.2854[/C][C]5.5933[/C][C]0.4505[/C][C]0.3594[/C][/ROW]
[ROW][C]76[/C][C]0.0527[/C][C]-0.0487[/C][C]0.0447[/C][C]0.0449[/C][C]27.8918[/C][C]30.437[/C][C]5.517[/C][C]-0.3487[/C][C]0.3568[/C][/ROW]
[ROW][C]77[/C][C]0.0494[/C][C]0.0552[/C][C]0.0468[/C][C]0.0473[/C][C]40.4065[/C][C]32.4309[/C][C]5.6948[/C][C]0.4197[/C][C]0.3693[/C][/ROW]
[ROW][C]78[/C][C]0.06[/C][C]0.0554[/C][C]0.0482[/C][C]0.0489[/C][C]51.455[/C][C]35.6016[/C][C]5.9667[/C][C]0.4736[/C][C]0.3867[/C][/ROW]
[ROW][C]79[/C][C]0.0505[/C][C]0.0528[/C][C]0.0489[/C][C]0.0497[/C][C]35.1748[/C][C]35.5406[/C][C]5.9616[/C][C]0.3916[/C][C]0.3874[/C][/ROW]
[ROW][C]80[/C][C]0.0473[/C][C]0.0249[/C][C]0.0459[/C][C]0.0466[/C][C]6.7356[/C][C]31.94[/C][C]5.6515[/C][C]0.1714[/C][C]0.3604[/C][/ROW]
[ROW][C]81[/C][C]0.0727[/C][C]0.0533[/C][C]0.0467[/C][C]0.0475[/C][C]55.7732[/C][C]34.5881[/C][C]5.8812[/C][C]0.4931[/C][C]0.3752[/C][/ROW]
[ROW][C]82[/C][C]0.0642[/C][C]0.132[/C][C]0.0552[/C][C]0.0569[/C][C]340.987[/C][C]65.228[/C][C]8.0764[/C][C]1.2192[/C][C]0.4596[/C][/ROW]
[ROW][C]83[/C][C]0.0701[/C][C]0.0514[/C][C]0.0549[/C][C]0.0565[/C][C]48.0974[/C][C]63.6707[/C][C]7.9794[/C][C]0.4579[/C][C]0.4594[/C][/ROW]
[ROW][C]84[/C][C]0.0529[/C][C]-0.0189[/C][C]0.0519[/C][C]0.0534[/C][C]3.9427[/C][C]58.6933[/C][C]7.6612[/C][C]-0.1311[/C][C]0.4321[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309112&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309112&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
730.04220.04990.04990.051133.3838000.38150.3815
740.0525-0.03040.04010.040513.919523.65174.8633-0.24630.3139
750.05570.04970.04330.04446.552831.28545.59330.45050.3594
760.0527-0.04870.04470.044927.891830.4375.517-0.34870.3568
770.04940.05520.04680.047340.406532.43095.69480.41970.3693
780.060.05540.04820.048951.45535.60165.96670.47360.3867
790.05050.05280.04890.049735.174835.54065.96160.39160.3874
800.04730.02490.04590.04666.735631.945.65150.17140.3604
810.07270.05330.04670.047555.773234.58815.88120.49310.3752
820.06420.1320.05520.0569340.98765.2288.07641.21920.4596
830.07010.05140.05490.056548.097463.67077.97940.45790.4594
840.0529-0.01890.05190.05343.942758.69337.6612-0.13110.4321



Parameters (Session):
par1 = 12 ; par2 = -1.4 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = -1.4 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 1 ; 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*2
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)
}
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')