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 computationThu, 10 Dec 2009 06:48:42 -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/2009/Dec/10/t1260452992gspcsxbr7b3xr5c.htm/, Retrieved Tue, 16 Apr 2024 13:28:50 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65390, Retrieved Tue, 16 Apr 2024 13:28:50 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact154
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [Totaal levensmidd...] [2009-11-29 09:56:44] [757146c69eaf0537be37c7b0c18216d8]
- RMPD    [ARIMA Forecasting] [forecast paper] [2009-12-10 13:48:42] [a931a0a30926b49d162330b43e89b999] [Current]
-   P       [ARIMA Forecasting] [forecast ] [2009-12-21 15:10:38] [03c44f58d7d4de05d4cfabfda8c46d2c]
-   P       [ARIMA Forecasting] [arima forecast] [2009-12-21 15:37:32] [12f02da0296cb21dc23d82ae014a8b71]
Feedback Forum

Post a new message
Dataseries X:
108.5
112.3
116.6
115.5
120.1
132.9
128.1
129.3
132.5
131
124.9
120.8
122
122.1
127.4
135.2
137.3
135
136
138.4
134.7
138.4
133.9
133.6
141.2
151.8
155.4
156.6
161.6
160.7
156
159.5
168.7
169.9
169.9
185.9
190.8
195.8
211.9
227.1
251.3
256.7
251.9
251.2
270.3
267.2
243
229.9
187.2
178.2
175.2
192.4
187
184
194.1
212.7
217.5
200.5
205.9
196.5
206.3




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

\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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65390&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65390&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65390&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'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[49])
37190.8-------
38195.8-------
39211.9-------
40227.1-------
41251.3-------
42256.7-------
43251.9-------
44251.2-------
45270.3-------
46267.2-------
47243-------
48229.9-------
49187.2-------
50178.2174.7684159.1565193.77620.36170.09990.01510.0999
51175.2170.4338146.5146203.68660.38940.32360.00730.1615
52192.4168.8301138.7071215.66630.1620.39490.00740.221
53187168.2239133.1789228.2990.27010.21510.00340.2679
54184167.9929128.893241.14440.3340.30530.00870.3034
55194.1167.9046125.37254.12060.27570.35720.02810.3305
56212.7167.8708122.3624267.27390.18840.30250.05020.3516
57217.5167.8579119.7287280.69160.19430.2180.03760.3684
58200.5167.8529117.3809294.47070.30670.22110.0620.3823
59205.9167.851115.2601308.70860.29820.32480.14790.3939
60196.5167.8503113.3247323.50130.35910.31590.21730.4037
61206.3167.85111.5439338.94590.32980.37140.41230.4123

