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 computationMon, 22 Dec 2008 04:06:00 -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/2008/Dec/22/t12299441088v9qk8s73y2jr4d.htm/, Retrieved Mon, 13 May 2024 19:53:44 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=35997, Retrieved Mon, 13 May 2024 19:53:44 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact153
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [ARIMA Forecasting] [Stefan Temmerman] [2008-12-11 19:16:09] [4c0c0466a42d9212e91e81695c3ab4a9]
-         [ARIMA Forecasting] [] [2008-12-22 11:06:00] [75a00449045803b2332dacf227dc78d5] [Current]
Feedback Forum

Post a new message
Dataseries X:
13139,7
14532,2
15167
16071,1
14827,5
15082
14772,7
16083
14272,5
15223,3
14897,3
13062,6
12603,8
13629,8
14421,1
13978,3
12927,9
13429,9
13470,1
14785,8
14292
14308,8
14013
13240,9
12153,4
14289,7
15669,2
14169,5
14569,8
14469,1
14264,9
15320,9
14433,5
13691,5
14194,1
13519,2
11857,9
14616
15643,4
14077,2
14887,5
14159,9
14643
17192,5
15386,1
14287,1
17526,6
14497
14398,3
16629,6
16670,7
16614,8
16869,2
15663,9
16359,9
18447,7
16889
16505
18320,9
15052,1
15699,8
18135,3
16768,7
18883
19021
18101,9
17776,1
21489,9
17065,3
18690
18953,1
16398,9
16895,7
18553
19270
19422,1
17579,4
18637,3
18076,7
20438,6
18075,2
19563
19899,2
19227,5
17789,6
19220,8
21968,9
21131,5
19484,6
22404,1
21099
22486,5
23707,5
21897,5
23326,4
23765,4
20444




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35997&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[85])
7316895.7-------
7418553-------
7519270-------
7619422.1-------
7717579.4-------
7818637.3-------
7918076.7-------
8020438.6-------
8118075.2-------
8219563-------
8319899.2-------
8419227.5-------
8517789.6-------
8619220.820546.672918689.47122717.81180.11570.99360.96410.9936
8721968.922998.44620640.852725818.45450.23710.99570.99520.9999
8821131.521153.335118822.605323982.71670.4940.2860.88480.9901
8919484.620144.447617588.132723351.69770.34340.27320.94150.9249
9022404.120764.090417958.451524343.13110.18460.75830.87790.9483
912109920446.647517471.559124323.89810.37080.16120.88450.9104
9222486.523191.768719341.412128433.48580.3960.7830.84840.9783
9323707.521127.301217648.238125849.69050.14210.28630.89740.917
9421897.521232.041117532.582226359.86950.39960.1720.73820.9059
9523326.422666.011618418.679428729.52280.41550.59810.81440.9425
9623765.420497.9916721.405725851.11620.11580.15020.67910.8393
972044418881.680515416.132323786.15060.26620.02550.66870.6687

