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:05:16 +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/t1293044585h7vwmhte78j89l6.htm/, Retrieved Mon, 06 May 2024 00:27:04 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114499, Retrieved Mon, 06 May 2024 00:27:04 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact170
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] [5fd8c857995b7937a45335fd5ccccdde] [Current]
-   P                             [ARIMA Forecasting] [] [2010-12-22 19:15:24] [9b13650c94c5192ca5135ec8a1fa39f7]
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 time3 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 & 3 seconds \tabularnewline
R Server & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114499&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]3 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=114499&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114499&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 time3 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-------
851453812002.89898076.255615929.54220.10294e-040.59744e-04
862756129815.902825751.879633879.9260.138410.98241
872598527158.4422807.066631509.81340.29860.42810.91650.9999
883467030792.736826369.107535216.3660.04290.98340.90861
893206627549.2523058.991732039.50830.02439e-040.72280.9999
902718623219.877518699.43427740.32090.04271e-040.87950.9742
912958624418.431719875.111728961.75170.01290.11630.7630.9929
922135918863.539414306.056223421.02260.141600.47180.5229
932155317362.515712792.997221932.03420.03610.04320.56670.2788
941957319487.354414908.583424066.12550.48540.18830.40720.6271
952425622109.475617519.293326699.65790.17970.86060.43630.9255
962238017619.368513021.034622217.70240.02120.00230.3180.318

