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, 19 Dec 2016 14:42:54 +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/19/t1482155006z3dctdtd5jwltwb.htm/, Retrieved Fri, 01 Nov 2024 03:29:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301352, Retrieved Fri, 01 Nov 2024 03:29:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact106
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecasting ] [2016-12-19 13:42:54] [c126b310dbdf6496413f2aa350bebe01] [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 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=301352&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=301352&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301352&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[113])
1012601-------
1023178-------
1034193-------
1042606-------
1052491-------
1064090-------
1072786-------
1082280-------
1092403-------
1102934-------
1111601-------
1121946-------
1132554-------
11420062523.7111834.51314212.90910.2740.4860.22390.486
11528303055.09921332.39474777.80370.39890.88370.09770.7157
11631732762.78041007.20894518.3520.32350.47010.56950.5922
11719602246.9344459.14034.76890.37650.1550.39450.3682
11830523085.52381265.99834905.04930.48560.88730.13960.7165
11921512857.16231006.48854707.83620.22730.41830.530.6259
12024932204.9586323.6524086.26520.38210.52240.46880.3581
12127522310.3166398.94734221.68590.32530.42570.46210.4013
12225422068.7427127.71014009.77530.31640.24510.19110.3121
12320271806.5165-163.73283776.76580.41320.23220.5810.2286
12419402332.5912333.55214331.63020.35010.61780.64770.4141
12518772357.2278329.80774384.64780.32120.65670.42460.4246

