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, 08 Dec 2011 09:14:36 -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/2011/Dec/08/t1323353700e69izcy39okire4.htm/, Retrieved Thu, 23 May 2024 23:01:37 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=152931, Retrieved Thu, 23 May 2024 23:01:37 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact119
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [(Partial) Autocorrelation Function] [Unemployment] [2010-11-29 09:05:21] [b98453cac15ba1066b407e146608df68]
- R  D    [(Partial) Autocorrelation Function] [autocorrelatie ] [2011-12-07 13:35:25] [141ef847e2c5f8e947fe4eabcb0cf143]
-   PD      [(Partial) Autocorrelation Function] [autocorrelatie D=1] [2011-12-07 13:50:51] [141ef847e2c5f8e947fe4eabcb0cf143]
- RMP         [Standard Deviation-Mean Plot] [ST-MP] [2011-12-07 14:22:28] [141ef847e2c5f8e947fe4eabcb0cf143]
- RMP           [ARIMA Backward Selection] [ARIMA backward ] [2011-12-08 13:48:01] [141ef847e2c5f8e947fe4eabcb0cf143]
- RM                [ARIMA Forecasting] [ARIMA forecasting...] [2011-12-08 14:14:36] [1a4698f17d8e7f554418314cf0e4bd67] [Current]
- R P                 [ARIMA Forecasting] [Arima forecasting...] [2011-12-21 11:37:56] [141ef847e2c5f8e947fe4eabcb0cf143]
Feedback Forum

Post a new message
Dataseries X:
114.7
108
101.3
108.4
105.6
120.4
107.6
111.4
122.1
104.8
103.2
112.3
123.1
115.5
106.3
119.9
119.5
120.9
127.5
116.6
126.7
110.6
100.4
125.2
125
105.2
102.7
94.2
97
111.1
102
97.3
109.8
98.9
93.2
115.2
115
107
104.1
106
110.8
127.8
116.9
113.8
131.6
106.1
107.2
127.4
123
121.8
117.6
118.4
121.8
141.9
122.1
132.2
131.6
108.8
120.4
134.7




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152931&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]1 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=152931&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152931&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 time1 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[48])
36115.2-------
37115-------
38107-------
39104.1-------
40106-------
41110.8-------
42127.8-------
43116.9-------
44113.8-------
45131.6-------
46106.1-------
47107.2-------
48127.4-------
49123123.5474109.2331139.73760.47360.32050.84960.3205
50121.8119.9646104.2586138.03650.42110.3710.92010.21
51117.6112.435494.8655133.25940.31340.1890.78360.0795
52118.4115.101292.6223143.03560.40850.43040.73850.1941
53121.8122.170496.4275154.78590.49110.58960.75280.3767
54141.9137.6855105.2994180.03240.42270.76890.67640.683
55122.1127.623594.8272171.76260.40310.26310.6830.504
56132.2124.251490.5328170.52830.36820.53630.6710.447
57131.6142.2754100.9596200.49890.35970.63280.64030.6917
58108.8115.893780.5239166.79950.39240.27270.64690.3289
59120.4116.524879.4364170.92970.44450.60960.63150.3476
60134.7138.226892.2265207.17090.46010.69390.62090.6209

