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 computationWed, 22 Dec 2010 19:15:24 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/22/t129304518679w1kwcyktau9h7.htm/, Retrieved Mon, 06 May 2024 05:51:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114512, Retrieved Mon, 06 May 2024 05:51:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact167
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2008-12-08 19:22:39] [d2d412c7f4d35ffbf5ee5ee89db327d4]
F RMP   [(Partial) Autocorrelation Function] [WS 9] [2010-12-07 20:24:41] [9b13650c94c5192ca5135ec8a1fa39f7]
-    D    [(Partial) Autocorrelation Function] [ACF Paper] [2010-12-19 13:35:17] [9b13650c94c5192ca5135ec8a1fa39f7]
-   P       [(Partial) Autocorrelation Function] [] [2010-12-21 10:32:09] [9b13650c94c5192ca5135ec8a1fa39f7]
-             [(Partial) Autocorrelation Function] [] [2010-12-21 10:39:04] [9b13650c94c5192ca5135ec8a1fa39f7]
-   P           [(Partial) Autocorrelation Function] [] [2010-12-21 10:40:43] [9b13650c94c5192ca5135ec8a1fa39f7]
-   P             [(Partial) Autocorrelation Function] [] [2010-12-21 10:50:06] [9b13650c94c5192ca5135ec8a1fa39f7]
- RMP               [Spectral Analysis] [] [2010-12-21 11:01:31] [9b13650c94c5192ca5135ec8a1fa39f7]
-   P                 [Spectral Analysis] [] [2010-12-21 11:12:16] [9b13650c94c5192ca5135ec8a1fa39f7]
-   P                   [Spectral Analysis] [] [2010-12-21 11:21:27] [9b13650c94c5192ca5135ec8a1fa39f7]
- RMP                     [Variance Reduction Matrix] [] [2010-12-21 11:45:42] [9b13650c94c5192ca5135ec8a1fa39f7]
- RM                        [ARIMA Backward Selection] [] [2010-12-21 12:35:49] [9b13650c94c5192ca5135ec8a1fa39f7]
- RMP                         [ARIMA Forecasting] [] [2010-12-22 19:05:16] [9b13650c94c5192ca5135ec8a1fa39f7]
-   P                             [ARIMA Forecasting] [] [2010-12-22 19:15:24] [5fd8c857995b7937a45335fd5ccccdde] [Current]
Feedback Forum

Post a new message
Dataseries X:
11514
31514
27071
29462
26105
22397
23843
21705
18089
20764
25316
17704
15548
28029
29383
36438
32034
22679
24319
18004
17537
20366
22782
19169
13807
29743
25591
29096
26482
22405
27044
17970
18730
19684
19785
18479
10698
31956
29506
34506
27165
26736
23691
18157
17328
18205
20995
17382
9367
31124
26551
30651
25859
25100
25778
20418
18688
20424
24776
19814
12738
31566
30111
30019
31934
25826
26835
20205
17789
20520
22518
15572
11509
25447
24090
27786
26195
20516
22759
19028
16971
20036
22485
18730
14538
27561
25985
34670
32066
27186
29586
21359
21553
19573
24256
22380




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114512&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]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114512&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114512&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'RServer@AstonUniversity' @ vre.aston.ac.uk







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[84])
7215572-------
7311509-------
7425447-------
7524090-------
7627786-------
7726195-------
7820516-------
7922759-------
8019028-------
8116971-------
8220036-------
8322485-------
8418730-------
851453812149.1868023.170416275.20170.12829e-040.61959e-04
862756130005.271825641.891334368.65230.136110.97971
872598527547.824522810.46132285.1880.25890.49780.92370.9999
883467031215.687326155.840636275.53410.09040.97860.9081
893206628046.093722679.564233412.62330.0710.00780.75050.9997
902718623744.027518087.95529400.10.11650.0020.86830.9589
912958624974.01919042.439230905.59880.06380.23240.76790.9805
922135919433.750213238.917425628.58290.27127e-040.55110.5881
932155317954.410911507.055624401.76610.1370.15030.61750.4068
941957320078.64713388.340526768.95350.44110.33290.5050.6536
952425622741.733815816.716829666.75090.33410.81510.5290.8719
962238018212.676811062.50525362.84860.12670.04880.44360.4436