\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 & 12002.8989 & 8076.2556 & 15929.5422 & 0.1029 & 4e-04 & 0.5974 & 4e-04 \tabularnewline
86 & 27561 & 29815.9028 & 25751.8796 & 33879.926 & 0.1384 & 1 & 0.9824 & 1 \tabularnewline
87 & 25985 & 27158.44 & 22807.0666 & 31509.8134 & 0.2986 & 0.4281 & 0.9165 & 0.9999 \tabularnewline
88 & 34670 & 30792.7368 & 26369.1075 & 35216.366 & 0.0429 & 0.9834 & 0.9086 & 1 \tabularnewline
89 & 32066 & 27549.25 & 23058.9917 & 32039.5083 & 0.0243 & 9e-04 & 0.7228 & 0.9999 \tabularnewline
90 & 27186 & 23219.8775 & 18699.434 & 27740.3209 & 0.0427 & 1e-04 & 0.8795 & 0.9742 \tabularnewline
91 & 29586 & 24418.4317 & 19875.1117 & 28961.7517 & 0.0129 & 0.1163 & 0.763 & 0.9929 \tabularnewline
92 & 21359 & 18863.5394 & 14306.0562 & 23421.0226 & 0.1416 & 0 & 0.4718 & 0.5229 \tabularnewline
93 & 21553 & 17362.5157 & 12792.9972 & 21932.0342 & 0.0361 & 0.0432 & 0.5667 & 0.2788 \tabularnewline
94 & 19573 & 19487.3544 & 14908.5834 & 24066.1255 & 0.4854 & 0.1883 & 0.4072 & 0.6271 \tabularnewline
95 & 24256 & 22109.4756 & 17519.2933 & 26699.6579 & 0.1797 & 0.8606 & 0.4363 & 0.9255 \tabularnewline
96 & 22380 & 17619.3685 & 13021.0346 & 22217.7024 & 0.0212 & 0.0023 & 0.318 & 0.318 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114499&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]12002.8989[/C][C]8076.2556[/C][C]15929.5422[/C][C]0.1029[/C][C]4e-04[/C][C]0.5974[/C][C]4e-04[/C][/ROW]
[ROW][C]86[/C][C]27561[/C][C]29815.9028[/C][C]25751.8796[/C][C]33879.926[/C][C]0.1384[/C][C]1[/C][C]0.9824[/C][C]1[/C][/ROW]
[ROW][C]87[/C][C]25985[/C][C]27158.44[/C][C]22807.0666[/C][C]31509.8134[/C][C]0.2986[/C][C]0.4281[/C][C]0.9165[/C][C]0.9999[/C][/ROW]
[ROW][C]88[/C][C]34670[/C][C]30792.7368[/C][C]26369.1075[/C][C]35216.366[/C][C]0.0429[/C][C]0.9834[/C][C]0.9086[/C][C]1[/C][/ROW]
[ROW][C]89[/C][C]32066[/C][C]27549.25[/C][C]23058.9917[/C][C]32039.5083[/C][C]0.0243[/C][C]9e-04[/C][C]0.7228[/C][C]0.9999[/C][/ROW]
[ROW][C]90[/C][C]27186[/C][C]23219.8775[/C][C]18699.434[/C][C]27740.3209[/C][C]0.0427[/C][C]1e-04[/C][C]0.8795[/C][C]0.9742[/C][/ROW]
[ROW][C]91[/C][C]29586[/C][C]24418.4317[/C][C]19875.1117[/C][C]28961.7517[/C][C]0.0129[/C][C]0.1163[/C][C]0.763[/C][C]0.9929[/C][/ROW]
[ROW][C]92[/C][C]21359[/C][C]18863.5394[/C][C]14306.0562[/C][C]23421.0226[/C][C]0.1416[/C][C]0[/C][C]0.4718[/C][C]0.5229[/C][/ROW]
[ROW][C]93[/C][C]21553[/C][C]17362.5157[/C][C]12792.9972[/C][C]21932.0342[/C][C]0.0361[/C][C]0.0432[/C][C]0.5667[/C][C]0.2788[/C][/ROW]
[ROW][C]94[/C][C]19573[/C][C]19487.3544[/C][C]14908.5834[/C][C]24066.1255[/C][C]0.4854[/C][C]0.1883[/C][C]0.4072[/C][C]0.6271[/C][/ROW]
[ROW][C]95[/C][C]24256[/C][C]22109.4756[/C][C]17519.2933[/C][C]26699.6579[/C][C]0.1797[/C][C]0.8606[/C][C]0.4363[/C][C]0.9255[/C][/ROW]
[ROW][C]96[/C][C]22380[/C][C]17619.3685[/C][C]13021.0346[/C][C]22217.7024[/C][C]0.0212[/C][C]0.0023[/C][C]0.318[/C][C]0.318[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114499&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114499&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-------
851453812002.89898076.255615929.54220.10294e-040.59744e-04
862756129815.902825751.879633879.9260.138410.98241
872598527158.4422807.066631509.81340.29860.42810.91650.9999
883467030792.736826369.107535216.3660.04290.98340.90861
893206627549.2523058.991732039.50830.02439e-040.72280.9999
902718623219.877518699.43427740.32090.04271e-040.87950.9742
912958624418.431719875.111728961.75170.01290.11630.7630.9929
922135918863.539414306.056223421.02260.141600.47180.5229
932155317362.515712792.997221932.03420.03610.04320.56670.2788
941957319487.354414908.583424066.12550.48540.18830.40720.6271
952425622109.475617519.293326699.65790.17970.86060.43630.9255
962238017619.368513021.034622217.70240.02120.00230.3180.318







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
850.16690.211206426737.585900
860.0695-0.07560.14345084586.64235755662.11412399.0961
870.0817-0.04320.111376961.39724296095.20852072.7024
880.07330.12590.11415033170.26636980363.97292642.0378
890.08320.1640.12420401030.53129664497.28463108.7775
900.09930.17080.131815730128.05910675435.7473267.3285
910.09490.21160.143226703762.169912965196.66453600.7217
920.12330.13230.14186227323.633612122962.53573481.8045
930.13430.24140.152917560158.698812727095.44273567.5055
940.11990.00440.1387335.167911455119.41523384.5412
950.10590.09710.13434607566.828410832614.63463291.2938
960.13320.27020.145622663612.436611818531.11813437.8091

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
85 & 0.1669 & 0.2112 & 0 & 6426737.5859 & 0 & 0 \tabularnewline
86 & 0.0695 & -0.0756 & 0.1434 & 5084586.6423 & 5755662.1141 & 2399.0961 \tabularnewline
87 & 0.0817 & -0.0432 & 0.11 & 1376961.3972 & 4296095.2085 & 2072.7024 \tabularnewline
88 & 0.0733 & 0.1259 & 0.114 & 15033170.2663 & 6980363.9729 & 2642.0378 \tabularnewline
89 & 0.0832 & 0.164 & 0.124 & 20401030.5312 & 9664497.2846 & 3108.7775 \tabularnewline
90 & 0.0993 & 0.1708 & 0.1318 & 15730128.059 & 10675435.747 & 3267.3285 \tabularnewline
91 & 0.0949 & 0.2116 & 0.1432 & 26703762.1699 & 12965196.6645 & 3600.7217 \tabularnewline
92 & 0.1233 & 0.1323 & 0.1418 & 6227323.6336 & 12122962.5357 & 3481.8045 \tabularnewline
93 & 0.1343 & 0.2414 & 0.1529 & 17560158.6988 & 12727095.4427 & 3567.5055 \tabularnewline
94 & 0.1199 & 0.0044 & 0.138 & 7335.1679 & 11455119.4152 & 3384.5412 \tabularnewline
95 & 0.1059 & 0.0971 & 0.1343 & 4607566.8284 & 10832614.6346 & 3291.2938 \tabularnewline
96 & 0.1332 & 0.2702 & 0.1456 & 22663612.4366 & 11818531.1181 & 3437.8091 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114499&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.1669[/C][C]0.2112[/C][C]0[/C][C]6426737.5859[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]86[/C][C]0.0695[/C][C]-0.0756[/C][C]0.1434[/C][C]5084586.6423[/C][C]5755662.1141[/C][C]2399.0961[/C][/ROW]
[ROW][C]87[/C][C]0.0817[/C][C]-0.0432[/C][C]0.11[/C][C]1376961.3972[/C][C]4296095.2085[/C][C]2072.7024[/C][/ROW]
[ROW][C]88[/C][C]0.0733[/C][C]0.1259[/C][C]0.114[/C][C]15033170.2663[/C][C]6980363.9729[/C][C]2642.0378[/C][/ROW]
[ROW][C]89[/C][C]0.0832[/C][C]0.164[/C][C]0.124[/C][C]20401030.5312[/C][C]9664497.2846[/C][C]3108.7775[/C][/ROW]
[ROW][C]90[/C][C]0.0993[/C][C]0.1708[/C][C]0.1318[/C][C]15730128.059[/C][C]10675435.747[/C][C]3267.3285[/C][/ROW]
[ROW][C]91[/C][C]0.0949[/C][C]0.2116[/C][C]0.1432[/C][C]26703762.1699[/C][C]12965196.6645[/C][C]3600.7217[/C][/ROW]
[ROW][C]92[/C][C]0.1233[/C][C]0.1323[/C][C]0.1418[/C][C]6227323.6336[/C][C]12122962.5357[/C][C]3481.8045[/C][/ROW]
[ROW][C]93[/C][C]0.1343[/C][C]0.2414[/C][C]0.1529[/C][C]17560158.6988[/C][C]12727095.4427[/C][C]3567.5055[/C][/ROW]
[ROW][C]94[/C][C]0.1199[/C][C]0.0044[/C][C]0.138[/C][C]7335.1679[/C][C]11455119.4152[/C][C]3384.5412[/C][/ROW]
[ROW][C]95[/C][C]0.1059[/C][C]0.0971[/C][C]0.1343[/C][C]4607566.8284[/C][C]10832614.6346[/C][C]3291.2938[/C][/ROW]
[ROW][C]96[/C][C]0.1332[/C][C]0.2702[/C][C]0.1456[/C][C]22663612.4366[/C][C]11818531.1181[/C][C]3437.8091[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114499&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114499&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.16690.211206426737.585900
860.0695-0.07560.14345084586.64235755662.11412399.0961
870.0817-0.04320.111376961.39724296095.20852072.7024
880.07330.12590.11415033170.26636980363.97292642.0378
890.08320.1640.12420401030.53129664497.28463108.7775
900.09930.17080.131815730128.05910675435.7473267.3285
910.09490.21160.143226703762.169912965196.66453600.7217
920.12330.13230.14186227323.633612122962.53573481.8045
930.13430.24140.152917560158.698812727095.44273567.5055
940.11990.00440.1387335.167911455119.41523384.5412
950.10590.09710.13434607566.828410832614.63463291.2938
960.13320.27020.145622663612.436611818531.11813437.8091



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