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 computationSun, 20 Dec 2009 16:15:06 -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/21/t1261350969zh0clq488af35c8.htm/, Retrieved Mon, 29 Apr 2024 08:12:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70048, Retrieved Mon, 29 Apr 2024 08:12:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact190
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
-   PD  [ARIMA Forecasting] [workshop 10] [2009-12-10 16:38:29] [28d531aeb5ea2ff1b676cbab66947a19]
- R P       [ARIMA Forecasting] [] [2009-12-20 23:15:06] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
283.042
276.687
277.915
277.128
277.103
275.037
270.150
267.140
264.993
287.259
291.186
292.300
288.186
281.477
282.656
280.190
280.408
276.836
275.216
274.352
271.311
289.802
290.726
292.300
278.506
269.826
265.861
269.034
264.176
255.198
253.353
246.057
235.372
258.556
260.993
254.663
250.643
243.422
247.105
248.541
245.039
237.080
237.085
225.554
226.839
247.934
248.333
246.969
245.098
246.263
255.765
264.319
268.347
273.046
273.963
267.430
271.993
292.710
295.881
293.299




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=70048&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=70048&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70048&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[48])
36254.663-------
37250.643-------
38243.422-------
39247.105-------
40248.541-------
41245.039-------
42237.08-------
43237.085-------
44225.554-------
45226.839-------
46247.934-------
47248.333-------
48246.969-------
49245.098239.3125232.2718246.35320.05360.01658e-040.0165
50246.263231.5557222.522240.58957e-040.00170.0054e-04
51255.765232.0907220.9203243.261100.00640.00420.0045
52264.319232.3231218.523246.123204e-040.01060.0188
53268.347230.1611214.3975245.9247000.03220.0183
54273.046224.5374206.8163242.2585000.08270.0066
55273.963222.4051202.805242.0052000.07110.007
56267.43216.7095195.4491237.9699000.20740.0026
57271.993213.0983190.2385235.9581000.11940.0018
58292.71234.3197209.9523258.687100.00120.13670.1545
59295.881236.279210.5163262.0418000.17960.208
60293.299235.1178208.028262.2076000.19560.1956

