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 computationTue, 20 Dec 2016 15:39:04 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/20/t14822449392dlan9j8f00gtkj.htm/, Retrieved Sun, 28 Apr 2024 05:55:44 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301694, Retrieved Sun, 28 Apr 2024 05:55:44 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact70
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-20 14:39:04] [361c8dad91b3f1ef2e651cd04783c23b] [Current]
Feedback Forum

Post a new message
Dataseries X:
2755
2765
3000
2890
2940
3290
2815
3035
3070
3040
2685
2540
3090
2995
3440
3335
3205
3285
2790
3225
3360
3275
3505
3185
3470
3510
3840
3605
3655
3555
3140
3380
3255
3460
3245
3120
3265
3220
3140
3050
3300
2950
2630
2795
2840
2945
2790
2605
4590
4230
4245
4300
4475
3910
4100
3500
4390
3550
3865
3715
3310
3945
5050
4350
4060
4345
4360
4915
4650
4805
4775
4220
3975
3820
5515
4895
5535
4230
3695
5590
5000
4875
4360
4405
4500
4070
4800
4080
4850
4105
3805
5060
4060
4600
4635
3900
4120
3960
4400
3700
3970
4550
5140
5000
3650
4300
3650
3355
4000
3450
3295
3390
3415
3440
3680
3900
3965
4295
4210
4100
4690
3860
4250
4495
3800
3845




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301694&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=301694&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301694&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[114])
1024550-------
1035140-------
1045000-------
1053650-------
1064300-------
1073650-------
1083355-------
1094000-------
1103450-------
1113295-------
1123390-------
1133415-------
1143440-------
11536803781.62682913.22324650.03040.40930.77970.00110.7797
11639003654.28312718.41244590.15370.30340.47850.00240.6732
11739653297.10582298.31514295.89650.0950.11840.24430.3896
11842953444.42852386.45314502.40390.05750.16740.05650.5033
11942103203.14192089.12174317.16210.03820.02740.21590.3384
12041003195.81752028.444363.19490.06450.04430.39460.3409
12146903390.60042172.20024609.00070.01830.12690.16350.4683
12238603211.98331944.61274479.35390.15810.01110.35640.3622
12342503120.38451805.86664434.90230.04610.13510.39730.3168
12444953209.37291849.34124569.40470.0320.06680.39730.3698
12538003206.93361802.86264611.00460.20390.03610.38570.3725
12638453139.53941692.76914586.30970.16960.18550.3420.342