\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[84]) \tabularnewline
72 & 15572 & - & - & - & - & - & - & - \tabularnewline
73 & 11509 & - & - & - & - & - & - & - \tabularnewline
74 & 25447 & - & - & - & - & - & - & - \tabularnewline
75 & 24090 & - & - & - & - & - & - & - \tabularnewline
76 & 27786 & - & - & - & - & - & - & - \tabularnewline
77 & 26195 & - & - & - & - & - & - & - \tabularnewline
78 & 20516 & - & - & - & - & - & - & - \tabularnewline
79 & 22759 & - & - & - & - & - & - & - \tabularnewline
80 & 19028 & - & - & - & - & - & - & - \tabularnewline
81 & 16971 & - & - & - & - & - & - & - \tabularnewline
82 & 20036 & - & - & - & - & - & - & - \tabularnewline
83 & 22485 & - & - & - & - & - & - & - \tabularnewline
84 & 18730 & - & - & - & - & - & - & - \tabularnewline
85 & 14538 & 12149.186 & 8023.1704 & 16275.2017 & 0.1282 & 9e-04 & 0.6195 & 9e-04 \tabularnewline
86 & 27561 & 30005.2718 & 25641.8913 & 34368.6523 & 0.1361 & 1 & 0.9797 & 1 \tabularnewline
87 & 25985 & 27547.8245 & 22810.461 & 32285.188 & 0.2589 & 0.4978 & 0.9237 & 0.9999 \tabularnewline
88 & 34670 & 31215.6873 & 26155.8406 & 36275.5341 & 0.0904 & 0.9786 & 0.908 & 1 \tabularnewline
89 & 32066 & 28046.0937 & 22679.5642 & 33412.6233 & 0.071 & 0.0078 & 0.7505 & 0.9997 \tabularnewline
90 & 27186 & 23744.0275 & 18087.955 & 29400.1 & 0.1165 & 0.002 & 0.8683 & 0.9589 \tabularnewline
91 & 29586 & 24974.019 & 19042.4392 & 30905.5988 & 0.0638 & 0.2324 & 0.7679 & 0.9805 \tabularnewline
92 & 21359 & 19433.7502 & 13238.9174 & 25628.5829 & 0.2712 & 7e-04 & 0.5511 & 0.5881 \tabularnewline
93 & 21553 & 17954.4109 & 11507.0556 & 24401.7661 & 0.137 & 0.1503 & 0.6175 & 0.4068 \tabularnewline
94 & 19573 & 20078.647 & 13388.3405 & 26768.9535 & 0.4411 & 0.3329 & 0.505 & 0.6536 \tabularnewline
95 & 24256 & 22741.7338 & 15816.7168 & 29666.7509 & 0.3341 & 0.8151 & 0.529 & 0.8719 \tabularnewline
96 & 22380 & 18212.6768 & 11062.505 & 25362.8486 & 0.1267 & 0.0488 & 0.4436 & 0.4436 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114512&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[84])[/C][/ROW]
[ROW][C]72[/C][C]15572[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]11509[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]25447[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]24090[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]27786[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]26195[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]20516[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]22759[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]19028[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]16971[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]20036[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]22485[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]18730[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]14538[/C][C]12149.186[/C][C]8023.1704[/C][C]16275.2017[/C][C]0.1282[/C][C]9e-04[/C][C]0.6195[/C][C]9e-04[/C][/ROW]
[ROW][C]86[/C][C]27561[/C][C]30005.2718[/C][C]25641.8913[/C][C]34368.6523[/C][C]0.1361[/C][C]1[/C][C]0.9797[/C][C]1[/C][/ROW]
[ROW][C]87[/C][C]25985[/C][C]27547.8245[/C][C]22810.461[/C][C]32285.188[/C][C]0.2589[/C][C]0.4978[/C][C]0.9237[/C][C]0.9999[/C][/ROW]
[ROW][C]88[/C][C]34670[/C][C]31215.6873[/C][C]26155.8406[/C][C]36275.5341[/C][C]0.0904[/C][C]0.9786[/C][C]0.908[/C][C]1[/C][/ROW]
[ROW][C]89[/C][C]32066[/C][C]28046.0937[/C][C]22679.5642[/C][C]33412.6233[/C][C]0.071[/C][C]0.0078[/C][C]0.7505[/C][C]0.9997[/C][/ROW]
[ROW][C]90[/C][C]27186[/C][C]23744.0275[/C][C]18087.955[/C][C]29400.1[/C][C]0.1165[/C][C]0.002[/C][C]0.8683[/C][C]0.9589[/C][/ROW]
[ROW][C]91[/C][C]29586[/C][C]24974.019[/C][C]19042.4392[/C][C]30905.5988[/C][C]0.0638[/C][C]0.2324[/C][C]0.7679[/C][C]0.9805[/C][/ROW]
[ROW][C]92[/C][C]21359[/C][C]19433.7502[/C][C]13238.9174[/C][C]25628.5829[/C][C]0.2712[/C][C]7e-04[/C][C]0.5511[/C][C]0.5881[/C][/ROW]
[ROW][C]93[/C][C]21553[/C][C]17954.4109[/C][C]11507.0556[/C][C]24401.7661[/C][C]0.137[/C][C]0.1503[/C][C]0.6175[/C][C]0.4068[/C][/ROW]
[ROW][C]94[/C][C]19573[/C][C]20078.647[/C][C]13388.3405[/C][C]26768.9535[/C][C]0.4411[/C][C]0.3329[/C][C]0.505[/C][C]0.6536[/C][/ROW]
[ROW][C]95[/C][C]24256[/C][C]22741.7338[/C][C]15816.7168[/C][C]29666.7509[/C][C]0.3341[/C][C]0.8151[/C][C]0.529[/C][C]0.8719[/C][/ROW]
[ROW][C]96[/C][C]22380[/C][C]18212.6768[/C][C]11062.505[/C][C]25362.8486[/C][C]0.1267[/C][C]0.0488[/C][C]0.4436[/C][C]0.4436[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114512&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114512&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[84])
7215572-------
7311509-------
7425447-------
7524090-------
7627786-------
7726195-------
7820516-------
7922759-------
8019028-------
8116971-------
8220036-------
8322485-------
8418730-------
851453812149.1868023.170416275.20170.12829e-040.61959e-04
862756130005.271825641.891334368.65230.136110.97971
872598527547.824522810.46132285.1880.25890.49780.92370.9999
883467031215.687326155.840636275.53410.09040.97860.9081
893206628046.093722679.564233412.62330.0710.00780.75050.9997
902718623744.027518087.95529400.10.11650.0020.86830.9589
912958624974.01919042.439230905.59880.06380.23240.76790.9805
922135919433.750213238.917425628.58290.27127e-040.55110.5881
932155317954.410911507.055624401.76610.1370.15030.61750.4068
941957320078.64713388.340526768.95350.44110.33290.5050.6536
952425622741.733815816.716829666.75090.33410.81510.5290.8719
962238018212.676811062.50525362.84860.12670.04880.44360.4436







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
850.17330.196605706432.226500
860.0742-0.08150.1395974464.65955840448.4432416.702
870.0877-0.05670.11162442420.41964707772.43522169.7402
880.08270.11070.111411932275.916513898.30392552.234
890.09760.14330.117816159646.27268443047.89762905.6923
900.12150.1450.122311847174.6629010402.35843001.7332
910.12120.18470.131221270369.031510761826.16883280.5222
920.16260.09910.12723706586.88279879921.2583143.2342
930.18320.20040.135312949843.854710221023.76883197.0336
940.17-0.02520.1243255678.88869224489.28083037.1844
950.15540.06660.11912293001.9838594354.07192931.6129
960.20030.22880.128217366582.98639325373.14813053.7474

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
85 & 0.1733 & 0.1966 & 0 & 5706432.2265 & 0 & 0 \tabularnewline
86 & 0.0742 & -0.0815 & 0.139 & 5974464.6595 & 5840448.443 & 2416.702 \tabularnewline
87 & 0.0877 & -0.0567 & 0.1116 & 2442420.4196 & 4707772.4352 & 2169.7402 \tabularnewline
88 & 0.0827 & 0.1107 & 0.1114 & 11932275.91 & 6513898.3039 & 2552.234 \tabularnewline
89 & 0.0976 & 0.1433 & 0.1178 & 16159646.2726 & 8443047.8976 & 2905.6923 \tabularnewline
90 & 0.1215 & 0.145 & 0.1223 & 11847174.662 & 9010402.3584 & 3001.7332 \tabularnewline
91 & 0.1212 & 0.1847 & 0.1312 & 21270369.0315 & 10761826.1688 & 3280.5222 \tabularnewline
92 & 0.1626 & 0.0991 & 0.1272 & 3706586.8827 & 9879921.258 & 3143.2342 \tabularnewline
93 & 0.1832 & 0.2004 & 0.1353 & 12949843.8547 & 10221023.7688 & 3197.0336 \tabularnewline
94 & 0.17 & -0.0252 & 0.1243 & 255678.8886 & 9224489.2808 & 3037.1844 \tabularnewline
95 & 0.1554 & 0.0666 & 0.1191 & 2293001.983 & 8594354.0719 & 2931.6129 \tabularnewline
96 & 0.2003 & 0.2288 & 0.1282 & 17366582.9863 & 9325373.1481 & 3053.7474 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114512&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]85[/C][C]0.1733[/C][C]0.1966[/C][C]0[/C][C]5706432.2265[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]86[/C][C]0.0742[/C][C]-0.0815[/C][C]0.139[/C][C]5974464.6595[/C][C]5840448.443[/C][C]2416.702[/C][/ROW]
[ROW][C]87[/C][C]0.0877[/C][C]-0.0567[/C][C]0.1116[/C][C]2442420.4196[/C][C]4707772.4352[/C][C]2169.7402[/C][/ROW]
[ROW][C]88[/C][C]0.0827[/C][C]0.1107[/C][C]0.1114[/C][C]11932275.91[/C][C]6513898.3039[/C][C]2552.234[/C][/ROW]
[ROW][C]89[/C][C]0.0976[/C][C]0.1433[/C][C]0.1178[/C][C]16159646.2726[/C][C]8443047.8976[/C][C]2905.6923[/C][/ROW]
[ROW][C]90[/C][C]0.1215[/C][C]0.145[/C][C]0.1223[/C][C]11847174.662[/C][C]9010402.3584[/C][C]3001.7332[/C][/ROW]
[ROW][C]91[/C][C]0.1212[/C][C]0.1847[/C][C]0.1312[/C][C]21270369.0315[/C][C]10761826.1688[/C][C]3280.5222[/C][/ROW]
[ROW][C]92[/C][C]0.1626[/C][C]0.0991[/C][C]0.1272[/C][C]3706586.8827[/C][C]9879921.258[/C][C]3143.2342[/C][/ROW]
[ROW][C]93[/C][C]0.1832[/C][C]0.2004[/C][C]0.1353[/C][C]12949843.8547[/C][C]10221023.7688[/C][C]3197.0336[/C][/ROW]
[ROW][C]94[/C][C]0.17[/C][C]-0.0252[/C][C]0.1243[/C][C]255678.8886[/C][C]9224489.2808[/C][C]3037.1844[/C][/ROW]
[ROW][C]95[/C][C]0.1554[/C][C]0.0666[/C][C]0.1191[/C][C]2293001.983[/C][C]8594354.0719[/C][C]2931.6129[/C][/ROW]
[ROW][C]96[/C][C]0.2003[/C][C]0.2288[/C][C]0.1282[/C][C]17366582.9863[/C][C]9325373.1481[/C][C]3053.7474[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114512&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114512&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
850.17330.196605706432.226500
860.0742-0.08150.1395974464.65955840448.4432416.702
870.0877-0.05670.11162442420.41964707772.43522169.7402
880.08270.11070.111411932275.916513898.30392552.234
890.09760.14330.117816159646.27268443047.89762905.6923
900.12150.1450.122311847174.6629010402.35843001.7332
910.12120.18470.131221270369.031510761826.16883280.5222
920.16260.09910.12723706586.88279879921.2583143.2342
930.18320.20040.135312949843.854710221023.76883197.0336
940.17-0.02520.1243255678.88869224489.28083037.1844
950.15540.06660.11912293001.9838594354.07192931.6129
960.20030.22880.128217366582.98639325373.14813053.7474



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