\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 & 254.663 & - & - & - & - & - & - & - \tabularnewline
37 & 250.643 & - & - & - & - & - & - & - \tabularnewline
38 & 243.422 & - & - & - & - & - & - & - \tabularnewline
39 & 247.105 & - & - & - & - & - & - & - \tabularnewline
40 & 248.541 & - & - & - & - & - & - & - \tabularnewline
41 & 245.039 & - & - & - & - & - & - & - \tabularnewline
42 & 237.08 & - & - & - & - & - & - & - \tabularnewline
43 & 237.085 & - & - & - & - & - & - & - \tabularnewline
44 & 225.554 & - & - & - & - & - & - & - \tabularnewline
45 & 226.839 & - & - & - & - & - & - & - \tabularnewline
46 & 247.934 & - & - & - & - & - & - & - \tabularnewline
47 & 248.333 & - & - & - & - & - & - & - \tabularnewline
48 & 246.969 & - & - & - & - & - & - & - \tabularnewline
49 & 245.098 & 239.3125 & 232.2718 & 246.3532 & 0.0536 & 0.0165 & 8e-04 & 0.0165 \tabularnewline
50 & 246.263 & 231.5557 & 222.522 & 240.5895 & 7e-04 & 0.0017 & 0.005 & 4e-04 \tabularnewline
51 & 255.765 & 232.0907 & 220.9203 & 243.2611 & 0 & 0.0064 & 0.0042 & 0.0045 \tabularnewline
52 & 264.319 & 232.3231 & 218.523 & 246.1232 & 0 & 4e-04 & 0.0106 & 0.0188 \tabularnewline
53 & 268.347 & 230.1611 & 214.3975 & 245.9247 & 0 & 0 & 0.0322 & 0.0183 \tabularnewline
54 & 273.046 & 224.5374 & 206.8163 & 242.2585 & 0 & 0 & 0.0827 & 0.0066 \tabularnewline
55 & 273.963 & 222.4051 & 202.805 & 242.0052 & 0 & 0 & 0.0711 & 0.007 \tabularnewline
56 & 267.43 & 216.7095 & 195.4491 & 237.9699 & 0 & 0 & 0.2074 & 0.0026 \tabularnewline
57 & 271.993 & 213.0983 & 190.2385 & 235.9581 & 0 & 0 & 0.1194 & 0.0018 \tabularnewline
58 & 292.71 & 234.3197 & 209.9523 & 258.6871 & 0 & 0.0012 & 0.1367 & 0.1545 \tabularnewline
59 & 295.881 & 236.279 & 210.5163 & 262.0418 & 0 & 0 & 0.1796 & 0.208 \tabularnewline
60 & 293.299 & 235.1178 & 208.028 & 262.2076 & 0 & 0 & 0.1956 & 0.1956 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70048&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]254.663[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]250.643[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]243.422[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]247.105[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]248.541[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]245.039[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]237.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]237.085[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]225.554[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]226.839[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]247.934[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]248.333[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]246.969[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]245.098[/C][C]239.3125[/C][C]232.2718[/C][C]246.3532[/C][C]0.0536[/C][C]0.0165[/C][C]8e-04[/C][C]0.0165[/C][/ROW]
[ROW][C]50[/C][C]246.263[/C][C]231.5557[/C][C]222.522[/C][C]240.5895[/C][C]7e-04[/C][C]0.0017[/C][C]0.005[/C][C]4e-04[/C][/ROW]
[ROW][C]51[/C][C]255.765[/C][C]232.0907[/C][C]220.9203[/C][C]243.2611[/C][C]0[/C][C]0.0064[/C][C]0.0042[/C][C]0.0045[/C][/ROW]
[ROW][C]52[/C][C]264.319[/C][C]232.3231[/C][C]218.523[/C][C]246.1232[/C][C]0[/C][C]4e-04[/C][C]0.0106[/C][C]0.0188[/C][/ROW]
[ROW][C]53[/C][C]268.347[/C][C]230.1611[/C][C]214.3975[/C][C]245.9247[/C][C]0[/C][C]0[/C][C]0.0322[/C][C]0.0183[/C][/ROW]
[ROW][C]54[/C][C]273.046[/C][C]224.5374[/C][C]206.8163[/C][C]242.2585[/C][C]0[/C][C]0[/C][C]0.0827[/C][C]0.0066[/C][/ROW]
[ROW][C]55[/C][C]273.963[/C][C]222.4051[/C][C]202.805[/C][C]242.0052[/C][C]0[/C][C]0[/C][C]0.0711[/C][C]0.007[/C][/ROW]
[ROW][C]56[/C][C]267.43[/C][C]216.7095[/C][C]195.4491[/C][C]237.9699[/C][C]0[/C][C]0[/C][C]0.2074[/C][C]0.0026[/C][/ROW]
[ROW][C]57[/C][C]271.993[/C][C]213.0983[/C][C]190.2385[/C][C]235.9581[/C][C]0[/C][C]0[/C][C]0.1194[/C][C]0.0018[/C][/ROW]
[ROW][C]58[/C][C]292.71[/C][C]234.3197[/C][C]209.9523[/C][C]258.6871[/C][C]0[/C][C]0.0012[/C][C]0.1367[/C][C]0.1545[/C][/ROW]
[ROW][C]59[/C][C]295.881[/C][C]236.279[/C][C]210.5163[/C][C]262.0418[/C][C]0[/C][C]0[/C][C]0.1796[/C][C]0.208[/C][/ROW]
[ROW][C]60[/C][C]293.299[/C][C]235.1178[/C][C]208.028[/C][C]262.2076[/C][C]0[/C][C]0[/C][C]0.1956[/C][C]0.1956[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70048&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70048&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])
36254.663-------
37250.643-------
38243.422-------
39247.105-------
40248.541-------
41245.039-------
42237.08-------
43237.085-------
44225.554-------
45226.839-------
46247.934-------
47248.333-------
48246.969-------
49245.098239.3125232.2718246.35320.05360.01658e-040.0165
50246.263231.5557222.522240.58957e-040.00170.0054e-04
51255.765232.0907220.9203243.261100.00640.00420.0045
52264.319232.3231218.523246.123204e-040.01060.0188
53268.347230.1611214.3975245.9247000.03220.0183
54273.046224.5374206.8163242.2585000.08270.0066
55273.963222.4051202.805242.0052000.07110.007
56267.43216.7095195.4491237.9699000.20740.0026
57271.993213.0983190.2385235.9581000.11940.0018
58292.71234.3197209.9523258.687100.00120.13670.1545
59295.881236.279210.5163262.0418000.17960.208
60293.299235.1178208.028262.2076000.19560.1956







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0150.0242033.472300
500.01990.06350.0438216.304124.888111.1753
510.02460.1020.0632560.4717270.082616.4342
520.03030.13770.08191023.7373458.496321.4125
530.03490.16590.09871458.1624658.429525.6599
540.04030.2160.11822353.0806940.871430.6736
550.0450.23180.13452658.21641186.206434.4413
560.05010.2340.14692572.57061359.501936.8714
570.05470.27640.16133468.5861593.844639.923
580.05310.24920.17013409.43251775.403442.1355
590.05560.25230.17753552.39271936.947944.0108
600.05880.24750.18343385.05122057.623145.361

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.015 & 0.0242 & 0 & 33.4723 & 0 & 0 \tabularnewline
50 & 0.0199 & 0.0635 & 0.0438 & 216.304 & 124.8881 & 11.1753 \tabularnewline
51 & 0.0246 & 0.102 & 0.0632 & 560.4717 & 270.0826 & 16.4342 \tabularnewline
52 & 0.0303 & 0.1377 & 0.0819 & 1023.7373 & 458.4963 & 21.4125 \tabularnewline
53 & 0.0349 & 0.1659 & 0.0987 & 1458.1624 & 658.4295 & 25.6599 \tabularnewline
54 & 0.0403 & 0.216 & 0.1182 & 2353.0806 & 940.8714 & 30.6736 \tabularnewline
55 & 0.045 & 0.2318 & 0.1345 & 2658.2164 & 1186.2064 & 34.4413 \tabularnewline
56 & 0.0501 & 0.234 & 0.1469 & 2572.5706 & 1359.5019 & 36.8714 \tabularnewline
57 & 0.0547 & 0.2764 & 0.1613 & 3468.586 & 1593.8446 & 39.923 \tabularnewline
58 & 0.0531 & 0.2492 & 0.1701 & 3409.4325 & 1775.4034 & 42.1355 \tabularnewline
59 & 0.0556 & 0.2523 & 0.1775 & 3552.3927 & 1936.9479 & 44.0108 \tabularnewline
60 & 0.0588 & 0.2475 & 0.1834 & 3385.0512 & 2057.6231 & 45.361 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70048&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.015[/C][C]0.0242[/C][C]0[/C][C]33.4723[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0199[/C][C]0.0635[/C][C]0.0438[/C][C]216.304[/C][C]124.8881[/C][C]11.1753[/C][/ROW]
[ROW][C]51[/C][C]0.0246[/C][C]0.102[/C][C]0.0632[/C][C]560.4717[/C][C]270.0826[/C][C]16.4342[/C][/ROW]
[ROW][C]52[/C][C]0.0303[/C][C]0.1377[/C][C]0.0819[/C][C]1023.7373[/C][C]458.4963[/C][C]21.4125[/C][/ROW]
[ROW][C]53[/C][C]0.0349[/C][C]0.1659[/C][C]0.0987[/C][C]1458.1624[/C][C]658.4295[/C][C]25.6599[/C][/ROW]
[ROW][C]54[/C][C]0.0403[/C][C]0.216[/C][C]0.1182[/C][C]2353.0806[/C][C]940.8714[/C][C]30.6736[/C][/ROW]
[ROW][C]55[/C][C]0.045[/C][C]0.2318[/C][C]0.1345[/C][C]2658.2164[/C][C]1186.2064[/C][C]34.4413[/C][/ROW]
[ROW][C]56[/C][C]0.0501[/C][C]0.234[/C][C]0.1469[/C][C]2572.5706[/C][C]1359.5019[/C][C]36.8714[/C][/ROW]
[ROW][C]57[/C][C]0.0547[/C][C]0.2764[/C][C]0.1613[/C][C]3468.586[/C][C]1593.8446[/C][C]39.923[/C][/ROW]
[ROW][C]58[/C][C]0.0531[/C][C]0.2492[/C][C]0.1701[/C][C]3409.4325[/C][C]1775.4034[/C][C]42.1355[/C][/ROW]
[ROW][C]59[/C][C]0.0556[/C][C]0.2523[/C][C]0.1775[/C][C]3552.3927[/C][C]1936.9479[/C][C]44.0108[/C][/ROW]
[ROW][C]60[/C][C]0.0588[/C][C]0.2475[/C][C]0.1834[/C][C]3385.0512[/C][C]2057.6231[/C][C]45.361[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70048&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70048&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.0150.0242033.472300
500.01990.06350.0438216.304124.888111.1753
510.02460.1020.0632560.4717270.082616.4342
520.03030.13770.08191023.7373458.496321.4125
530.03490.16590.09871458.1624658.429525.6599
540.04030.2160.11822353.0806940.871430.6736
550.0450.23180.13452658.21641186.206434.4413
560.05010.2340.14692572.57061359.501936.8714
570.05470.27640.16133468.5861593.844639.923
580.05310.24920.17013409.43251775.403442.1355
590.05560.25230.17753552.39271936.947944.0108
600.05880.24750.18343385.05122057.623145.361



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