\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[114]) \tabularnewline
102 & 4550 & - & - & - & - & - & - & - \tabularnewline
103 & 5140 & - & - & - & - & - & - & - \tabularnewline
104 & 5000 & - & - & - & - & - & - & - \tabularnewline
105 & 3650 & - & - & - & - & - & - & - \tabularnewline
106 & 4300 & - & - & - & - & - & - & - \tabularnewline
107 & 3650 & - & - & - & - & - & - & - \tabularnewline
108 & 3355 & - & - & - & - & - & - & - \tabularnewline
109 & 4000 & - & - & - & - & - & - & - \tabularnewline
110 & 3450 & - & - & - & - & - & - & - \tabularnewline
111 & 3295 & - & - & - & - & - & - & - \tabularnewline
112 & 3390 & - & - & - & - & - & - & - \tabularnewline
113 & 3415 & - & - & - & - & - & - & - \tabularnewline
114 & 3440 & - & - & - & - & - & - & - \tabularnewline
115 & 3680 & 3781.6268 & 2913.2232 & 4650.0304 & 0.4093 & 0.7797 & 0.0011 & 0.7797 \tabularnewline
116 & 3900 & 3654.2831 & 2718.4124 & 4590.1537 & 0.3034 & 0.4785 & 0.0024 & 0.6732 \tabularnewline
117 & 3965 & 3297.1058 & 2298.3151 & 4295.8965 & 0.095 & 0.1184 & 0.2443 & 0.3896 \tabularnewline
118 & 4295 & 3444.4285 & 2386.4531 & 4502.4039 & 0.0575 & 0.1674 & 0.0565 & 0.5033 \tabularnewline
119 & 4210 & 3203.1419 & 2089.1217 & 4317.1621 & 0.0382 & 0.0274 & 0.2159 & 0.3384 \tabularnewline
120 & 4100 & 3195.8175 & 2028.44 & 4363.1949 & 0.0645 & 0.0443 & 0.3946 & 0.3409 \tabularnewline
121 & 4690 & 3390.6004 & 2172.2002 & 4609.0007 & 0.0183 & 0.1269 & 0.1635 & 0.4683 \tabularnewline
122 & 3860 & 3211.9833 & 1944.6127 & 4479.3539 & 0.1581 & 0.0111 & 0.3564 & 0.3622 \tabularnewline
123 & 4250 & 3120.3845 & 1805.8666 & 4434.9023 & 0.0461 & 0.1351 & 0.3973 & 0.3168 \tabularnewline
124 & 4495 & 3209.3729 & 1849.3412 & 4569.4047 & 0.032 & 0.0668 & 0.3973 & 0.3698 \tabularnewline
125 & 3800 & 3206.9336 & 1802.8626 & 4611.0046 & 0.2039 & 0.0361 & 0.3857 & 0.3725 \tabularnewline
126 & 3845 & 3139.5394 & 1692.7691 & 4586.3097 & 0.1696 & 0.1855 & 0.342 & 0.342 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301694&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[114])[/C][/ROW]
[ROW][C]102[/C][C]4550[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]5140[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]5000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]3650[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]4300[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]3650[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]3355[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]4000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]3450[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]3295[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]3390[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]3415[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]3440[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]3680[/C][C]3781.6268[/C][C]2913.2232[/C][C]4650.0304[/C][C]0.4093[/C][C]0.7797[/C][C]0.0011[/C][C]0.7797[/C][/ROW]
[ROW][C]116[/C][C]3900[/C][C]3654.2831[/C][C]2718.4124[/C][C]4590.1537[/C][C]0.3034[/C][C]0.4785[/C][C]0.0024[/C][C]0.6732[/C][/ROW]
[ROW][C]117[/C][C]3965[/C][C]3297.1058[/C][C]2298.3151[/C][C]4295.8965[/C][C]0.095[/C][C]0.1184[/C][C]0.2443[/C][C]0.3896[/C][/ROW]
[ROW][C]118[/C][C]4295[/C][C]3444.4285[/C][C]2386.4531[/C][C]4502.4039[/C][C]0.0575[/C][C]0.1674[/C][C]0.0565[/C][C]0.5033[/C][/ROW]
[ROW][C]119[/C][C]4210[/C][C]3203.1419[/C][C]2089.1217[/C][C]4317.1621[/C][C]0.0382[/C][C]0.0274[/C][C]0.2159[/C][C]0.3384[/C][/ROW]
[ROW][C]120[/C][C]4100[/C][C]3195.8175[/C][C]2028.44[/C][C]4363.1949[/C][C]0.0645[/C][C]0.0443[/C][C]0.3946[/C][C]0.3409[/C][/ROW]
[ROW][C]121[/C][C]4690[/C][C]3390.6004[/C][C]2172.2002[/C][C]4609.0007[/C][C]0.0183[/C][C]0.1269[/C][C]0.1635[/C][C]0.4683[/C][/ROW]
[ROW][C]122[/C][C]3860[/C][C]3211.9833[/C][C]1944.6127[/C][C]4479.3539[/C][C]0.1581[/C][C]0.0111[/C][C]0.3564[/C][C]0.3622[/C][/ROW]
[ROW][C]123[/C][C]4250[/C][C]3120.3845[/C][C]1805.8666[/C][C]4434.9023[/C][C]0.0461[/C][C]0.1351[/C][C]0.3973[/C][C]0.3168[/C][/ROW]
[ROW][C]124[/C][C]4495[/C][C]3209.3729[/C][C]1849.3412[/C][C]4569.4047[/C][C]0.032[/C][C]0.0668[/C][C]0.3973[/C][C]0.3698[/C][/ROW]
[ROW][C]125[/C][C]3800[/C][C]3206.9336[/C][C]1802.8626[/C][C]4611.0046[/C][C]0.2039[/C][C]0.0361[/C][C]0.3857[/C][C]0.3725[/C][/ROW]
[ROW][C]126[/C][C]3845[/C][C]3139.5394[/C][C]1692.7691[/C][C]4586.3097[/C][C]0.1696[/C][C]0.1855[/C][C]0.342[/C][C]0.342[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301694&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301694&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[114])
1024550-------
1035140-------
1045000-------
1053650-------
1064300-------
1073650-------
1083355-------
1094000-------
1103450-------
1113295-------
1123390-------
1133415-------
1143440-------
11536803781.62682913.22324650.03040.40930.77970.00110.7797
11639003654.28312718.41244590.15370.30340.47850.00240.6732
11739653297.10582298.31514295.89650.0950.11840.24430.3896
11842953444.42852386.45314502.40390.05750.16740.05650.5033
11942103203.14192089.12174317.16210.03820.02740.21590.3384
12041003195.81752028.444363.19490.06450.04430.39460.3409
12146903390.60042172.20024609.00070.01830.12690.16350.4683
12238603211.98331944.61274479.35390.15810.01110.35640.3622
12342503120.38451805.86664434.90230.04610.13510.39730.3168
12444953209.37291849.34124569.40470.0320.06680.39730.3698
12538003206.93361802.86264611.00460.20390.03610.38570.3725
12638453139.53941692.76914586.30970.16960.18550.3420.342







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.1172-0.02760.02760.027210328.009100-0.31010.3101
1160.13070.0630.04530.046160376.816535352.4128188.02240.74980.5299
1170.15460.16840.08640.0921446082.6943172262.5066415.04522.0381.0326
1180.15670.1980.11430.124723471.9394310064.8648556.83472.59541.4233
1190.17740.23920.13930.15351013763.2063450804.5331671.41983.07221.7531
1200.18640.22050.15280.1693817546.0802511928.1243715.49152.75891.9207
1210.18330.27710.17060.1911688439.1911680001.1338824.62183.96492.2128
1220.20130.16790.17020.1901419925.6725647491.7012804.66871.97732.1833
1230.21490.26580.18080.2031276031.2443717329.4282846.9533.44682.3237
1240.21620.2860.19140.21611652836.9422810880.1796900.48893.92292.4836
1250.22340.15610.18810.2118351727.7046769139.0455877.00571.80962.4224
1260.23510.18350.18780.211497674.6642746517.0137864.01222.15262.3999

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
115 & 0.1172 & -0.0276 & 0.0276 & 0.0272 & 10328.0091 & 0 & 0 & -0.3101 & 0.3101 \tabularnewline
116 & 0.1307 & 0.063 & 0.0453 & 0.0461 & 60376.8165 & 35352.4128 & 188.0224 & 0.7498 & 0.5299 \tabularnewline
117 & 0.1546 & 0.1684 & 0.0864 & 0.0921 & 446082.6943 & 172262.5066 & 415.0452 & 2.038 & 1.0326 \tabularnewline
118 & 0.1567 & 0.198 & 0.1143 & 0.124 & 723471.9394 & 310064.8648 & 556.8347 & 2.5954 & 1.4233 \tabularnewline
119 & 0.1774 & 0.2392 & 0.1393 & 0.1535 & 1013763.2063 & 450804.5331 & 671.4198 & 3.0722 & 1.7531 \tabularnewline
120 & 0.1864 & 0.2205 & 0.1528 & 0.1693 & 817546.0802 & 511928.1243 & 715.4915 & 2.7589 & 1.9207 \tabularnewline
121 & 0.1833 & 0.2771 & 0.1706 & 0.191 & 1688439.1911 & 680001.1338 & 824.6218 & 3.9649 & 2.2128 \tabularnewline
122 & 0.2013 & 0.1679 & 0.1702 & 0.1901 & 419925.6725 & 647491.7012 & 804.6687 & 1.9773 & 2.1833 \tabularnewline
123 & 0.2149 & 0.2658 & 0.1808 & 0.203 & 1276031.2443 & 717329.4282 & 846.953 & 3.4468 & 2.3237 \tabularnewline
124 & 0.2162 & 0.286 & 0.1914 & 0.2161 & 1652836.9422 & 810880.1796 & 900.4889 & 3.9229 & 2.4836 \tabularnewline
125 & 0.2234 & 0.1561 & 0.1881 & 0.2118 & 351727.7046 & 769139.0455 & 877.0057 & 1.8096 & 2.4224 \tabularnewline
126 & 0.2351 & 0.1835 & 0.1878 & 0.211 & 497674.6642 & 746517.0137 & 864.0122 & 2.1526 & 2.3999 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301694&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]115[/C][C]0.1172[/C][C]-0.0276[/C][C]0.0276[/C][C]0.0272[/C][C]10328.0091[/C][C]0[/C][C]0[/C][C]-0.3101[/C][C]0.3101[/C][/ROW]
[ROW][C]116[/C][C]0.1307[/C][C]0.063[/C][C]0.0453[/C][C]0.0461[/C][C]60376.8165[/C][C]35352.4128[/C][C]188.0224[/C][C]0.7498[/C][C]0.5299[/C][/ROW]
[ROW][C]117[/C][C]0.1546[/C][C]0.1684[/C][C]0.0864[/C][C]0.0921[/C][C]446082.6943[/C][C]172262.5066[/C][C]415.0452[/C][C]2.038[/C][C]1.0326[/C][/ROW]
[ROW][C]118[/C][C]0.1567[/C][C]0.198[/C][C]0.1143[/C][C]0.124[/C][C]723471.9394[/C][C]310064.8648[/C][C]556.8347[/C][C]2.5954[/C][C]1.4233[/C][/ROW]
[ROW][C]119[/C][C]0.1774[/C][C]0.2392[/C][C]0.1393[/C][C]0.1535[/C][C]1013763.2063[/C][C]450804.5331[/C][C]671.4198[/C][C]3.0722[/C][C]1.7531[/C][/ROW]
[ROW][C]120[/C][C]0.1864[/C][C]0.2205[/C][C]0.1528[/C][C]0.1693[/C][C]817546.0802[/C][C]511928.1243[/C][C]715.4915[/C][C]2.7589[/C][C]1.9207[/C][/ROW]
[ROW][C]121[/C][C]0.1833[/C][C]0.2771[/C][C]0.1706[/C][C]0.191[/C][C]1688439.1911[/C][C]680001.1338[/C][C]824.6218[/C][C]3.9649[/C][C]2.2128[/C][/ROW]
[ROW][C]122[/C][C]0.2013[/C][C]0.1679[/C][C]0.1702[/C][C]0.1901[/C][C]419925.6725[/C][C]647491.7012[/C][C]804.6687[/C][C]1.9773[/C][C]2.1833[/C][/ROW]
[ROW][C]123[/C][C]0.2149[/C][C]0.2658[/C][C]0.1808[/C][C]0.203[/C][C]1276031.2443[/C][C]717329.4282[/C][C]846.953[/C][C]3.4468[/C][C]2.3237[/C][/ROW]
[ROW][C]124[/C][C]0.2162[/C][C]0.286[/C][C]0.1914[/C][C]0.2161[/C][C]1652836.9422[/C][C]810880.1796[/C][C]900.4889[/C][C]3.9229[/C][C]2.4836[/C][/ROW]
[ROW][C]125[/C][C]0.2234[/C][C]0.1561[/C][C]0.1881[/C][C]0.2118[/C][C]351727.7046[/C][C]769139.0455[/C][C]877.0057[/C][C]1.8096[/C][C]2.4224[/C][/ROW]
[ROW][C]126[/C][C]0.2351[/C][C]0.1835[/C][C]0.1878[/C][C]0.211[/C][C]497674.6642[/C][C]746517.0137[/C][C]864.0122[/C][C]2.1526[/C][C]2.3999[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301694&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301694&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.1172-0.02760.02760.027210328.009100-0.31010.3101
1160.13070.0630.04530.046160376.816535352.4128188.02240.74980.5299
1170.15460.16840.08640.0921446082.6943172262.5066415.04522.0381.0326
1180.15670.1980.11430.124723471.9394310064.8648556.83472.59541.4233
1190.17740.23920.13930.15351013763.2063450804.5331671.41983.07221.7531
1200.18640.22050.15280.1693817546.0802511928.1243715.49152.75891.9207
1210.18330.27710.17060.1911688439.1911680001.1338824.62183.96492.2128
1220.20130.16790.17020.1901419925.6725647491.7012804.66871.97732.1833
1230.21490.26580.18080.2031276031.2443717329.4282846.9533.44682.3237
1240.21620.2860.19140.21611652836.9422810880.1796900.48893.92292.4836
1250.22340.15610.18810.2118351727.7046769139.0455877.00571.80962.4224
1260.23510.18350.18780.211497674.6642746517.0137864.01222.15262.3999



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; 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*2
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')