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, 03 Dec 2009 10:32:19 -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/03/t1259861675ooadczestwt6a2b.htm/, Retrieved Sat, 20 Apr 2024 16:03:37 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=62961, Retrieved Sat, 20 Apr 2024 16:03:37 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact150
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   [Exponential Smoothing] [] [2009-11-27 15:04:36] [b98453cac15ba1066b407e146608df68]
- RMPD      [ARIMA Forecasting] [] [2009-12-03 17:32:19] [950726a732ba3ca782ecb1a5307d0f6f] [Current]
-   P         [ARIMA Forecasting] [Forecasting] [2009-12-11 09:35:03] [315ba876df544ad397193b5931d5f354]
Feedback Forum

Post a new message
Dataseries X:
13132.1
17665.9
16913
17318.8
16224.2
15469.6
16557.5
19414.8
17335
16525.2
18160.4
15553.8
15262.2
18581
17564.1
18948.6
17187.8
17564.8
17668.4
20811.7
17257.8
18984.2
20532.6
17082.3
16894.9
20274.9
20078.6
19900.9
17012.2
19642.9
19024
21691
18835.9
19873.4
21468.2
19406.8
18385.3
20739.3
22268.3
21569
17514.8
21124.7
21251
21393
22145.2
20310.5
23466.9
21264.6
18388.1
22635.4
22014.3
18422.7
16120.2
16037.7
16410.7
17749.8
16349.8
15662.3
17782.3
16398.9




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=62961&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])
3619406.8-------
3718385.3-------
3820739.3-------
3922268.3-------
4021569-------
4117514.8-------
4221124.7-------
4321251-------
4421393-------
4522145.2-------
4620310.5-------
4723466.9-------
4821264.6-------
4918388.119500.738818107.382120894.09540.05880.00650.94170.0065
5022635.421981.768320467.366223496.17040.198810.94610.8233
5122014.323629.875722115.324125144.42720.01830.90090.9610.9989
5218422.723063.408221532.659124594.157200.91040.97220.9894
5316120.218955.252217423.464720487.03961e-040.75220.96730.0016
5416037.722537.100621005.483124068.7182010.96470.9483
5516410.722772.793921240.40224305.1858010.97420.9731
5617749.822581.235321048.992724113.4779010.93570.9539
5716349.823708.793822176.731525240.8561010.97730.9991
5815662.321727.984120195.673823260.2944010.96510.7233
5917782.325164.740523632.559126696.9219010.98511
6016398.922655.091221124.966924185.2155010.96260.9626