\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[49]) \tabularnewline
37 & 190.8 & - & - & - & - & - & - & - \tabularnewline
38 & 195.8 & - & - & - & - & - & - & - \tabularnewline
39 & 211.9 & - & - & - & - & - & - & - \tabularnewline
40 & 227.1 & - & - & - & - & - & - & - \tabularnewline
41 & 251.3 & - & - & - & - & - & - & - \tabularnewline
42 & 256.7 & - & - & - & - & - & - & - \tabularnewline
43 & 251.9 & - & - & - & - & - & - & - \tabularnewline
44 & 251.2 & - & - & - & - & - & - & - \tabularnewline
45 & 270.3 & - & - & - & - & - & - & - \tabularnewline
46 & 267.2 & - & - & - & - & - & - & - \tabularnewline
47 & 243 & - & - & - & - & - & - & - \tabularnewline
48 & 229.9 & - & - & - & - & - & - & - \tabularnewline
49 & 187.2 & - & - & - & - & - & - & - \tabularnewline
50 & 178.2 & 174.7684 & 159.1565 & 193.7762 & 0.3617 & 0.0999 & 0.0151 & 0.0999 \tabularnewline
51 & 175.2 & 170.4338 & 146.5146 & 203.6866 & 0.3894 & 0.3236 & 0.0073 & 0.1615 \tabularnewline
52 & 192.4 & 168.8301 & 138.7071 & 215.6663 & 0.162 & 0.3949 & 0.0074 & 0.221 \tabularnewline
53 & 187 & 168.2239 & 133.1789 & 228.299 & 0.2701 & 0.2151 & 0.0034 & 0.2679 \tabularnewline
54 & 184 & 167.9929 & 128.893 & 241.1444 & 0.334 & 0.3053 & 0.0087 & 0.3034 \tabularnewline
55 & 194.1 & 167.9046 & 125.37 & 254.1206 & 0.2757 & 0.3572 & 0.0281 & 0.3305 \tabularnewline
56 & 212.7 & 167.8708 & 122.3624 & 267.2739 & 0.1884 & 0.3025 & 0.0502 & 0.3516 \tabularnewline
57 & 217.5 & 167.8579 & 119.7287 & 280.6916 & 0.1943 & 0.218 & 0.0376 & 0.3684 \tabularnewline
58 & 200.5 & 167.8529 & 117.3809 & 294.4707 & 0.3067 & 0.2211 & 0.062 & 0.3823 \tabularnewline
59 & 205.9 & 167.851 & 115.2601 & 308.7086 & 0.2982 & 0.3248 & 0.1479 & 0.3939 \tabularnewline
60 & 196.5 & 167.8503 & 113.3247 & 323.5013 & 0.3591 & 0.3159 & 0.2173 & 0.4037 \tabularnewline
61 & 206.3 & 167.85 & 111.5439 & 338.9459 & 0.3298 & 0.3714 & 0.4123 & 0.4123 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65390&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[49])[/C][/ROW]
[ROW][C]37[/C][C]190.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]195.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]211.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]227.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]251.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]256.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]251.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]251.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]270.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]267.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]243[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]229.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]187.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]178.2[/C][C]174.7684[/C][C]159.1565[/C][C]193.7762[/C][C]0.3617[/C][C]0.0999[/C][C]0.0151[/C][C]0.0999[/C][/ROW]
[ROW][C]51[/C][C]175.2[/C][C]170.4338[/C][C]146.5146[/C][C]203.6866[/C][C]0.3894[/C][C]0.3236[/C][C]0.0073[/C][C]0.1615[/C][/ROW]
[ROW][C]52[/C][C]192.4[/C][C]168.8301[/C][C]138.7071[/C][C]215.6663[/C][C]0.162[/C][C]0.3949[/C][C]0.0074[/C][C]0.221[/C][/ROW]
[ROW][C]53[/C][C]187[/C][C]168.2239[/C][C]133.1789[/C][C]228.299[/C][C]0.2701[/C][C]0.2151[/C][C]0.0034[/C][C]0.2679[/C][/ROW]
[ROW][C]54[/C][C]184[/C][C]167.9929[/C][C]128.893[/C][C]241.1444[/C][C]0.334[/C][C]0.3053[/C][C]0.0087[/C][C]0.3034[/C][/ROW]
[ROW][C]55[/C][C]194.1[/C][C]167.9046[/C][C]125.37[/C][C]254.1206[/C][C]0.2757[/C][C]0.3572[/C][C]0.0281[/C][C]0.3305[/C][/ROW]
[ROW][C]56[/C][C]212.7[/C][C]167.8708[/C][C]122.3624[/C][C]267.2739[/C][C]0.1884[/C][C]0.3025[/C][C]0.0502[/C][C]0.3516[/C][/ROW]
[ROW][C]57[/C][C]217.5[/C][C]167.8579[/C][C]119.7287[/C][C]280.6916[/C][C]0.1943[/C][C]0.218[/C][C]0.0376[/C][C]0.3684[/C][/ROW]
[ROW][C]58[/C][C]200.5[/C][C]167.8529[/C][C]117.3809[/C][C]294.4707[/C][C]0.3067[/C][C]0.2211[/C][C]0.062[/C][C]0.3823[/C][/ROW]
[ROW][C]59[/C][C]205.9[/C][C]167.851[/C][C]115.2601[/C][C]308.7086[/C][C]0.2982[/C][C]0.3248[/C][C]0.1479[/C][C]0.3939[/C][/ROW]
[ROW][C]60[/C][C]196.5[/C][C]167.8503[/C][C]113.3247[/C][C]323.5013[/C][C]0.3591[/C][C]0.3159[/C][C]0.2173[/C][C]0.4037[/C][/ROW]
[ROW][C]61[/C][C]206.3[/C][C]167.85[/C][C]111.5439[/C][C]338.9459[/C][C]0.3298[/C][C]0.3714[/C][C]0.4123[/C][C]0.4123[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65390&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65390&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[49])
37190.8-------
38195.8-------
39211.9-------
40227.1-------
41251.3-------
42256.7-------
43251.9-------
44251.2-------
45270.3-------
46267.2-------
47243-------
48229.9-------
49187.2-------
50178.2174.7684159.1565193.77620.36170.09990.01510.0999
51175.2170.4338146.5146203.68660.38940.32360.00730.1615
52192.4168.8301138.7071215.66630.1620.39490.00740.221
53187168.2239133.1789228.2990.27010.21510.00340.2679
54184167.9929128.893241.14440.3340.30530.00870.3034
55194.1167.9046125.37254.12060.27570.35720.02810.3305
56212.7167.8708122.3624267.27390.18840.30250.05020.3516
57217.5167.8579119.7287280.69160.19430.2180.03760.3684
58200.5167.8529117.3809294.47070.30670.22110.0620.3823
59205.9167.851115.2601308.70860.29820.32480.14790.3939
60196.5167.8503113.3247323.50130.35910.31590.21730.4037
61206.3167.85111.5439338.94590.32980.37140.41230.4123







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.05550.0196011.775900
510.09950.0280.023822.716917.24644.1529
520.14150.13960.0624555.5397196.677514.0242
530.18220.11160.0747352.5418235.643615.3507
540.22220.09530.0788256.2276239.760415.4842
550.2620.1560.0917686.1998314.16717.7248
560.30210.2670.11672009.6582556.3823.5877
570.3430.29570.13912464.343794.875428.1935
580.38490.19450.14531065.8334824.981828.7225
590.42820.22670.15341447.7266887.256329.7868
600.47310.17070.155820.807881.215529.6853
610.52010.22910.16121478.4031930.981130.512

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0555 & 0.0196 & 0 & 11.7759 & 0 & 0 \tabularnewline
51 & 0.0995 & 0.028 & 0.0238 & 22.7169 & 17.2464 & 4.1529 \tabularnewline
52 & 0.1415 & 0.1396 & 0.0624 & 555.5397 & 196.6775 & 14.0242 \tabularnewline
53 & 0.1822 & 0.1116 & 0.0747 & 352.5418 & 235.6436 & 15.3507 \tabularnewline
54 & 0.2222 & 0.0953 & 0.0788 & 256.2276 & 239.7604 & 15.4842 \tabularnewline
55 & 0.262 & 0.156 & 0.0917 & 686.1998 & 314.167 & 17.7248 \tabularnewline
56 & 0.3021 & 0.267 & 0.1167 & 2009.6582 & 556.38 & 23.5877 \tabularnewline
57 & 0.343 & 0.2957 & 0.1391 & 2464.343 & 794.8754 & 28.1935 \tabularnewline
58 & 0.3849 & 0.1945 & 0.1453 & 1065.8334 & 824.9818 & 28.7225 \tabularnewline
59 & 0.4282 & 0.2267 & 0.1534 & 1447.7266 & 887.2563 & 29.7868 \tabularnewline
60 & 0.4731 & 0.1707 & 0.155 & 820.807 & 881.2155 & 29.6853 \tabularnewline
61 & 0.5201 & 0.2291 & 0.1612 & 1478.4031 & 930.9811 & 30.512 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65390&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]50[/C][C]0.0555[/C][C]0.0196[/C][C]0[/C][C]11.7759[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0995[/C][C]0.028[/C][C]0.0238[/C][C]22.7169[/C][C]17.2464[/C][C]4.1529[/C][/ROW]
[ROW][C]52[/C][C]0.1415[/C][C]0.1396[/C][C]0.0624[/C][C]555.5397[/C][C]196.6775[/C][C]14.0242[/C][/ROW]
[ROW][C]53[/C][C]0.1822[/C][C]0.1116[/C][C]0.0747[/C][C]352.5418[/C][C]235.6436[/C][C]15.3507[/C][/ROW]
[ROW][C]54[/C][C]0.2222[/C][C]0.0953[/C][C]0.0788[/C][C]256.2276[/C][C]239.7604[/C][C]15.4842[/C][/ROW]
[ROW][C]55[/C][C]0.262[/C][C]0.156[/C][C]0.0917[/C][C]686.1998[/C][C]314.167[/C][C]17.7248[/C][/ROW]
[ROW][C]56[/C][C]0.3021[/C][C]0.267[/C][C]0.1167[/C][C]2009.6582[/C][C]556.38[/C][C]23.5877[/C][/ROW]
[ROW][C]57[/C][C]0.343[/C][C]0.2957[/C][C]0.1391[/C][C]2464.343[/C][C]794.8754[/C][C]28.1935[/C][/ROW]
[ROW][C]58[/C][C]0.3849[/C][C]0.1945[/C][C]0.1453[/C][C]1065.8334[/C][C]824.9818[/C][C]28.7225[/C][/ROW]
[ROW][C]59[/C][C]0.4282[/C][C]0.2267[/C][C]0.1534[/C][C]1447.7266[/C][C]887.2563[/C][C]29.7868[/C][/ROW]
[ROW][C]60[/C][C]0.4731[/C][C]0.1707[/C][C]0.155[/C][C]820.807[/C][C]881.2155[/C][C]29.6853[/C][/ROW]
[ROW][C]61[/C][C]0.5201[/C][C]0.2291[/C][C]0.1612[/C][C]1478.4031[/C][C]930.9811[/C][C]30.512[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65390&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65390&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
500.05550.0196011.775900
510.09950.0280.023822.716917.24644.1529
520.14150.13960.0624555.5397196.677514.0242
530.18220.11160.0747352.5418235.643615.3507
540.22220.09530.0788256.2276239.760415.4842
550.2620.1560.0917686.1998314.16717.7248
560.30210.2670.11672009.6582556.3823.5877
570.3430.29570.13912464.343794.875428.1935
580.38490.19450.14531065.8334824.981828.7225
590.42820.22670.15341447.7266887.256329.7868
600.47310.17070.155820.807881.215529.6853
610.52010.22910.16121478.4031930.981130.512



Parameters (Session):
par1 = 1 ; par2 = 1 ; par3 = 1 ; par4 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = -1.0 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 1 ; 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')