\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[85]) \tabularnewline
73 & 16895.7 & - & - & - & - & - & - & - \tabularnewline
74 & 18553 & - & - & - & - & - & - & - \tabularnewline
75 & 19270 & - & - & - & - & - & - & - \tabularnewline
76 & 19422.1 & - & - & - & - & - & - & - \tabularnewline
77 & 17579.4 & - & - & - & - & - & - & - \tabularnewline
78 & 18637.3 & - & - & - & - & - & - & - \tabularnewline
79 & 18076.7 & - & - & - & - & - & - & - \tabularnewline
80 & 20438.6 & - & - & - & - & - & - & - \tabularnewline
81 & 18075.2 & - & - & - & - & - & - & - \tabularnewline
82 & 19563 & - & - & - & - & - & - & - \tabularnewline
83 & 19899.2 & - & - & - & - & - & - & - \tabularnewline
84 & 19227.5 & - & - & - & - & - & - & - \tabularnewline
85 & 17789.6 & - & - & - & - & - & - & - \tabularnewline
86 & 19220.8 & 20546.6729 & 18689.471 & 22717.8118 & 0.1157 & 0.9936 & 0.9641 & 0.9936 \tabularnewline
87 & 21968.9 & 22998.446 & 20640.8527 & 25818.4545 & 0.2371 & 0.9957 & 0.9952 & 0.9999 \tabularnewline
88 & 21131.5 & 21153.3351 & 18822.6053 & 23982.7167 & 0.494 & 0.286 & 0.8848 & 0.9901 \tabularnewline
89 & 19484.6 & 20144.4476 & 17588.1327 & 23351.6977 & 0.3434 & 0.2732 & 0.9415 & 0.9249 \tabularnewline
90 & 22404.1 & 20764.0904 & 17958.4515 & 24343.1311 & 0.1846 & 0.7583 & 0.8779 & 0.9483 \tabularnewline
91 & 21099 & 20446.6475 & 17471.5591 & 24323.8981 & 0.3708 & 0.1612 & 0.8845 & 0.9104 \tabularnewline
92 & 22486.5 & 23191.7687 & 19341.4121 & 28433.4858 & 0.396 & 0.783 & 0.8484 & 0.9783 \tabularnewline
93 & 23707.5 & 21127.3012 & 17648.2381 & 25849.6905 & 0.1421 & 0.2863 & 0.8974 & 0.917 \tabularnewline
94 & 21897.5 & 21232.0411 & 17532.5822 & 26359.8695 & 0.3996 & 0.172 & 0.7382 & 0.9059 \tabularnewline
95 & 23326.4 & 22666.0116 & 18418.6794 & 28729.5228 & 0.4155 & 0.5981 & 0.8144 & 0.9425 \tabularnewline
96 & 23765.4 & 20497.99 & 16721.4057 & 25851.1162 & 0.1158 & 0.1502 & 0.6791 & 0.8393 \tabularnewline
97 & 20444 & 18881.6805 & 15416.1323 & 23786.1506 & 0.2662 & 0.0255 & 0.6687 & 0.6687 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=35997&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[85])[/C][/ROW]
[ROW][C]73[/C][C]16895.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]18553[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]19270[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]19422.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]17579.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]18637.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]18076.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]20438.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]18075.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]19563[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]19899.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]19227.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]17789.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]19220.8[/C][C]20546.6729[/C][C]18689.471[/C][C]22717.8118[/C][C]0.1157[/C][C]0.9936[/C][C]0.9641[/C][C]0.9936[/C][/ROW]
[ROW][C]87[/C][C]21968.9[/C][C]22998.446[/C][C]20640.8527[/C][C]25818.4545[/C][C]0.2371[/C][C]0.9957[/C][C]0.9952[/C][C]0.9999[/C][/ROW]
[ROW][C]88[/C][C]21131.5[/C][C]21153.3351[/C][C]18822.6053[/C][C]23982.7167[/C][C]0.494[/C][C]0.286[/C][C]0.8848[/C][C]0.9901[/C][/ROW]
[ROW][C]89[/C][C]19484.6[/C][C]20144.4476[/C][C]17588.1327[/C][C]23351.6977[/C][C]0.3434[/C][C]0.2732[/C][C]0.9415[/C][C]0.9249[/C][/ROW]
[ROW][C]90[/C][C]22404.1[/C][C]20764.0904[/C][C]17958.4515[/C][C]24343.1311[/C][C]0.1846[/C][C]0.7583[/C][C]0.8779[/C][C]0.9483[/C][/ROW]
[ROW][C]91[/C][C]21099[/C][C]20446.6475[/C][C]17471.5591[/C][C]24323.8981[/C][C]0.3708[/C][C]0.1612[/C][C]0.8845[/C][C]0.9104[/C][/ROW]
[ROW][C]92[/C][C]22486.5[/C][C]23191.7687[/C][C]19341.4121[/C][C]28433.4858[/C][C]0.396[/C][C]0.783[/C][C]0.8484[/C][C]0.9783[/C][/ROW]
[ROW][C]93[/C][C]23707.5[/C][C]21127.3012[/C][C]17648.2381[/C][C]25849.6905[/C][C]0.1421[/C][C]0.2863[/C][C]0.8974[/C][C]0.917[/C][/ROW]
[ROW][C]94[/C][C]21897.5[/C][C]21232.0411[/C][C]17532.5822[/C][C]26359.8695[/C][C]0.3996[/C][C]0.172[/C][C]0.7382[/C][C]0.9059[/C][/ROW]
[ROW][C]95[/C][C]23326.4[/C][C]22666.0116[/C][C]18418.6794[/C][C]28729.5228[/C][C]0.4155[/C][C]0.5981[/C][C]0.8144[/C][C]0.9425[/C][/ROW]
[ROW][C]96[/C][C]23765.4[/C][C]20497.99[/C][C]16721.4057[/C][C]25851.1162[/C][C]0.1158[/C][C]0.1502[/C][C]0.6791[/C][C]0.8393[/C][/ROW]
[ROW][C]97[/C][C]20444[/C][C]18881.6805[/C][C]15416.1323[/C][C]23786.1506[/C][C]0.2662[/C][C]0.0255[/C][C]0.6687[/C][C]0.6687[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=35997&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35997&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[85])
7316895.7-------
7418553-------
7519270-------
7619422.1-------
7717579.4-------
7818637.3-------
7918076.7-------
8020438.6-------
8118075.2-------
8219563-------
8319899.2-------
8419227.5-------
8517789.6-------
8619220.820546.672918689.47122717.81180.11570.99360.96410.9936
8721968.922998.44620640.852725818.45450.23710.99570.99520.9999
8821131.521153.335118822.605323982.71670.4940.2860.88480.9901
8919484.620144.447617588.132723351.69770.34340.27320.94150.9249
9022404.120764.090417958.451524343.13110.18460.75830.87790.9483
912109920446.647517471.559124323.89810.37080.16120.88450.9104
9222486.523191.768719341.412128433.48580.3960.7830.84840.9783
9323707.521127.301217648.238125849.69050.14210.28630.89740.917
9421897.521232.041117532.582226359.86950.39960.1720.73820.9059
9523326.422666.011618418.679428729.52280.41550.59810.81440.9425
9623765.420497.9916721.405725851.11620.11580.15020.67910.8393
972044418881.680515416.132323786.15060.26620.02550.66870.6687







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
860.0539-0.06450.00541757938.829146494.9024382.7465
870.0626-0.04480.00371059964.930688330.4109297.2043
880.0682-0.0011e-04476.77239.7316.3033
890.0812-0.03280.0027435398.840636283.2367190.4816
900.08790.0790.00662689631.363224135.9469473.43
910.09670.03190.0027425563.793935463.6495188.3179
920.1153-0.03040.0025497403.994841450.3329203.5935
930.1140.12210.01026657425.8939554785.4912744.8392
940.12320.03130.0026442835.602936902.9669192.1014
950.13650.02910.0024436112.774436342.7312190.6377
960.13320.15940.013310675967.9866889663.9989943.22
970.13250.08270.00692440842.2411203403.5201451.0028

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
86 & 0.0539 & -0.0645 & 0.0054 & 1757938.829 & 146494.9024 & 382.7465 \tabularnewline
87 & 0.0626 & -0.0448 & 0.0037 & 1059964.9306 & 88330.4109 & 297.2043 \tabularnewline
88 & 0.0682 & -0.001 & 1e-04 & 476.772 & 39.731 & 6.3033 \tabularnewline
89 & 0.0812 & -0.0328 & 0.0027 & 435398.8406 & 36283.2367 & 190.4816 \tabularnewline
90 & 0.0879 & 0.079 & 0.0066 & 2689631.363 & 224135.9469 & 473.43 \tabularnewline
91 & 0.0967 & 0.0319 & 0.0027 & 425563.7939 & 35463.6495 & 188.3179 \tabularnewline
92 & 0.1153 & -0.0304 & 0.0025 & 497403.9948 & 41450.3329 & 203.5935 \tabularnewline
93 & 0.114 & 0.1221 & 0.0102 & 6657425.8939 & 554785.4912 & 744.8392 \tabularnewline
94 & 0.1232 & 0.0313 & 0.0026 & 442835.6029 & 36902.9669 & 192.1014 \tabularnewline
95 & 0.1365 & 0.0291 & 0.0024 & 436112.7744 & 36342.7312 & 190.6377 \tabularnewline
96 & 0.1332 & 0.1594 & 0.0133 & 10675967.9866 & 889663.9989 & 943.22 \tabularnewline
97 & 0.1325 & 0.0827 & 0.0069 & 2440842.2411 & 203403.5201 & 451.0028 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=35997&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]86[/C][C]0.0539[/C][C]-0.0645[/C][C]0.0054[/C][C]1757938.829[/C][C]146494.9024[/C][C]382.7465[/C][/ROW]
[ROW][C]87[/C][C]0.0626[/C][C]-0.0448[/C][C]0.0037[/C][C]1059964.9306[/C][C]88330.4109[/C][C]297.2043[/C][/ROW]
[ROW][C]88[/C][C]0.0682[/C][C]-0.001[/C][C]1e-04[/C][C]476.772[/C][C]39.731[/C][C]6.3033[/C][/ROW]
[ROW][C]89[/C][C]0.0812[/C][C]-0.0328[/C][C]0.0027[/C][C]435398.8406[/C][C]36283.2367[/C][C]190.4816[/C][/ROW]
[ROW][C]90[/C][C]0.0879[/C][C]0.079[/C][C]0.0066[/C][C]2689631.363[/C][C]224135.9469[/C][C]473.43[/C][/ROW]
[ROW][C]91[/C][C]0.0967[/C][C]0.0319[/C][C]0.0027[/C][C]425563.7939[/C][C]35463.6495[/C][C]188.3179[/C][/ROW]
[ROW][C]92[/C][C]0.1153[/C][C]-0.0304[/C][C]0.0025[/C][C]497403.9948[/C][C]41450.3329[/C][C]203.5935[/C][/ROW]
[ROW][C]93[/C][C]0.114[/C][C]0.1221[/C][C]0.0102[/C][C]6657425.8939[/C][C]554785.4912[/C][C]744.8392[/C][/ROW]
[ROW][C]94[/C][C]0.1232[/C][C]0.0313[/C][C]0.0026[/C][C]442835.6029[/C][C]36902.9669[/C][C]192.1014[/C][/ROW]
[ROW][C]95[/C][C]0.1365[/C][C]0.0291[/C][C]0.0024[/C][C]436112.7744[/C][C]36342.7312[/C][C]190.6377[/C][/ROW]
[ROW][C]96[/C][C]0.1332[/C][C]0.1594[/C][C]0.0133[/C][C]10675967.9866[/C][C]889663.9989[/C][C]943.22[/C][/ROW]
[ROW][C]97[/C][C]0.1325[/C][C]0.0827[/C][C]0.0069[/C][C]2440842.2411[/C][C]203403.5201[/C][C]451.0028[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=35997&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35997&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
860.0539-0.06450.00541757938.829146494.9024382.7465
870.0626-0.04480.00371059964.930688330.4109297.2043
880.0682-0.0011e-04476.77239.7316.3033
890.0812-0.03280.0027435398.840636283.2367190.4816
900.08790.0790.00662689631.363224135.9469473.43
910.09670.03190.0027425563.793935463.6495188.3179
920.1153-0.03040.0025497403.994841450.3329203.5935
930.1140.12210.01026657425.8939554785.4912744.8392
940.12320.03130.0026442835.602936902.9669192.1014
950.13650.02910.0024436112.774436342.7312190.6377
960.13320.15940.013310675967.9866889663.9989943.22
970.13250.08270.00692440842.2411203403.5201451.0028



Parameters (Session):
par1 = 12 ; par2 = -0.6 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = -0.6 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 1 ; par10 = FALSE ; par11 = ; par12 = ; par13 = ; par14 = ; par15 = ; par16 = ; par17 = ; par18 = ; par19 = ; par20 = ;
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')