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, 01 Dec 2013 10:35: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/2013/Dec/01/t1385912243ui7qetuw8queawp.htm/, Retrieved Fri, 26 Apr 2024 13:32:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=229819, Retrieved Fri, 26 Apr 2024 13:32:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact82
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2008-12-14 11:54:22] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMP   [(Partial) Autocorrelation Function] [] [2013-12-01 15:02:13] [2710f8dea95e981897be7c03387b4566]
- R P     [(Partial) Autocorrelation Function] [] [2013-12-01 15:03:29] [2710f8dea95e981897be7c03387b4566]
- RMP         [ARIMA Forecasting] [] [2013-12-01 15:35:36] [05fc9f73518f9509c56332c989d681e3] [Current]
Feedback Forum

Post a new message
Dataseries X:
46
62
66
59
58
61
41
27
58
70
49
59
44
36
72
45
56
54
53
35
61
52
47
51
52
63
74
45
51
64
36
30
55
64
39
40
63
45
59
55
40
64
27
28
45
57
45
69
60
56
58
50
51
53
37
22
55
70
62
58
39
49
58
47
42
62
39
40
72
70
54
65




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gertrude Mary Cox' @ cox.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 & 4 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=229819&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]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=229819&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=229819&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 time4 seconds
R Server'Gertrude Mary Cox' @ cox.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[60])
4869-------
4960-------
5056-------
5158-------
5250-------
5351-------
5453-------
5537-------
5622-------
5755-------
5870-------
5962-------
6058-------
613962.186939.792384.58150.02120.6430.57590.643
624954.050131.603176.4970.32960.90560.43240.3651
635859.332336.782781.88190.45390.81540.54610.5461
644749.065426.47171.65980.42890.21920.46770.2192
654251.653729.037274.27030.20140.65660.52260.2912
666252.542629.915275.170.20630.81940.48420.3182
673937.3214.687359.95270.44220.01630.51110.0367
684021.7761-0.859244.41140.05730.06790.49239e-04
697255.156732.520177.79320.07240.90530.50540.4028
707069.890447.253292.52760.49620.42750.49620.8484
715462.076739.439284.71420.24220.24640.50260.6379
726557.946335.308780.5840.27070.63370.49810.4981