\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 & 19406.8 & - & - & - & - & - & - & - \tabularnewline
37 & 18385.3 & - & - & - & - & - & - & - \tabularnewline
38 & 20739.3 & - & - & - & - & - & - & - \tabularnewline
39 & 22268.3 & - & - & - & - & - & - & - \tabularnewline
40 & 21569 & - & - & - & - & - & - & - \tabularnewline
41 & 17514.8 & - & - & - & - & - & - & - \tabularnewline
42 & 21124.7 & - & - & - & - & - & - & - \tabularnewline
43 & 21251 & - & - & - & - & - & - & - \tabularnewline
44 & 21393 & - & - & - & - & - & - & - \tabularnewline
45 & 22145.2 & - & - & - & - & - & - & - \tabularnewline
46 & 20310.5 & - & - & - & - & - & - & - \tabularnewline
47 & 23466.9 & - & - & - & - & - & - & - \tabularnewline
48 & 21264.6 & - & - & - & - & - & - & - \tabularnewline
49 & 18388.1 & 19500.7388 & 18107.3821 & 20894.0954 & 0.0588 & 0.0065 & 0.9417 & 0.0065 \tabularnewline
50 & 22635.4 & 21981.7683 & 20467.3662 & 23496.1704 & 0.1988 & 1 & 0.9461 & 0.8233 \tabularnewline
51 & 22014.3 & 23629.8757 & 22115.3241 & 25144.4272 & 0.0183 & 0.9009 & 0.961 & 0.9989 \tabularnewline
52 & 18422.7 & 23063.4082 & 21532.6591 & 24594.1572 & 0 & 0.9104 & 0.9722 & 0.9894 \tabularnewline
53 & 16120.2 & 18955.2522 & 17423.4647 & 20487.0396 & 1e-04 & 0.7522 & 0.9673 & 0.0016 \tabularnewline
54 & 16037.7 & 22537.1006 & 21005.4831 & 24068.7182 & 0 & 1 & 0.9647 & 0.9483 \tabularnewline
55 & 16410.7 & 22772.7939 & 21240.402 & 24305.1858 & 0 & 1 & 0.9742 & 0.9731 \tabularnewline
56 & 17749.8 & 22581.2353 & 21048.9927 & 24113.4779 & 0 & 1 & 0.9357 & 0.9539 \tabularnewline
57 & 16349.8 & 23708.7938 & 22176.7315 & 25240.8561 & 0 & 1 & 0.9773 & 0.9991 \tabularnewline
58 & 15662.3 & 21727.9841 & 20195.6738 & 23260.2944 & 0 & 1 & 0.9651 & 0.7233 \tabularnewline
59 & 17782.3 & 25164.7405 & 23632.5591 & 26696.9219 & 0 & 1 & 0.9851 & 1 \tabularnewline
60 & 16398.9 & 22655.0912 & 21124.9669 & 24185.2155 & 0 & 1 & 0.9626 & 0.9626 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=62961&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]19406.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]18385.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]20739.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]22268.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]21569[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]17514.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]21124.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]21251[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]21393[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]22145.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]20310.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]23466.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]21264.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]18388.1[/C][C]19500.7388[/C][C]18107.3821[/C][C]20894.0954[/C][C]0.0588[/C][C]0.0065[/C][C]0.9417[/C][C]0.0065[/C][/ROW]
[ROW][C]50[/C][C]22635.4[/C][C]21981.7683[/C][C]20467.3662[/C][C]23496.1704[/C][C]0.1988[/C][C]1[/C][C]0.9461[/C][C]0.8233[/C][/ROW]
[ROW][C]51[/C][C]22014.3[/C][C]23629.8757[/C][C]22115.3241[/C][C]25144.4272[/C][C]0.0183[/C][C]0.9009[/C][C]0.961[/C][C]0.9989[/C][/ROW]
[ROW][C]52[/C][C]18422.7[/C][C]23063.4082[/C][C]21532.6591[/C][C]24594.1572[/C][C]0[/C][C]0.9104[/C][C]0.9722[/C][C]0.9894[/C][/ROW]
[ROW][C]53[/C][C]16120.2[/C][C]18955.2522[/C][C]17423.4647[/C][C]20487.0396[/C][C]1e-04[/C][C]0.7522[/C][C]0.9673[/C][C]0.0016[/C][/ROW]
[ROW][C]54[/C][C]16037.7[/C][C]22537.1006[/C][C]21005.4831[/C][C]24068.7182[/C][C]0[/C][C]1[/C][C]0.9647[/C][C]0.9483[/C][/ROW]
[ROW][C]55[/C][C]16410.7[/C][C]22772.7939[/C][C]21240.402[/C][C]24305.1858[/C][C]0[/C][C]1[/C][C]0.9742[/C][C]0.9731[/C][/ROW]
[ROW][C]56[/C][C]17749.8[/C][C]22581.2353[/C][C]21048.9927[/C][C]24113.4779[/C][C]0[/C][C]1[/C][C]0.9357[/C][C]0.9539[/C][/ROW]
[ROW][C]57[/C][C]16349.8[/C][C]23708.7938[/C][C]22176.7315[/C][C]25240.8561[/C][C]0[/C][C]1[/C][C]0.9773[/C][C]0.9991[/C][/ROW]
[ROW][C]58[/C][C]15662.3[/C][C]21727.9841[/C][C]20195.6738[/C][C]23260.2944[/C][C]0[/C][C]1[/C][C]0.9651[/C][C]0.7233[/C][/ROW]
[ROW][C]59[/C][C]17782.3[/C][C]25164.7405[/C][C]23632.5591[/C][C]26696.9219[/C][C]0[/C][C]1[/C][C]0.9851[/C][C]1[/C][/ROW]
[ROW][C]60[/C][C]16398.9[/C][C]22655.0912[/C][C]21124.9669[/C][C]24185.2155[/C][C]0[/C][C]1[/C][C]0.9626[/C][C]0.9626[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=62961&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=62961&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])
3619406.8-------
3718385.3-------
3820739.3-------
3922268.3-------
4021569-------
4117514.8-------
4221124.7-------
4321251-------
4421393-------
4522145.2-------
4620310.5-------
4723466.9-------
4821264.6-------
4918388.119500.738818107.382120894.09540.05880.00650.94170.0065
5022635.421981.768320467.366223496.17040.198810.94610.8233
5122014.323629.875722115.324125144.42720.01830.90090.9610.9989
5218422.723063.408221532.659124594.157200.91040.97220.9894
5316120.218955.252217423.464720487.03961e-040.75220.96730.0016
5416037.722537.100621005.483124068.7182010.96470.9483
5516410.722772.793921240.40224305.1858010.97420.9731
5617749.822581.235321048.992724113.4779010.93570.9539
5716349.823708.793822176.731525240.8561010.97730.9991
5815662.321727.984120195.673823260.2944010.96510.7233
5917782.325164.740523632.559126696.9219010.98511
6016398.922655.091221124.966924185.2155010.96260.9626







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0365-0.05710.00481237965.0772103163.7564321.1912
500.03510.02970.0025427234.378335602.8649188.6872
510.0327-0.06840.00572610084.7733217507.0644466.3765
520.0339-0.20120.016821536172.20151794681.01681339.6571
530.0412-0.14960.01258037520.7554669793.3963818.4091
540.0347-0.28840.02442242208.3843520184.0321876.2153
550.0343-0.27940.023340476238.67353373019.88951836.5783
560.0346-0.2140.017823342767.09481945230.59121394.7152
570.033-0.31040.025954154790.0844512899.17372124.3585
580.036-0.27920.023336792523.76663066043.64721751.0122
590.0311-0.29340.024454500428.06934541702.33912131.127
600.0345-0.27610.02339139928.36123261660.69681806.0068

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0365 & -0.0571 & 0.0048 & 1237965.0772 & 103163.7564 & 321.1912 \tabularnewline
50 & 0.0351 & 0.0297 & 0.0025 & 427234.3783 & 35602.8649 & 188.6872 \tabularnewline
51 & 0.0327 & -0.0684 & 0.0057 & 2610084.7733 & 217507.0644 & 466.3765 \tabularnewline
52 & 0.0339 & -0.2012 & 0.0168 & 21536172.2015 & 1794681.0168 & 1339.6571 \tabularnewline
53 & 0.0412 & -0.1496 & 0.0125 & 8037520.7554 & 669793.3963 & 818.4091 \tabularnewline
54 & 0.0347 & -0.2884 & 0.024 & 42242208.384 & 3520184.032 & 1876.2153 \tabularnewline
55 & 0.0343 & -0.2794 & 0.0233 & 40476238.6735 & 3373019.8895 & 1836.5783 \tabularnewline
56 & 0.0346 & -0.214 & 0.0178 & 23342767.0948 & 1945230.5912 & 1394.7152 \tabularnewline
57 & 0.033 & -0.3104 & 0.0259 & 54154790.084 & 4512899.1737 & 2124.3585 \tabularnewline
58 & 0.036 & -0.2792 & 0.0233 & 36792523.7666 & 3066043.6472 & 1751.0122 \tabularnewline
59 & 0.0311 & -0.2934 & 0.0244 & 54500428.0693 & 4541702.3391 & 2131.127 \tabularnewline
60 & 0.0345 & -0.2761 & 0.023 & 39139928.3612 & 3261660.6968 & 1806.0068 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=62961&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.0365[/C][C]-0.0571[/C][C]0.0048[/C][C]1237965.0772[/C][C]103163.7564[/C][C]321.1912[/C][/ROW]
[ROW][C]50[/C][C]0.0351[/C][C]0.0297[/C][C]0.0025[/C][C]427234.3783[/C][C]35602.8649[/C][C]188.6872[/C][/ROW]
[ROW][C]51[/C][C]0.0327[/C][C]-0.0684[/C][C]0.0057[/C][C]2610084.7733[/C][C]217507.0644[/C][C]466.3765[/C][/ROW]
[ROW][C]52[/C][C]0.0339[/C][C]-0.2012[/C][C]0.0168[/C][C]21536172.2015[/C][C]1794681.0168[/C][C]1339.6571[/C][/ROW]
[ROW][C]53[/C][C]0.0412[/C][C]-0.1496[/C][C]0.0125[/C][C]8037520.7554[/C][C]669793.3963[/C][C]818.4091[/C][/ROW]
[ROW][C]54[/C][C]0.0347[/C][C]-0.2884[/C][C]0.024[/C][C]42242208.384[/C][C]3520184.032[/C][C]1876.2153[/C][/ROW]
[ROW][C]55[/C][C]0.0343[/C][C]-0.2794[/C][C]0.0233[/C][C]40476238.6735[/C][C]3373019.8895[/C][C]1836.5783[/C][/ROW]
[ROW][C]56[/C][C]0.0346[/C][C]-0.214[/C][C]0.0178[/C][C]23342767.0948[/C][C]1945230.5912[/C][C]1394.7152[/C][/ROW]
[ROW][C]57[/C][C]0.033[/C][C]-0.3104[/C][C]0.0259[/C][C]54154790.084[/C][C]4512899.1737[/C][C]2124.3585[/C][/ROW]
[ROW][C]58[/C][C]0.036[/C][C]-0.2792[/C][C]0.0233[/C][C]36792523.7666[/C][C]3066043.6472[/C][C]1751.0122[/C][/ROW]
[ROW][C]59[/C][C]0.0311[/C][C]-0.2934[/C][C]0.0244[/C][C]54500428.0693[/C][C]4541702.3391[/C][C]2131.127[/C][/ROW]
[ROW][C]60[/C][C]0.0345[/C][C]-0.2761[/C][C]0.023[/C][C]39139928.3612[/C][C]3261660.6968[/C][C]1806.0068[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=62961&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=62961&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.0365-0.05710.00481237965.0772103163.7564321.1912
500.03510.02970.0025427234.378335602.8649188.6872
510.0327-0.06840.00572610084.7733217507.0644466.3765
520.0339-0.20120.016821536172.20151794681.01681339.6571
530.0412-0.14960.01258037520.7554669793.3963818.4091
540.0347-0.28840.02442242208.3843520184.0321876.2153
550.0343-0.27940.023340476238.67353373019.88951836.5783
560.0346-0.2140.017823342767.09481945230.59121394.7152
570.033-0.31040.025954154790.0844512899.17372124.3585
580.036-0.27920.023336792523.76663066043.64721751.0122
590.0311-0.29340.024454500428.06934541702.33912131.127
600.0345-0.27610.02339139928.36123261660.69681806.0068



Parameters (Session):
par1 = 12 ; par2 = Single ; par3 = additive ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; 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
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.mape <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')