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, 27 Dec 2009 06:10:02 -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/27/t1261919475wp9xfkzxcjxv7h8.htm/, Retrieved Fri, 03 May 2024 03:26:11 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70881, Retrieved Fri, 03 May 2024 03:26:11 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact120
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [Toon Nauwelaerts] [2009-12-27 12:06:14] [28075c6928548bea087cb2be962cfe7e]
- RMP   [Spectral Analysis] [Toon Nauwelaerts] [2009-12-27 12:12:13] [28075c6928548bea087cb2be962cfe7e]
- RMPD    [Cross Correlation Function] [Toon Nauwelaerts] [2009-12-27 12:34:11] [28075c6928548bea087cb2be962cfe7e]
- RMPD        [ARIMA Forecasting] [Toon Nauwelaerts] [2009-12-27 13:10:02] [b7e924d6f720297f82cd59f42434ec05] [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 time4 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 & 4 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70881&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70881&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70881&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'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.820620.426118756.726122799.12840.1040.99460.96850.9946
8721968.923094.31320735.334125914.00790.2170.99650.99610.9999
8821131.521291.368618939.604724147.80090.45630.3210.90020.9919
8919484.620269.176517669.873723539.14510.31910.30260.94650.9314
9022404.120903.139818030.846624584.38780.21210.7750.88620.9513
912109920602.059717544.88924610.36510.4040.18910.89160.9155
9222486.523356.069619383.168328812.97350.37740.79120.85270.9772
9323707.521293.700617686.475326240.76750.16950.31830.89890.9175
9421897.521384.284117548.633426761.87430.42580.19860.74660.9049
9523326.422827.545318411.921929219.27920.43920.61230.81540.9388
9623765.420640.282516708.664526292.9050.13930.17580.68790.8385
972044419011.320915399.798824197.59760.29410.03620.67790.6779

\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 & 20620.4261 & 18756.7261 & 22799.1284 & 0.104 & 0.9946 & 0.9685 & 0.9946 \tabularnewline
87 & 21968.9 & 23094.313 & 20735.3341 & 25914.0079 & 0.217 & 0.9965 & 0.9961 & 0.9999 \tabularnewline
88 & 21131.5 & 21291.3686 & 18939.6047 & 24147.8009 & 0.4563 & 0.321 & 0.9002 & 0.9919 \tabularnewline
89 & 19484.6 & 20269.1765 & 17669.8737 & 23539.1451 & 0.3191 & 0.3026 & 0.9465 & 0.9314 \tabularnewline
90 & 22404.1 & 20903.1398 & 18030.8466 & 24584.3878 & 0.2121 & 0.775 & 0.8862 & 0.9513 \tabularnewline
91 & 21099 & 20602.0597 & 17544.889 & 24610.3651 & 0.404 & 0.1891 & 0.8916 & 0.9155 \tabularnewline
92 & 22486.5 & 23356.0696 & 19383.1683 & 28812.9735 & 0.3774 & 0.7912 & 0.8527 & 0.9772 \tabularnewline
93 & 23707.5 & 21293.7006 & 17686.4753 & 26240.7675 & 0.1695 & 0.3183 & 0.8989 & 0.9175 \tabularnewline
94 & 21897.5 & 21384.2841 & 17548.6334 & 26761.8743 & 0.4258 & 0.1986 & 0.7466 & 0.9049 \tabularnewline
95 & 23326.4 & 22827.5453 & 18411.9219 & 29219.2792 & 0.4392 & 0.6123 & 0.8154 & 0.9388 \tabularnewline
96 & 23765.4 & 20640.2825 & 16708.6645 & 26292.905 & 0.1393 & 0.1758 & 0.6879 & 0.8385 \tabularnewline
97 & 20444 & 19011.3209 & 15399.7988 & 24197.5976 & 0.2941 & 0.0362 & 0.6779 & 0.6779 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70881&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]20620.4261[/C][C]18756.7261[/C][C]22799.1284[/C][C]0.104[/C][C]0.9946[/C][C]0.9685[/C][C]0.9946[/C][/ROW]
[ROW][C]87[/C][C]21968.9[/C][C]23094.313[/C][C]20735.3341[/C][C]25914.0079[/C][C]0.217[/C][C]0.9965[/C][C]0.9961[/C][C]0.9999[/C][/ROW]
[ROW][C]88[/C][C]21131.5[/C][C]21291.3686[/C][C]18939.6047[/C][C]24147.8009[/C][C]0.4563[/C][C]0.321[/C][C]0.9002[/C][C]0.9919[/C][/ROW]
[ROW][C]89[/C][C]19484.6[/C][C]20269.1765[/C][C]17669.8737[/C][C]23539.1451[/C][C]0.3191[/C][C]0.3026[/C][C]0.9465[/C][C]0.9314[/C][/ROW]
[ROW][C]90[/C][C]22404.1[/C][C]20903.1398[/C][C]18030.8466[/C][C]24584.3878[/C][C]0.2121[/C][C]0.775[/C][C]0.8862[/C][C]0.9513[/C][/ROW]
[ROW][C]91[/C][C]21099[/C][C]20602.0597[/C][C]17544.889[/C][C]24610.3651[/C][C]0.404[/C][C]0.1891[/C][C]0.8916[/C][C]0.9155[/C][/ROW]
[ROW][C]92[/C][C]22486.5[/C][C]23356.0696[/C][C]19383.1683[/C][C]28812.9735[/C][C]0.3774[/C][C]0.7912[/C][C]0.8527[/C][C]0.9772[/C][/ROW]
[ROW][C]93[/C][C]23707.5[/C][C]21293.7006[/C][C]17686.4753[/C][C]26240.7675[/C][C]0.1695[/C][C]0.3183[/C][C]0.8989[/C][C]0.9175[/C][/ROW]
[ROW][C]94[/C][C]21897.5[/C][C]21384.2841[/C][C]17548.6334[/C][C]26761.8743[/C][C]0.4258[/C][C]0.1986[/C][C]0.7466[/C][C]0.9049[/C][/ROW]
[ROW][C]95[/C][C]23326.4[/C][C]22827.5453[/C][C]18411.9219[/C][C]29219.2792[/C][C]0.4392[/C][C]0.6123[/C][C]0.8154[/C][C]0.9388[/C][/ROW]
[ROW][C]96[/C][C]23765.4[/C][C]20640.2825[/C][C]16708.6645[/C][C]26292.905[/C][C]0.1393[/C][C]0.1758[/C][C]0.6879[/C][C]0.8385[/C][/ROW]
[ROW][C]97[/C][C]20444[/C][C]19011.3209[/C][C]15399.7988[/C][C]24197.5976[/C][C]0.2941[/C][C]0.0362[/C][C]0.6779[/C][C]0.6779[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70881&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70881&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.820620.426118756.726122799.12840.1040.99460.96850.9946
8721968.923094.31320735.334125914.00790.2170.99650.99610.9999
8821131.521291.368618939.604724147.80090.45630.3210.90020.9919
8919484.620269.176517669.873723539.14510.31910.30260.94650.9314
9022404.120903.139818030.846624584.38780.21210.7750.88620.9513
912109920602.059717544.88924610.36510.4040.18910.89160.9155
9222486.523356.069619383.168328812.97350.37740.79120.85270.9772
9323707.521293.700617686.475326240.76750.16950.31830.89890.9175
9421897.521384.284117548.633426761.87430.42580.19860.74660.9049
9523326.422827.545318411.921929219.27920.43920.61230.81540.9388
9623765.420640.282516708.664526292.9050.13930.17580.68790.8385
972044419011.320915399.798824197.59760.29410.03620.67790.6779







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
860.0539-0.067901958953.230300
870.0623-0.04870.05831266554.38331612753.80681269.9424
880.0684-0.00750.041425557.9571083688.52351041.0036
890.0823-0.03870.0407615560.3431966656.4784983.1869
900.08990.07180.04692252881.4251223901.46771106.3008
910.09930.02410.0431246949.62861061076.16121030.0855
920.1192-0.03720.0423756151.35611017515.47481008.7197
930.11850.11340.05125826427.68291618629.50081272.2537
940.12830.0240.0481263390.57661468047.39811211.6301
950.14290.02190.0455248856.00961346128.25931160.2277
960.13970.15140.05519766359.27252111603.80591453.1359
970.13920.07540.05682052569.29282106684.26321451.4421

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
86 & 0.0539 & -0.0679 & 0 & 1958953.2303 & 0 & 0 \tabularnewline
87 & 0.0623 & -0.0487 & 0.0583 & 1266554.3833 & 1612753.8068 & 1269.9424 \tabularnewline
88 & 0.0684 & -0.0075 & 0.0414 & 25557.957 & 1083688.5235 & 1041.0036 \tabularnewline
89 & 0.0823 & -0.0387 & 0.0407 & 615560.3431 & 966656.4784 & 983.1869 \tabularnewline
90 & 0.0899 & 0.0718 & 0.0469 & 2252881.425 & 1223901.4677 & 1106.3008 \tabularnewline
91 & 0.0993 & 0.0241 & 0.0431 & 246949.6286 & 1061076.1612 & 1030.0855 \tabularnewline
92 & 0.1192 & -0.0372 & 0.0423 & 756151.3561 & 1017515.4748 & 1008.7197 \tabularnewline
93 & 0.1185 & 0.1134 & 0.0512 & 5826427.6829 & 1618629.5008 & 1272.2537 \tabularnewline
94 & 0.1283 & 0.024 & 0.0481 & 263390.5766 & 1468047.3981 & 1211.6301 \tabularnewline
95 & 0.1429 & 0.0219 & 0.0455 & 248856.0096 & 1346128.2593 & 1160.2277 \tabularnewline
96 & 0.1397 & 0.1514 & 0.0551 & 9766359.2725 & 2111603.8059 & 1453.1359 \tabularnewline
97 & 0.1392 & 0.0754 & 0.0568 & 2052569.2928 & 2106684.2632 & 1451.4421 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70881&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.0679[/C][C]0[/C][C]1958953.2303[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]87[/C][C]0.0623[/C][C]-0.0487[/C][C]0.0583[/C][C]1266554.3833[/C][C]1612753.8068[/C][C]1269.9424[/C][/ROW]
[ROW][C]88[/C][C]0.0684[/C][C]-0.0075[/C][C]0.0414[/C][C]25557.957[/C][C]1083688.5235[/C][C]1041.0036[/C][/ROW]
[ROW][C]89[/C][C]0.0823[/C][C]-0.0387[/C][C]0.0407[/C][C]615560.3431[/C][C]966656.4784[/C][C]983.1869[/C][/ROW]
[ROW][C]90[/C][C]0.0899[/C][C]0.0718[/C][C]0.0469[/C][C]2252881.425[/C][C]1223901.4677[/C][C]1106.3008[/C][/ROW]
[ROW][C]91[/C][C]0.0993[/C][C]0.0241[/C][C]0.0431[/C][C]246949.6286[/C][C]1061076.1612[/C][C]1030.0855[/C][/ROW]
[ROW][C]92[/C][C]0.1192[/C][C]-0.0372[/C][C]0.0423[/C][C]756151.3561[/C][C]1017515.4748[/C][C]1008.7197[/C][/ROW]
[ROW][C]93[/C][C]0.1185[/C][C]0.1134[/C][C]0.0512[/C][C]5826427.6829[/C][C]1618629.5008[/C][C]1272.2537[/C][/ROW]
[ROW][C]94[/C][C]0.1283[/C][C]0.024[/C][C]0.0481[/C][C]263390.5766[/C][C]1468047.3981[/C][C]1211.6301[/C][/ROW]
[ROW][C]95[/C][C]0.1429[/C][C]0.0219[/C][C]0.0455[/C][C]248856.0096[/C][C]1346128.2593[/C][C]1160.2277[/C][/ROW]
[ROW][C]96[/C][C]0.1397[/C][C]0.1514[/C][C]0.0551[/C][C]9766359.2725[/C][C]2111603.8059[/C][C]1453.1359[/C][/ROW]
[ROW][C]97[/C][C]0.1392[/C][C]0.0754[/C][C]0.0568[/C][C]2052569.2928[/C][C]2106684.2632[/C][C]1451.4421[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70881&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70881&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.067901958953.230300
870.0623-0.04870.05831266554.38331612753.80681269.9424
880.0684-0.00750.041425557.9571083688.52351041.0036
890.0823-0.03870.0407615560.3431966656.4784983.1869
900.08990.07180.04692252881.4251223901.46771106.3008
910.09930.02410.0431246949.62861061076.16121030.0855
920.1192-0.03720.0423756151.35611017515.47481008.7197
930.11850.11340.05125826427.68291618629.50081272.2537
940.12830.0240.0481263390.57661468047.39811211.6301
950.14290.02190.0455248856.00961346128.25931160.2277
960.13970.15140.05519766359.27252111603.80591453.1359
970.13920.07540.05682052569.29282106684.26321451.4421



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