\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[48]) \tabularnewline
36 & 115.2 & - & - & - & - & - & - & - \tabularnewline
37 & 115 & - & - & - & - & - & - & - \tabularnewline
38 & 107 & - & - & - & - & - & - & - \tabularnewline
39 & 104.1 & - & - & - & - & - & - & - \tabularnewline
40 & 106 & - & - & - & - & - & - & - \tabularnewline
41 & 110.8 & - & - & - & - & - & - & - \tabularnewline
42 & 127.8 & - & - & - & - & - & - & - \tabularnewline
43 & 116.9 & - & - & - & - & - & - & - \tabularnewline
44 & 113.8 & - & - & - & - & - & - & - \tabularnewline
45 & 131.6 & - & - & - & - & - & - & - \tabularnewline
46 & 106.1 & - & - & - & - & - & - & - \tabularnewline
47 & 107.2 & - & - & - & - & - & - & - \tabularnewline
48 & 127.4 & - & - & - & - & - & - & - \tabularnewline
49 & 123 & 123.5474 & 109.2331 & 139.7376 & 0.4736 & 0.3205 & 0.8496 & 0.3205 \tabularnewline
50 & 121.8 & 119.9646 & 104.2586 & 138.0365 & 0.4211 & 0.371 & 0.9201 & 0.21 \tabularnewline
51 & 117.6 & 112.4354 & 94.8655 & 133.2594 & 0.3134 & 0.189 & 0.7836 & 0.0795 \tabularnewline
52 & 118.4 & 115.1012 & 92.6223 & 143.0356 & 0.4085 & 0.4304 & 0.7385 & 0.1941 \tabularnewline
53 & 121.8 & 122.1704 & 96.4275 & 154.7859 & 0.4911 & 0.5896 & 0.7528 & 0.3767 \tabularnewline
54 & 141.9 & 137.6855 & 105.2994 & 180.0324 & 0.4227 & 0.7689 & 0.6764 & 0.683 \tabularnewline
55 & 122.1 & 127.6235 & 94.8272 & 171.7626 & 0.4031 & 0.2631 & 0.683 & 0.504 \tabularnewline
56 & 132.2 & 124.2514 & 90.5328 & 170.5283 & 0.3682 & 0.5363 & 0.671 & 0.447 \tabularnewline
57 & 131.6 & 142.2754 & 100.9596 & 200.4989 & 0.3597 & 0.6328 & 0.6403 & 0.6917 \tabularnewline
58 & 108.8 & 115.8937 & 80.5239 & 166.7995 & 0.3924 & 0.2727 & 0.6469 & 0.3289 \tabularnewline
59 & 120.4 & 116.5248 & 79.4364 & 170.9297 & 0.4445 & 0.6096 & 0.6315 & 0.3476 \tabularnewline
60 & 134.7 & 138.2268 & 92.2265 & 207.1709 & 0.4601 & 0.6939 & 0.6209 & 0.6209 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152931&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[48])[/C][/ROW]
[ROW][C]36[/C][C]115.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]107[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]104.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]106[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]110.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]127.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]116.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]113.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]131.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]106.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]107.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]127.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]123[/C][C]123.5474[/C][C]109.2331[/C][C]139.7376[/C][C]0.4736[/C][C]0.3205[/C][C]0.8496[/C][C]0.3205[/C][/ROW]
[ROW][C]50[/C][C]121.8[/C][C]119.9646[/C][C]104.2586[/C][C]138.0365[/C][C]0.4211[/C][C]0.371[/C][C]0.9201[/C][C]0.21[/C][/ROW]
[ROW][C]51[/C][C]117.6[/C][C]112.4354[/C][C]94.8655[/C][C]133.2594[/C][C]0.3134[/C][C]0.189[/C][C]0.7836[/C][C]0.0795[/C][/ROW]
[ROW][C]52[/C][C]118.4[/C][C]115.1012[/C][C]92.6223[/C][C]143.0356[/C][C]0.4085[/C][C]0.4304[/C][C]0.7385[/C][C]0.1941[/C][/ROW]
[ROW][C]53[/C][C]121.8[/C][C]122.1704[/C][C]96.4275[/C][C]154.7859[/C][C]0.4911[/C][C]0.5896[/C][C]0.7528[/C][C]0.3767[/C][/ROW]
[ROW][C]54[/C][C]141.9[/C][C]137.6855[/C][C]105.2994[/C][C]180.0324[/C][C]0.4227[/C][C]0.7689[/C][C]0.6764[/C][C]0.683[/C][/ROW]
[ROW][C]55[/C][C]122.1[/C][C]127.6235[/C][C]94.8272[/C][C]171.7626[/C][C]0.4031[/C][C]0.2631[/C][C]0.683[/C][C]0.504[/C][/ROW]
[ROW][C]56[/C][C]132.2[/C][C]124.2514[/C][C]90.5328[/C][C]170.5283[/C][C]0.3682[/C][C]0.5363[/C][C]0.671[/C][C]0.447[/C][/ROW]
[ROW][C]57[/C][C]131.6[/C][C]142.2754[/C][C]100.9596[/C][C]200.4989[/C][C]0.3597[/C][C]0.6328[/C][C]0.6403[/C][C]0.6917[/C][/ROW]
[ROW][C]58[/C][C]108.8[/C][C]115.8937[/C][C]80.5239[/C][C]166.7995[/C][C]0.3924[/C][C]0.2727[/C][C]0.6469[/C][C]0.3289[/C][/ROW]
[ROW][C]59[/C][C]120.4[/C][C]116.5248[/C][C]79.4364[/C][C]170.9297[/C][C]0.4445[/C][C]0.6096[/C][C]0.6315[/C][C]0.3476[/C][/ROW]
[ROW][C]60[/C][C]134.7[/C][C]138.2268[/C][C]92.2265[/C][C]207.1709[/C][C]0.4601[/C][C]0.6939[/C][C]0.6209[/C][C]0.6209[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=152931&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152931&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[48])
36115.2-------
37115-------
38107-------
39104.1-------
40106-------
41110.8-------
42127.8-------
43116.9-------
44113.8-------
45131.6-------
46106.1-------
47107.2-------
48127.4-------
49123123.5474109.2331139.73760.47360.32050.84960.3205
50121.8119.9646104.2586138.03650.42110.3710.92010.21
51117.6112.435494.8655133.25940.31340.1890.78360.0795
52118.4115.101292.6223143.03560.40850.43040.73850.1941
53121.8122.170496.4275154.78590.49110.58960.75280.3767
54141.9137.6855105.2994180.03240.42270.76890.67640.683
55122.1127.623594.8272171.76260.40310.26310.6830.504
56132.2124.251490.5328170.52830.36820.53630.6710.447
57131.6142.2754100.9596200.49890.35970.63280.64030.6917
58108.8115.893780.5239166.79950.39240.27270.64690.3289
59120.4116.524879.4364170.92970.44450.60960.63150.3476
60134.7138.226892.2265207.17090.46010.69390.62090.6209







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0669-0.004400.299700
500.07690.01530.00993.36891.83431.3544
510.09450.04590.021926.673310.11393.1802
520.12380.02870.023610.882210.3063.2103
530.1362-0.0030.01950.13728.27232.8762
540.15690.03060.021317.76229.85393.1391
550.1765-0.04330.024530.509112.80473.5784
560.190.0640.029463.180319.10164.3705
570.2088-0.0750.0345113.963629.64185.4444
580.2241-0.06120.037150.320131.70975.6311
590.23820.03330.036815.01730.19225.4947
600.2545-0.02550.035912.438328.71275.3584

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0669 & -0.0044 & 0 & 0.2997 & 0 & 0 \tabularnewline
50 & 0.0769 & 0.0153 & 0.0099 & 3.3689 & 1.8343 & 1.3544 \tabularnewline
51 & 0.0945 & 0.0459 & 0.0219 & 26.6733 & 10.1139 & 3.1802 \tabularnewline
52 & 0.1238 & 0.0287 & 0.0236 & 10.8822 & 10.306 & 3.2103 \tabularnewline
53 & 0.1362 & -0.003 & 0.0195 & 0.1372 & 8.2723 & 2.8762 \tabularnewline
54 & 0.1569 & 0.0306 & 0.0213 & 17.7622 & 9.8539 & 3.1391 \tabularnewline
55 & 0.1765 & -0.0433 & 0.0245 & 30.5091 & 12.8047 & 3.5784 \tabularnewline
56 & 0.19 & 0.064 & 0.0294 & 63.1803 & 19.1016 & 4.3705 \tabularnewline
57 & 0.2088 & -0.075 & 0.0345 & 113.9636 & 29.6418 & 5.4444 \tabularnewline
58 & 0.2241 & -0.0612 & 0.0371 & 50.3201 & 31.7097 & 5.6311 \tabularnewline
59 & 0.2382 & 0.0333 & 0.0368 & 15.017 & 30.1922 & 5.4947 \tabularnewline
60 & 0.2545 & -0.0255 & 0.0359 & 12.4383 & 28.7127 & 5.3584 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152931&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]49[/C][C]0.0669[/C][C]-0.0044[/C][C]0[/C][C]0.2997[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0769[/C][C]0.0153[/C][C]0.0099[/C][C]3.3689[/C][C]1.8343[/C][C]1.3544[/C][/ROW]
[ROW][C]51[/C][C]0.0945[/C][C]0.0459[/C][C]0.0219[/C][C]26.6733[/C][C]10.1139[/C][C]3.1802[/C][/ROW]
[ROW][C]52[/C][C]0.1238[/C][C]0.0287[/C][C]0.0236[/C][C]10.8822[/C][C]10.306[/C][C]3.2103[/C][/ROW]
[ROW][C]53[/C][C]0.1362[/C][C]-0.003[/C][C]0.0195[/C][C]0.1372[/C][C]8.2723[/C][C]2.8762[/C][/ROW]
[ROW][C]54[/C][C]0.1569[/C][C]0.0306[/C][C]0.0213[/C][C]17.7622[/C][C]9.8539[/C][C]3.1391[/C][/ROW]
[ROW][C]55[/C][C]0.1765[/C][C]-0.0433[/C][C]0.0245[/C][C]30.5091[/C][C]12.8047[/C][C]3.5784[/C][/ROW]
[ROW][C]56[/C][C]0.19[/C][C]0.064[/C][C]0.0294[/C][C]63.1803[/C][C]19.1016[/C][C]4.3705[/C][/ROW]
[ROW][C]57[/C][C]0.2088[/C][C]-0.075[/C][C]0.0345[/C][C]113.9636[/C][C]29.6418[/C][C]5.4444[/C][/ROW]
[ROW][C]58[/C][C]0.2241[/C][C]-0.0612[/C][C]0.0371[/C][C]50.3201[/C][C]31.7097[/C][C]5.6311[/C][/ROW]
[ROW][C]59[/C][C]0.2382[/C][C]0.0333[/C][C]0.0368[/C][C]15.017[/C][C]30.1922[/C][C]5.4947[/C][/ROW]
[ROW][C]60[/C][C]0.2545[/C][C]-0.0255[/C][C]0.0359[/C][C]12.4383[/C][C]28.7127[/C][C]5.3584[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=152931&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152931&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
490.0669-0.004400.299700
500.07690.01530.00993.36891.83431.3544
510.09450.04590.021926.673310.11393.1802
520.12380.02870.023610.882210.3063.2103
530.1362-0.0030.01950.13728.27232.8762
540.15690.03060.021317.76229.85393.1391
550.1765-0.04330.024530.509112.80473.5784
560.190.0640.029463.180319.10164.3705
570.2088-0.0750.0345113.963629.64185.4444
580.2241-0.06120.037150.320131.70975.6311
590.23820.03330.036815.01730.19225.4947
600.2545-0.02550.035912.438328.71275.3584



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