\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[60]) \tabularnewline
48 & 69 & - & - & - & - & - & - & - \tabularnewline
49 & 60 & - & - & - & - & - & - & - \tabularnewline
50 & 56 & - & - & - & - & - & - & - \tabularnewline
51 & 58 & - & - & - & - & - & - & - \tabularnewline
52 & 50 & - & - & - & - & - & - & - \tabularnewline
53 & 51 & - & - & - & - & - & - & - \tabularnewline
54 & 53 & - & - & - & - & - & - & - \tabularnewline
55 & 37 & - & - & - & - & - & - & - \tabularnewline
56 & 22 & - & - & - & - & - & - & - \tabularnewline
57 & 55 & - & - & - & - & - & - & - \tabularnewline
58 & 70 & - & - & - & - & - & - & - \tabularnewline
59 & 62 & - & - & - & - & - & - & - \tabularnewline
60 & 58 & - & - & - & - & - & - & - \tabularnewline
61 & 39 & 62.1869 & 39.7923 & 84.5815 & 0.0212 & 0.643 & 0.5759 & 0.643 \tabularnewline
62 & 49 & 54.0501 & 31.6031 & 76.497 & 0.3296 & 0.9056 & 0.4324 & 0.3651 \tabularnewline
63 & 58 & 59.3323 & 36.7827 & 81.8819 & 0.4539 & 0.8154 & 0.5461 & 0.5461 \tabularnewline
64 & 47 & 49.0654 & 26.471 & 71.6598 & 0.4289 & 0.2192 & 0.4677 & 0.2192 \tabularnewline
65 & 42 & 51.6537 & 29.0372 & 74.2703 & 0.2014 & 0.6566 & 0.5226 & 0.2912 \tabularnewline
66 & 62 & 52.5426 & 29.9152 & 75.17 & 0.2063 & 0.8194 & 0.4842 & 0.3182 \tabularnewline
67 & 39 & 37.32 & 14.6873 & 59.9527 & 0.4422 & 0.0163 & 0.5111 & 0.0367 \tabularnewline
68 & 40 & 21.7761 & -0.8592 & 44.4114 & 0.0573 & 0.0679 & 0.4923 & 9e-04 \tabularnewline
69 & 72 & 55.1567 & 32.5201 & 77.7932 & 0.0724 & 0.9053 & 0.5054 & 0.4028 \tabularnewline
70 & 70 & 69.8904 & 47.2532 & 92.5276 & 0.4962 & 0.4275 & 0.4962 & 0.8484 \tabularnewline
71 & 54 & 62.0767 & 39.4392 & 84.7142 & 0.2422 & 0.2464 & 0.5026 & 0.6379 \tabularnewline
72 & 65 & 57.9463 & 35.3087 & 80.584 & 0.2707 & 0.6337 & 0.4981 & 0.4981 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=229819&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[60])[/C][/ROW]
[ROW][C]48[/C][C]69[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]60[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]56[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]50[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]53[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]55[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]70[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]62[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]39[/C][C]62.1869[/C][C]39.7923[/C][C]84.5815[/C][C]0.0212[/C][C]0.643[/C][C]0.5759[/C][C]0.643[/C][/ROW]
[ROW][C]62[/C][C]49[/C][C]54.0501[/C][C]31.6031[/C][C]76.497[/C][C]0.3296[/C][C]0.9056[/C][C]0.4324[/C][C]0.3651[/C][/ROW]
[ROW][C]63[/C][C]58[/C][C]59.3323[/C][C]36.7827[/C][C]81.8819[/C][C]0.4539[/C][C]0.8154[/C][C]0.5461[/C][C]0.5461[/C][/ROW]
[ROW][C]64[/C][C]47[/C][C]49.0654[/C][C]26.471[/C][C]71.6598[/C][C]0.4289[/C][C]0.2192[/C][C]0.4677[/C][C]0.2192[/C][/ROW]
[ROW][C]65[/C][C]42[/C][C]51.6537[/C][C]29.0372[/C][C]74.2703[/C][C]0.2014[/C][C]0.6566[/C][C]0.5226[/C][C]0.2912[/C][/ROW]
[ROW][C]66[/C][C]62[/C][C]52.5426[/C][C]29.9152[/C][C]75.17[/C][C]0.2063[/C][C]0.8194[/C][C]0.4842[/C][C]0.3182[/C][/ROW]
[ROW][C]67[/C][C]39[/C][C]37.32[/C][C]14.6873[/C][C]59.9527[/C][C]0.4422[/C][C]0.0163[/C][C]0.5111[/C][C]0.0367[/C][/ROW]
[ROW][C]68[/C][C]40[/C][C]21.7761[/C][C]-0.8592[/C][C]44.4114[/C][C]0.0573[/C][C]0.0679[/C][C]0.4923[/C][C]9e-04[/C][/ROW]
[ROW][C]69[/C][C]72[/C][C]55.1567[/C][C]32.5201[/C][C]77.7932[/C][C]0.0724[/C][C]0.9053[/C][C]0.5054[/C][C]0.4028[/C][/ROW]
[ROW][C]70[/C][C]70[/C][C]69.8904[/C][C]47.2532[/C][C]92.5276[/C][C]0.4962[/C][C]0.4275[/C][C]0.4962[/C][C]0.8484[/C][/ROW]
[ROW][C]71[/C][C]54[/C][C]62.0767[/C][C]39.4392[/C][C]84.7142[/C][C]0.2422[/C][C]0.2464[/C][C]0.5026[/C][C]0.6379[/C][/ROW]
[ROW][C]72[/C][C]65[/C][C]57.9463[/C][C]35.3087[/C][C]80.584[/C][C]0.2707[/C][C]0.6337[/C][C]0.4981[/C][C]0.4981[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=229819&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=229819&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[60])
4869-------
4960-------
5056-------
5158-------
5250-------
5351-------
5453-------
5537-------
5622-------
5755-------
5870-------
5962-------
6058-------
613962.186939.792384.58150.02120.6430.57590.643
624954.050131.603176.4970.32960.90560.43240.3651
635859.332336.782781.88190.45390.81540.54610.5461
644749.065426.47171.65980.42890.21920.46770.2192
654251.653729.037274.27030.20140.65660.52260.2912
666252.542629.915275.170.20630.81940.48420.3182
673937.3214.687359.95270.44220.01630.51110.0367
684021.7761-0.859244.41140.05730.06790.49239e-04
697255.156732.520177.79320.07240.90530.50540.4028
707069.890447.253292.52760.49620.42750.49620.8484
715462.076739.439284.71420.24220.24640.50260.6379
726557.946335.308780.5840.27070.63370.49810.4981







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
610.1837-0.59450.59450.4583537.630500-1.82181.8218
620.2119-0.10310.34880.278225.5034281.566916.78-0.39681.1093
630.1939-0.0230.24020.1931.775188.30313.7224-0.10470.7744
640.2349-0.04390.19110.15554.2659142.293711.9287-0.16230.6214
650.2234-0.22990.19890.165693.1944132.473811.5097-0.75850.6488
660.21970.15250.19120.165689.4425125.301911.19380.74310.6645
670.30940.04310.170.14822.8223107.804810.38290.1320.5885
680.53030.45560.20570.2034332.111135.843111.65521.43190.6939
690.20940.23390.20880.2103283.6979152.271412.33981.32340.7638
700.16530.00160.18810.18940.012137.045511.70660.00860.6883
710.1861-0.14960.18460.184865.233130.517111.4244-0.63460.6834
720.19930.10850.17830.17949.7541123.786811.1260.55420.6727

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
61 & 0.1837 & -0.5945 & 0.5945 & 0.4583 & 537.6305 & 0 & 0 & -1.8218 & 1.8218 \tabularnewline
62 & 0.2119 & -0.1031 & 0.3488 & 0.2782 & 25.5034 & 281.5669 & 16.78 & -0.3968 & 1.1093 \tabularnewline
63 & 0.1939 & -0.023 & 0.2402 & 0.193 & 1.775 & 188.303 & 13.7224 & -0.1047 & 0.7744 \tabularnewline
64 & 0.2349 & -0.0439 & 0.1911 & 0.1555 & 4.2659 & 142.2937 & 11.9287 & -0.1623 & 0.6214 \tabularnewline
65 & 0.2234 & -0.2299 & 0.1989 & 0.1656 & 93.1944 & 132.4738 & 11.5097 & -0.7585 & 0.6488 \tabularnewline
66 & 0.2197 & 0.1525 & 0.1912 & 0.1656 & 89.4425 & 125.3019 & 11.1938 & 0.7431 & 0.6645 \tabularnewline
67 & 0.3094 & 0.0431 & 0.17 & 0.1482 & 2.8223 & 107.8048 & 10.3829 & 0.132 & 0.5885 \tabularnewline
68 & 0.5303 & 0.4556 & 0.2057 & 0.2034 & 332.111 & 135.8431 & 11.6552 & 1.4319 & 0.6939 \tabularnewline
69 & 0.2094 & 0.2339 & 0.2088 & 0.2103 & 283.6979 & 152.2714 & 12.3398 & 1.3234 & 0.7638 \tabularnewline
70 & 0.1653 & 0.0016 & 0.1881 & 0.1894 & 0.012 & 137.0455 & 11.7066 & 0.0086 & 0.6883 \tabularnewline
71 & 0.1861 & -0.1496 & 0.1846 & 0.1848 & 65.233 & 130.5171 & 11.4244 & -0.6346 & 0.6834 \tabularnewline
72 & 0.1993 & 0.1085 & 0.1783 & 0.179 & 49.7541 & 123.7868 & 11.126 & 0.5542 & 0.6727 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=229819&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]61[/C][C]0.1837[/C][C]-0.5945[/C][C]0.5945[/C][C]0.4583[/C][C]537.6305[/C][C]0[/C][C]0[/C][C]-1.8218[/C][C]1.8218[/C][/ROW]
[ROW][C]62[/C][C]0.2119[/C][C]-0.1031[/C][C]0.3488[/C][C]0.2782[/C][C]25.5034[/C][C]281.5669[/C][C]16.78[/C][C]-0.3968[/C][C]1.1093[/C][/ROW]
[ROW][C]63[/C][C]0.1939[/C][C]-0.023[/C][C]0.2402[/C][C]0.193[/C][C]1.775[/C][C]188.303[/C][C]13.7224[/C][C]-0.1047[/C][C]0.7744[/C][/ROW]
[ROW][C]64[/C][C]0.2349[/C][C]-0.0439[/C][C]0.1911[/C][C]0.1555[/C][C]4.2659[/C][C]142.2937[/C][C]11.9287[/C][C]-0.1623[/C][C]0.6214[/C][/ROW]
[ROW][C]65[/C][C]0.2234[/C][C]-0.2299[/C][C]0.1989[/C][C]0.1656[/C][C]93.1944[/C][C]132.4738[/C][C]11.5097[/C][C]-0.7585[/C][C]0.6488[/C][/ROW]
[ROW][C]66[/C][C]0.2197[/C][C]0.1525[/C][C]0.1912[/C][C]0.1656[/C][C]89.4425[/C][C]125.3019[/C][C]11.1938[/C][C]0.7431[/C][C]0.6645[/C][/ROW]
[ROW][C]67[/C][C]0.3094[/C][C]0.0431[/C][C]0.17[/C][C]0.1482[/C][C]2.8223[/C][C]107.8048[/C][C]10.3829[/C][C]0.132[/C][C]0.5885[/C][/ROW]
[ROW][C]68[/C][C]0.5303[/C][C]0.4556[/C][C]0.2057[/C][C]0.2034[/C][C]332.111[/C][C]135.8431[/C][C]11.6552[/C][C]1.4319[/C][C]0.6939[/C][/ROW]
[ROW][C]69[/C][C]0.2094[/C][C]0.2339[/C][C]0.2088[/C][C]0.2103[/C][C]283.6979[/C][C]152.2714[/C][C]12.3398[/C][C]1.3234[/C][C]0.7638[/C][/ROW]
[ROW][C]70[/C][C]0.1653[/C][C]0.0016[/C][C]0.1881[/C][C]0.1894[/C][C]0.012[/C][C]137.0455[/C][C]11.7066[/C][C]0.0086[/C][C]0.6883[/C][/ROW]
[ROW][C]71[/C][C]0.1861[/C][C]-0.1496[/C][C]0.1846[/C][C]0.1848[/C][C]65.233[/C][C]130.5171[/C][C]11.4244[/C][C]-0.6346[/C][C]0.6834[/C][/ROW]
[ROW][C]72[/C][C]0.1993[/C][C]0.1085[/C][C]0.1783[/C][C]0.179[/C][C]49.7541[/C][C]123.7868[/C][C]11.126[/C][C]0.5542[/C][C]0.6727[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=229819&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=229819&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
610.1837-0.59450.59450.4583537.630500-1.82181.8218
620.2119-0.10310.34880.278225.5034281.566916.78-0.39681.1093
630.1939-0.0230.24020.1931.775188.30313.7224-0.10470.7744
640.2349-0.04390.19110.15554.2659142.293711.9287-0.16230.6214
650.2234-0.22990.19890.165693.1944132.473811.5097-0.75850.6488
660.21970.15250.19120.165689.4425125.301911.19380.74310.6645
670.30940.04310.170.14822.8223107.804810.38290.1320.5885
680.53030.45560.20570.2034332.111135.843111.65521.43190.6939
690.20940.23390.20880.2103283.6979152.271412.33981.32340.7638
700.16530.00160.18810.18940.012137.045511.70660.00860.6883
710.1861-0.14960.18460.184865.233130.517111.4244-0.63460.6834
720.19930.10850.17830.17949.7541123.786811.1260.55420.6727



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '1'
par8 <- '1'
par7 <- '1'
par6 <- '2'
par5 <- '12'
par4 <- '1'
par3 <- '0'
par2 <- '1'
par1 <- '12'
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.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')