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 computationFri, 23 Dec 2016 10:17:21 +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/23/t148248467562yu5sydsjje03c.htm/, Retrieved Tue, 07 May 2024 11:08:41 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302797, Retrieved Tue, 07 May 2024 11:08:41 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact69
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima Forecasting...] [2016-12-23 09:17:21] [5eeb1dffd6aae54bb54a6ca77f27aabf] [Current]
Feedback Forum

Post a new message
Dataseries X:
2312
1089
2742
3145
2966
2055
2450
2742
1697
2409
2233
2100
3434
1867
2365
3578
2845
2778
2056
2757
3325
3671
2147
3225
3556
4661
3344
5375
3907
3356
2184
3510
2834
3271
2834
2408
3261
1526
2938
2352
3915
3145
1566
2746
3572
2651
2805
3354
2523
1480
3278
5081
3332
2789
4111
2508
1833
2371
4268
2194
2935
3347
3034
5448
3427
3036
4196
3009
3369
4168
3403
1779
2761
2582
3153
3011
3419
4042
4379
4602
3249
4372
4328
3695
3614
2114
2839
2490
2610
2372
2833
4018
2734
3027
3862
3281
2746
2538
1805
2500
2601
3178
4193
2606
2491
4090
2786
2280
2403
2934
1601
1946
2554
2006
2830
3173
1960
3052
2151
2493
2752
2542
2027
1940
1877




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302797&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]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302797&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302797&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 time2 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[113])
1012601-------
1023178-------
1034193-------
1042606-------
1052491-------
1064090-------
1072786-------
1082280-------
1092403-------
1102934-------
1111601-------
1121946-------
1132554-------
11420062392.5369805.52583979.5480.31650.4210.1660.421
11528302446.3962788.79574103.99670.32510.69870.01950.4494
11631732305.217601.51344008.92050.15910.2730.36470.3874
11719602285.7935435.15624136.43090.3650.17370.4140.3882
11830522548.0277543.76324552.29220.31110.71740.06580.4977
11921512305.6671220.17184391.16240.44220.24150.32580.4077
12024932215.259340.28284390.23580.40120.52310.47670.3801
12127522216.5405-63.32754496.40850.32260.40610.43630.3859
12225422305.2815-66.91194677.47490.42250.3560.30170.4186
12320272012.1491-442.4614466.75920.49530.33610.62870.3326
12419402111.1084-427.96264650.17940.44750.52590.55070.3662
12518772236.0344-386.3054858.37380.39420.58760.40610.4061