\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 & 2523.7111 & 834.5131 & 4212.9091 & 0.274 & 0.486 & 0.2239 & 0.486 \tabularnewline
115 & 2830 & 3055.0992 & 1332.3947 & 4777.8037 & 0.3989 & 0.8837 & 0.0977 & 0.7157 \tabularnewline
116 & 3173 & 2762.7804 & 1007.2089 & 4518.352 & 0.3235 & 0.4701 & 0.5695 & 0.5922 \tabularnewline
117 & 1960 & 2246.9344 & 459.1 & 4034.7689 & 0.3765 & 0.155 & 0.3945 & 0.3682 \tabularnewline
118 & 3052 & 3085.5238 & 1265.9983 & 4905.0493 & 0.4856 & 0.8873 & 0.1396 & 0.7165 \tabularnewline
119 & 2151 & 2857.1623 & 1006.4885 & 4707.8362 & 0.2273 & 0.4183 & 0.53 & 0.6259 \tabularnewline
120 & 2493 & 2204.9586 & 323.652 & 4086.2652 & 0.3821 & 0.5224 & 0.4688 & 0.3581 \tabularnewline
121 & 2752 & 2310.3166 & 398.9473 & 4221.6859 & 0.3253 & 0.4257 & 0.4621 & 0.4013 \tabularnewline
122 & 2542 & 2068.7427 & 127.7101 & 4009.7753 & 0.3164 & 0.2451 & 0.1911 & 0.3121 \tabularnewline
123 & 2027 & 1806.5165 & -163.7328 & 3776.7658 & 0.4132 & 0.2322 & 0.581 & 0.2286 \tabularnewline
124 & 1940 & 2332.5912 & 333.5521 & 4331.6302 & 0.3501 & 0.6178 & 0.6477 & 0.4141 \tabularnewline
125 & 1877 & 2357.2278 & 329.8077 & 4384.6478 & 0.3212 & 0.6567 & 0.4246 & 0.4246 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301352&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]2523.7111[/C][C]834.5131[/C][C]4212.9091[/C][C]0.274[/C][C]0.486[/C][C]0.2239[/C][C]0.486[/C][/ROW]
[ROW][C]115[/C][C]2830[/C][C]3055.0992[/C][C]1332.3947[/C][C]4777.8037[/C][C]0.3989[/C][C]0.8837[/C][C]0.0977[/C][C]0.7157[/C][/ROW]
[ROW][C]116[/C][C]3173[/C][C]2762.7804[/C][C]1007.2089[/C][C]4518.352[/C][C]0.3235[/C][C]0.4701[/C][C]0.5695[/C][C]0.5922[/C][/ROW]
[ROW][C]117[/C][C]1960[/C][C]2246.9344[/C][C]459.1[/C][C]4034.7689[/C][C]0.3765[/C][C]0.155[/C][C]0.3945[/C][C]0.3682[/C][/ROW]
[ROW][C]118[/C][C]3052[/C][C]3085.5238[/C][C]1265.9983[/C][C]4905.0493[/C][C]0.4856[/C][C]0.8873[/C][C]0.1396[/C][C]0.7165[/C][/ROW]
[ROW][C]119[/C][C]2151[/C][C]2857.1623[/C][C]1006.4885[/C][C]4707.8362[/C][C]0.2273[/C][C]0.4183[/C][C]0.53[/C][C]0.6259[/C][/ROW]
[ROW][C]120[/C][C]2493[/C][C]2204.9586[/C][C]323.652[/C][C]4086.2652[/C][C]0.3821[/C][C]0.5224[/C][C]0.4688[/C][C]0.3581[/C][/ROW]
[ROW][C]121[/C][C]2752[/C][C]2310.3166[/C][C]398.9473[/C][C]4221.6859[/C][C]0.3253[/C][C]0.4257[/C][C]0.4621[/C][C]0.4013[/C][/ROW]
[ROW][C]122[/C][C]2542[/C][C]2068.7427[/C][C]127.7101[/C][C]4009.7753[/C][C]0.3164[/C][C]0.2451[/C][C]0.1911[/C][C]0.3121[/C][/ROW]
[ROW][C]123[/C][C]2027[/C][C]1806.5165[/C][C]-163.7328[/C][C]3776.7658[/C][C]0.4132[/C][C]0.2322[/C][C]0.581[/C][C]0.2286[/C][/ROW]
[ROW][C]124[/C][C]1940[/C][C]2332.5912[/C][C]333.5521[/C][C]4331.6302[/C][C]0.3501[/C][C]0.6178[/C][C]0.6477[/C][C]0.4141[/C][/ROW]
[ROW][C]125[/C][C]1877[/C][C]2357.2278[/C][C]329.8077[/C][C]4384.6478[/C][C]0.3212[/C][C]0.6567[/C][C]0.4246[/C][C]0.4246[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301352&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301352&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-------
11420062523.7111834.51314212.90910.2740.4860.22390.486
11528303055.09921332.39474777.80370.39890.88370.09770.7157
11631732762.78041007.20894518.3520.32350.47010.56950.5922
11719602246.9344459.14034.76890.37650.1550.39450.3682
11830523085.52381265.99834905.04930.48560.88730.13960.7165
11921512857.16231006.48854707.83620.22730.41830.530.6259
12024932204.9586323.6524086.26520.38210.52240.46880.3581
12127522310.3166398.94734221.68590.32530.42570.46210.4013
12225422068.7427127.71014009.77530.31640.24510.19110.3121
12320271806.5165-163.73283776.76580.41320.23220.5810.2286
12419402332.5912333.55214331.63020.35010.61780.64770.4141
12518772357.2278329.80774384.64780.32120.65670.42460.4246







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1140.3415-0.25810.25810.2286268024.787200-0.97360.9736
1150.2877-0.07950.16880.152550669.6521159347.2197399.1832-0.42330.6985
1160.32420.12930.15560.1478168280.0924162324.8439402.89560.77150.7228
1170.406-0.14640.15330.144982331.378142326.4775377.2618-0.53960.677
1180.3009-0.0110.12490.11811123.8453114085.951337.7661-0.0630.5542
1190.3305-0.32830.15880.1454498665.2367178182.4986422.1167-1.32810.6832
1200.43530.11550.15260.142282967.8392164580.4044405.68510.54170.663
1210.42210.16050.15360.1462195084.2334168393.3831410.35760.83070.6839
1220.47870.18620.15720.1528223972.453174568.8353417.81440.890.7068
1230.55640.10880.15240.14948612.9876161973.2505402.4590.41470.6776
1240.4372-0.20240.15690.1522154127.8365161260.0311401.572-0.73830.6831
1250.4388-0.25580.16510.1584230618.7211167039.9219408.7052-0.90310.7015

\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.3415 & -0.2581 & 0.2581 & 0.2286 & 268024.7872 & 0 & 0 & -0.9736 & 0.9736 \tabularnewline
115 & 0.2877 & -0.0795 & 0.1688 & 0.1525 & 50669.6521 & 159347.2197 & 399.1832 & -0.4233 & 0.6985 \tabularnewline
116 & 0.3242 & 0.1293 & 0.1556 & 0.1478 & 168280.0924 & 162324.8439 & 402.8956 & 0.7715 & 0.7228 \tabularnewline
117 & 0.406 & -0.1464 & 0.1533 & 0.1449 & 82331.378 & 142326.4775 & 377.2618 & -0.5396 & 0.677 \tabularnewline
118 & 0.3009 & -0.011 & 0.1249 & 0.1181 & 1123.8453 & 114085.951 & 337.7661 & -0.063 & 0.5542 \tabularnewline
119 & 0.3305 & -0.3283 & 0.1588 & 0.1454 & 498665.2367 & 178182.4986 & 422.1167 & -1.3281 & 0.6832 \tabularnewline
120 & 0.4353 & 0.1155 & 0.1526 & 0.1422 & 82967.8392 & 164580.4044 & 405.6851 & 0.5417 & 0.663 \tabularnewline
121 & 0.4221 & 0.1605 & 0.1536 & 0.1462 & 195084.2334 & 168393.3831 & 410.3576 & 0.8307 & 0.6839 \tabularnewline
122 & 0.4787 & 0.1862 & 0.1572 & 0.1528 & 223972.453 & 174568.8353 & 417.8144 & 0.89 & 0.7068 \tabularnewline
123 & 0.5564 & 0.1088 & 0.1524 & 0.149 & 48612.9876 & 161973.2505 & 402.459 & 0.4147 & 0.6776 \tabularnewline
124 & 0.4372 & -0.2024 & 0.1569 & 0.1522 & 154127.8365 & 161260.0311 & 401.572 & -0.7383 & 0.6831 \tabularnewline
125 & 0.4388 & -0.2558 & 0.1651 & 0.1584 & 230618.7211 & 167039.9219 & 408.7052 & -0.9031 & 0.7015 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301352&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.3415[/C][C]-0.2581[/C][C]0.2581[/C][C]0.2286[/C][C]268024.7872[/C][C]0[/C][C]0[/C][C]-0.9736[/C][C]0.9736[/C][/ROW]
[ROW][C]115[/C][C]0.2877[/C][C]-0.0795[/C][C]0.1688[/C][C]0.1525[/C][C]50669.6521[/C][C]159347.2197[/C][C]399.1832[/C][C]-0.4233[/C][C]0.6985[/C][/ROW]
[ROW][C]116[/C][C]0.3242[/C][C]0.1293[/C][C]0.1556[/C][C]0.1478[/C][C]168280.0924[/C][C]162324.8439[/C][C]402.8956[/C][C]0.7715[/C][C]0.7228[/C][/ROW]
[ROW][C]117[/C][C]0.406[/C][C]-0.1464[/C][C]0.1533[/C][C]0.1449[/C][C]82331.378[/C][C]142326.4775[/C][C]377.2618[/C][C]-0.5396[/C][C]0.677[/C][/ROW]
[ROW][C]118[/C][C]0.3009[/C][C]-0.011[/C][C]0.1249[/C][C]0.1181[/C][C]1123.8453[/C][C]114085.951[/C][C]337.7661[/C][C]-0.063[/C][C]0.5542[/C][/ROW]
[ROW][C]119[/C][C]0.3305[/C][C]-0.3283[/C][C]0.1588[/C][C]0.1454[/C][C]498665.2367[/C][C]178182.4986[/C][C]422.1167[/C][C]-1.3281[/C][C]0.6832[/C][/ROW]
[ROW][C]120[/C][C]0.4353[/C][C]0.1155[/C][C]0.1526[/C][C]0.1422[/C][C]82967.8392[/C][C]164580.4044[/C][C]405.6851[/C][C]0.5417[/C][C]0.663[/C][/ROW]
[ROW][C]121[/C][C]0.4221[/C][C]0.1605[/C][C]0.1536[/C][C]0.1462[/C][C]195084.2334[/C][C]168393.3831[/C][C]410.3576[/C][C]0.8307[/C][C]0.6839[/C][/ROW]
[ROW][C]122[/C][C]0.4787[/C][C]0.1862[/C][C]0.1572[/C][C]0.1528[/C][C]223972.453[/C][C]174568.8353[/C][C]417.8144[/C][C]0.89[/C][C]0.7068[/C][/ROW]
[ROW][C]123[/C][C]0.5564[/C][C]0.1088[/C][C]0.1524[/C][C]0.149[/C][C]48612.9876[/C][C]161973.2505[/C][C]402.459[/C][C]0.4147[/C][C]0.6776[/C][/ROW]
[ROW][C]124[/C][C]0.4372[/C][C]-0.2024[/C][C]0.1569[/C][C]0.1522[/C][C]154127.8365[/C][C]161260.0311[/C][C]401.572[/C][C]-0.7383[/C][C]0.6831[/C][/ROW]
[ROW][C]125[/C][C]0.4388[/C][C]-0.2558[/C][C]0.1651[/C][C]0.1584[/C][C]230618.7211[/C][C]167039.9219[/C][C]408.7052[/C][C]-0.9031[/C][C]0.7015[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301352&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301352&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.3415-0.25810.25810.2286268024.787200-0.97360.9736
1150.2877-0.07950.16880.152550669.6521159347.2197399.1832-0.42330.6985
1160.32420.12930.15560.1478168280.0924162324.8439402.89560.77150.7228
1170.406-0.14640.15330.144982331.378142326.4775377.2618-0.53960.677
1180.3009-0.0110.12490.11811123.8453114085.951337.7661-0.0630.5542
1190.3305-0.32830.15880.1454498665.2367178182.4986422.1167-1.32810.6832
1200.43530.11550.15260.142282967.8392164580.4044405.68510.54170.663
1210.42210.16050.15360.1462195084.2334168393.3831410.35760.83070.6839
1220.47870.18620.15720.1528223972.453174568.8353417.81440.890.7068
1230.55640.10880.15240.14948612.9876161973.2505402.4590.41470.6776
1240.4372-0.20240.15690.1522154127.8365161260.0311401.572-0.73830.6831
1250.4388-0.25580.16510.1584230618.7211167039.9219408.7052-0.90310.7015



Parameters (Session):
par1 = 200greygreygrey1251240201010101012 ; par2 = 5nonono1111111 ; par3 = 00000001 ; par4 = P1 P5 Q1 Q3 P95 P990000001 ; par5 = 11111112 ; par6 = 0000030 ; par7 = 0000001 ; par8 = 0000000 ; par9 = 0000001 ; par10 = FALSEFALSEFALSETRUEFALSEFALSEFALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '0'
par7 <- '0'
par6 <- '3'
par5 <- '1'
par4 <- '0'
par3 <- '0'
par2 <- '1'
par1 <- '10'
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')