\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[113]) \tabularnewline
101 & 2601 & - & - & - & - & - & - & - \tabularnewline
102 & 3178 & - & - & - & - & - & - & - \tabularnewline
103 & 4193 & - & - & - & - & - & - & - \tabularnewline
104 & 2606 & - & - & - & - & - & - & - \tabularnewline
105 & 2491 & - & - & - & - & - & - & - \tabularnewline
106 & 4090 & - & - & - & - & - & - & - \tabularnewline
107 & 2786 & - & - & - & - & - & - & - \tabularnewline
108 & 2280 & - & - & - & - & - & - & - \tabularnewline
109 & 2403 & - & - & - & - & - & - & - \tabularnewline
110 & 2934 & - & - & - & - & - & - & - \tabularnewline
111 & 1601 & - & - & - & - & - & - & - \tabularnewline
112 & 1946 & - & - & - & - & - & - & - \tabularnewline
113 & 2554 & - & - & - & - & - & - & - \tabularnewline
114 & 2006 & 2392.5369 & 805.5258 & 3979.548 & 0.3165 & 0.421 & 0.166 & 0.421 \tabularnewline
115 & 2830 & 2446.3962 & 788.7957 & 4103.9967 & 0.3251 & 0.6987 & 0.0195 & 0.4494 \tabularnewline
116 & 3173 & 2305.217 & 601.5134 & 4008.9205 & 0.1591 & 0.273 & 0.3647 & 0.3874 \tabularnewline
117 & 1960 & 2285.7935 & 435.1562 & 4136.4309 & 0.365 & 0.1737 & 0.414 & 0.3882 \tabularnewline
118 & 3052 & 2548.0277 & 543.7632 & 4552.2922 & 0.3111 & 0.7174 & 0.0658 & 0.4977 \tabularnewline
119 & 2151 & 2305.6671 & 220.1718 & 4391.1624 & 0.4422 & 0.2415 & 0.3258 & 0.4077 \tabularnewline
120 & 2493 & 2215.2593 & 40.2828 & 4390.2358 & 0.4012 & 0.5231 & 0.4767 & 0.3801 \tabularnewline
121 & 2752 & 2216.5405 & -63.3275 & 4496.4085 & 0.3226 & 0.4061 & 0.4363 & 0.3859 \tabularnewline
122 & 2542 & 2305.2815 & -66.9119 & 4677.4749 & 0.4225 & 0.356 & 0.3017 & 0.4186 \tabularnewline
123 & 2027 & 2012.1491 & -442.461 & 4466.7592 & 0.4953 & 0.3361 & 0.6287 & 0.3326 \tabularnewline
124 & 1940 & 2111.1084 & -427.9626 & 4650.1794 & 0.4475 & 0.5259 & 0.5507 & 0.3662 \tabularnewline
125 & 1877 & 2236.0344 & -386.305 & 4858.3738 & 0.3942 & 0.5876 & 0.4061 & 0.4061 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302797&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[113])[/C][/ROW]
[ROW][C]101[/C][C]2601[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]3178[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]4193[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]2606[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]2491[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]4090[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]2786[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]2280[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]2403[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]2934[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]1601[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]1946[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]2554[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]2006[/C][C]2392.5369[/C][C]805.5258[/C][C]3979.548[/C][C]0.3165[/C][C]0.421[/C][C]0.166[/C][C]0.421[/C][/ROW]
[ROW][C]115[/C][C]2830[/C][C]2446.3962[/C][C]788.7957[/C][C]4103.9967[/C][C]0.3251[/C][C]0.6987[/C][C]0.0195[/C][C]0.4494[/C][/ROW]
[ROW][C]116[/C][C]3173[/C][C]2305.217[/C][C]601.5134[/C][C]4008.9205[/C][C]0.1591[/C][C]0.273[/C][C]0.3647[/C][C]0.3874[/C][/ROW]
[ROW][C]117[/C][C]1960[/C][C]2285.7935[/C][C]435.1562[/C][C]4136.4309[/C][C]0.365[/C][C]0.1737[/C][C]0.414[/C][C]0.3882[/C][/ROW]
[ROW][C]118[/C][C]3052[/C][C]2548.0277[/C][C]543.7632[/C][C]4552.2922[/C][C]0.3111[/C][C]0.7174[/C][C]0.0658[/C][C]0.4977[/C][/ROW]
[ROW][C]119[/C][C]2151[/C][C]2305.6671[/C][C]220.1718[/C][C]4391.1624[/C][C]0.4422[/C][C]0.2415[/C][C]0.3258[/C][C]0.4077[/C][/ROW]
[ROW][C]120[/C][C]2493[/C][C]2215.2593[/C][C]40.2828[/C][C]4390.2358[/C][C]0.4012[/C][C]0.5231[/C][C]0.4767[/C][C]0.3801[/C][/ROW]
[ROW][C]121[/C][C]2752[/C][C]2216.5405[/C][C]-63.3275[/C][C]4496.4085[/C][C]0.3226[/C][C]0.4061[/C][C]0.4363[/C][C]0.3859[/C][/ROW]
[ROW][C]122[/C][C]2542[/C][C]2305.2815[/C][C]-66.9119[/C][C]4677.4749[/C][C]0.4225[/C][C]0.356[/C][C]0.3017[/C][C]0.4186[/C][/ROW]
[ROW][C]123[/C][C]2027[/C][C]2012.1491[/C][C]-442.461[/C][C]4466.7592[/C][C]0.4953[/C][C]0.3361[/C][C]0.6287[/C][C]0.3326[/C][/ROW]
[ROW][C]124[/C][C]1940[/C][C]2111.1084[/C][C]-427.9626[/C][C]4650.1794[/C][C]0.4475[/C][C]0.5259[/C][C]0.5507[/C][C]0.3662[/C][/ROW]
[ROW][C]125[/C][C]1877[/C][C]2236.0344[/C][C]-386.305[/C][C]4858.3738[/C][C]0.3942[/C][C]0.5876[/C][C]0.4061[/C][C]0.4061[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302797&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302797&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[113])
1012601-------
1023178-------
1034193-------
1042606-------
1052491-------
1064090-------
1072786-------
1082280-------
1092403-------
1102934-------
1111601-------
1121946-------
1132554-------
11420062392.5369805.52583979.5480.31650.4210.1660.421
11528302446.3962788.79574103.99670.32510.69870.01950.4494
11631732305.217601.51344008.92050.15910.2730.36470.3874
11719602285.7935435.15624136.43090.3650.17370.4140.3882
11830522548.0277543.76324552.29220.31110.71740.06580.4977
11921512305.6671220.17184391.16240.44220.24150.32580.4077
12024932215.259340.28284390.23580.40120.52310.47670.3801
12127522216.5405-63.32754496.40850.32260.40610.43630.3859
12225422305.2815-66.91194677.47490.42250.3560.30170.4186
12320272012.1491-442.4614466.75920.49530.33610.62870.3326
12419402111.1084-427.96264650.17940.44750.52590.55070.3662
12518772236.0344-386.3054858.37380.39420.58760.40610.4061







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1140.3384-0.19270.19270.1758149410.774700-0.72690.7269
1150.34570.13550.16410.1606147151.8702148281.3224385.07310.72140.7242
1160.37710.27350.20060.2127753047.3577349870.0009591.49811.6321.0268
1170.4131-0.16620.1920.1979106141.427288937.8574537.5294-0.61270.9233
1180.40130.16510.18660.1943253988.114281947.9087530.98770.94780.9282
1190.4615-0.07190.16750.173523921.909238943.5754488.8186-0.29090.822
1200.50090.11140.15950.165577139.917215828.7671464.57370.52230.7792
1210.52480.19460.16390.1718286716.8821224689.7815474.01451.0070.8076
1220.5250.09310.1560.163656035.6429205950.4327453.81760.44520.7674
1230.62240.00730.14110.1479220.5483185377.4443430.55480.02790.6934
1240.6136-0.08820.13630.142229278.0876171186.5937413.747-0.32180.6596
1250.5983-0.19130.14090.1449128905.6931167663.1853409.467-0.67520.6609

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
114 & 0.3384 & -0.1927 & 0.1927 & 0.1758 & 149410.7747 & 0 & 0 & -0.7269 & 0.7269 \tabularnewline
115 & 0.3457 & 0.1355 & 0.1641 & 0.1606 & 147151.8702 & 148281.3224 & 385.0731 & 0.7214 & 0.7242 \tabularnewline
116 & 0.3771 & 0.2735 & 0.2006 & 0.2127 & 753047.3577 & 349870.0009 & 591.4981 & 1.632 & 1.0268 \tabularnewline
117 & 0.4131 & -0.1662 & 0.192 & 0.1979 & 106141.427 & 288937.8574 & 537.5294 & -0.6127 & 0.9233 \tabularnewline
118 & 0.4013 & 0.1651 & 0.1866 & 0.1943 & 253988.114 & 281947.9087 & 530.9877 & 0.9478 & 0.9282 \tabularnewline
119 & 0.4615 & -0.0719 & 0.1675 & 0.1735 & 23921.909 & 238943.5754 & 488.8186 & -0.2909 & 0.822 \tabularnewline
120 & 0.5009 & 0.1114 & 0.1595 & 0.1655 & 77139.917 & 215828.7671 & 464.5737 & 0.5223 & 0.7792 \tabularnewline
121 & 0.5248 & 0.1946 & 0.1639 & 0.1718 & 286716.8821 & 224689.7815 & 474.0145 & 1.007 & 0.8076 \tabularnewline
122 & 0.525 & 0.0931 & 0.156 & 0.1636 & 56035.6429 & 205950.4327 & 453.8176 & 0.4452 & 0.7674 \tabularnewline
123 & 0.6224 & 0.0073 & 0.1411 & 0.1479 & 220.5483 & 185377.4443 & 430.5548 & 0.0279 & 0.6934 \tabularnewline
124 & 0.6136 & -0.0882 & 0.1363 & 0.1422 & 29278.0876 & 171186.5937 & 413.747 & -0.3218 & 0.6596 \tabularnewline
125 & 0.5983 & -0.1913 & 0.1409 & 0.1449 & 128905.6931 & 167663.1853 & 409.467 & -0.6752 & 0.6609 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302797&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]114[/C][C]0.3384[/C][C]-0.1927[/C][C]0.1927[/C][C]0.1758[/C][C]149410.7747[/C][C]0[/C][C]0[/C][C]-0.7269[/C][C]0.7269[/C][/ROW]
[ROW][C]115[/C][C]0.3457[/C][C]0.1355[/C][C]0.1641[/C][C]0.1606[/C][C]147151.8702[/C][C]148281.3224[/C][C]385.0731[/C][C]0.7214[/C][C]0.7242[/C][/ROW]
[ROW][C]116[/C][C]0.3771[/C][C]0.2735[/C][C]0.2006[/C][C]0.2127[/C][C]753047.3577[/C][C]349870.0009[/C][C]591.4981[/C][C]1.632[/C][C]1.0268[/C][/ROW]
[ROW][C]117[/C][C]0.4131[/C][C]-0.1662[/C][C]0.192[/C][C]0.1979[/C][C]106141.427[/C][C]288937.8574[/C][C]537.5294[/C][C]-0.6127[/C][C]0.9233[/C][/ROW]
[ROW][C]118[/C][C]0.4013[/C][C]0.1651[/C][C]0.1866[/C][C]0.1943[/C][C]253988.114[/C][C]281947.9087[/C][C]530.9877[/C][C]0.9478[/C][C]0.9282[/C][/ROW]
[ROW][C]119[/C][C]0.4615[/C][C]-0.0719[/C][C]0.1675[/C][C]0.1735[/C][C]23921.909[/C][C]238943.5754[/C][C]488.8186[/C][C]-0.2909[/C][C]0.822[/C][/ROW]
[ROW][C]120[/C][C]0.5009[/C][C]0.1114[/C][C]0.1595[/C][C]0.1655[/C][C]77139.917[/C][C]215828.7671[/C][C]464.5737[/C][C]0.5223[/C][C]0.7792[/C][/ROW]
[ROW][C]121[/C][C]0.5248[/C][C]0.1946[/C][C]0.1639[/C][C]0.1718[/C][C]286716.8821[/C][C]224689.7815[/C][C]474.0145[/C][C]1.007[/C][C]0.8076[/C][/ROW]
[ROW][C]122[/C][C]0.525[/C][C]0.0931[/C][C]0.156[/C][C]0.1636[/C][C]56035.6429[/C][C]205950.4327[/C][C]453.8176[/C][C]0.4452[/C][C]0.7674[/C][/ROW]
[ROW][C]123[/C][C]0.6224[/C][C]0.0073[/C][C]0.1411[/C][C]0.1479[/C][C]220.5483[/C][C]185377.4443[/C][C]430.5548[/C][C]0.0279[/C][C]0.6934[/C][/ROW]
[ROW][C]124[/C][C]0.6136[/C][C]-0.0882[/C][C]0.1363[/C][C]0.1422[/C][C]29278.0876[/C][C]171186.5937[/C][C]413.747[/C][C]-0.3218[/C][C]0.6596[/C][/ROW]
[ROW][C]125[/C][C]0.5983[/C][C]-0.1913[/C][C]0.1409[/C][C]0.1449[/C][C]128905.6931[/C][C]167663.1853[/C][C]409.467[/C][C]-0.6752[/C][C]0.6609[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302797&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302797&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
1140.3384-0.19270.19270.1758149410.774700-0.72690.7269
1150.34570.13550.16410.1606147151.8702148281.3224385.07310.72140.7242
1160.37710.27350.20060.2127753047.3577349870.0009591.49811.6321.0268
1170.4131-0.16620.1920.1979106141.427288937.8574537.5294-0.61270.9233
1180.40130.16510.18660.1943253988.114281947.9087530.98770.94780.9282
1190.4615-0.07190.16750.173523921.909238943.5754488.8186-0.29090.822
1200.50090.11140.15950.165577139.917215828.7671464.57370.52230.7792
1210.52480.19460.16390.1718286716.8821224689.7815474.01451.0070.8076
1220.5250.09310.1560.163656035.6429205950.4327453.81760.44520.7674
1230.62240.00730.14110.1479220.5483185377.4443430.55480.02790.6934
1240.6136-0.08820.13630.142229278.0876171186.5937413.747-0.32180.6596
1250.5983-0.19130.14090.1449128905.6931167663.1853409.467-0.67520.6609



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