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 computationThu, 22 Dec 2016 23:41:18 +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/22/t1482446611wilrb0qkiky0xjd.htm/, Retrieved Mon, 29 Apr 2024 01:11:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302722, Retrieved Mon, 29 Apr 2024 01:11:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact73
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forcasting ...] [2016-12-22 22:41:18] [d4ebbcc95b180bc93fc42d05f31a3dde] [Current]
Feedback Forum

Post a new message
Dataseries X:
5500
3860
4880
4420
4900
4230
3970
4690
4190
4960
5590
5000
6030
4690
4090
5070
5050
4520
5070
4290
4400
5080
4180
5230
5200
3800
5010
4420
4810
4690
5390
4730
4770
4690
4450
5400
5590
4360
5370
4660
4450
4980
4590
4580
4290
4840
5100
6170
5990
4950
5310




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302722&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[39])
275010-------
284420-------
294810-------
304690-------
315390-------
324730-------
334770-------
344690-------
354450-------
365400-------
375590-------
384360-------
395370-------
4046604665.20513753.30995577.10040.49550.06490.70090.0649
4144504900.71413986.93295814.49530.16680.69720.57710.1571
4249804634.66163720.2985549.02520.22960.65390.45280.0575
4345904841.93973927.26985756.60960.29460.38370.12010.1289
4445804686.06733771.06925601.06550.41010.58150.46250.0715
4542904620.14993704.82615535.47370.23980.53430.37420.0542
4648404886.90833971.265802.55660.460.89930.66330.1505
4751004778.51883862.53885694.49870.24580.44770.7590.1028
4861705069.91444153.78465986.04420.00930.47430.240.2604
4959905344.56484437.51036251.61930.08160.03720.29790.4781
5049504419.03833511.66455326.4120.12573e-040.55070.02
5153104866.71883959.02625774.41150.16920.42860.13860.1386

\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[39]) \tabularnewline
27 & 5010 & - & - & - & - & - & - & - \tabularnewline
28 & 4420 & - & - & - & - & - & - & - \tabularnewline
29 & 4810 & - & - & - & - & - & - & - \tabularnewline
30 & 4690 & - & - & - & - & - & - & - \tabularnewline
31 & 5390 & - & - & - & - & - & - & - \tabularnewline
32 & 4730 & - & - & - & - & - & - & - \tabularnewline
33 & 4770 & - & - & - & - & - & - & - \tabularnewline
34 & 4690 & - & - & - & - & - & - & - \tabularnewline
35 & 4450 & - & - & - & - & - & - & - \tabularnewline
36 & 5400 & - & - & - & - & - & - & - \tabularnewline
37 & 5590 & - & - & - & - & - & - & - \tabularnewline
38 & 4360 & - & - & - & - & - & - & - \tabularnewline
39 & 5370 & - & - & - & - & - & - & - \tabularnewline
40 & 4660 & 4665.2051 & 3753.3099 & 5577.1004 & 0.4955 & 0.0649 & 0.7009 & 0.0649 \tabularnewline
41 & 4450 & 4900.7141 & 3986.9329 & 5814.4953 & 0.1668 & 0.6972 & 0.5771 & 0.1571 \tabularnewline
42 & 4980 & 4634.6616 & 3720.298 & 5549.0252 & 0.2296 & 0.6539 & 0.4528 & 0.0575 \tabularnewline
43 & 4590 & 4841.9397 & 3927.2698 & 5756.6096 & 0.2946 & 0.3837 & 0.1201 & 0.1289 \tabularnewline
44 & 4580 & 4686.0673 & 3771.0692 & 5601.0655 & 0.4101 & 0.5815 & 0.4625 & 0.0715 \tabularnewline
45 & 4290 & 4620.1499 & 3704.8261 & 5535.4737 & 0.2398 & 0.5343 & 0.3742 & 0.0542 \tabularnewline
46 & 4840 & 4886.9083 & 3971.26 & 5802.5566 & 0.46 & 0.8993 & 0.6633 & 0.1505 \tabularnewline
47 & 5100 & 4778.5188 & 3862.5388 & 5694.4987 & 0.2458 & 0.4477 & 0.759 & 0.1028 \tabularnewline
48 & 6170 & 5069.9144 & 4153.7846 & 5986.0442 & 0.0093 & 0.4743 & 0.24 & 0.2604 \tabularnewline
49 & 5990 & 5344.5648 & 4437.5103 & 6251.6193 & 0.0816 & 0.0372 & 0.2979 & 0.4781 \tabularnewline
50 & 4950 & 4419.0383 & 3511.6645 & 5326.412 & 0.1257 & 3e-04 & 0.5507 & 0.02 \tabularnewline
51 & 5310 & 4866.7188 & 3959.0262 & 5774.4115 & 0.1692 & 0.4286 & 0.1386 & 0.1386 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302722&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[39])[/C][/ROW]
[ROW][C]27[/C][C]5010[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]4420[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]4810[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]4690[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]5390[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]4730[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]4770[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]4690[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]4450[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]5400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]5590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]4360[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]5370[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]4660[/C][C]4665.2051[/C][C]3753.3099[/C][C]5577.1004[/C][C]0.4955[/C][C]0.0649[/C][C]0.7009[/C][C]0.0649[/C][/ROW]
[ROW][C]41[/C][C]4450[/C][C]4900.7141[/C][C]3986.9329[/C][C]5814.4953[/C][C]0.1668[/C][C]0.6972[/C][C]0.5771[/C][C]0.1571[/C][/ROW]
[ROW][C]42[/C][C]4980[/C][C]4634.6616[/C][C]3720.298[/C][C]5549.0252[/C][C]0.2296[/C][C]0.6539[/C][C]0.4528[/C][C]0.0575[/C][/ROW]
[ROW][C]43[/C][C]4590[/C][C]4841.9397[/C][C]3927.2698[/C][C]5756.6096[/C][C]0.2946[/C][C]0.3837[/C][C]0.1201[/C][C]0.1289[/C][/ROW]
[ROW][C]44[/C][C]4580[/C][C]4686.0673[/C][C]3771.0692[/C][C]5601.0655[/C][C]0.4101[/C][C]0.5815[/C][C]0.4625[/C][C]0.0715[/C][/ROW]
[ROW][C]45[/C][C]4290[/C][C]4620.1499[/C][C]3704.8261[/C][C]5535.4737[/C][C]0.2398[/C][C]0.5343[/C][C]0.3742[/C][C]0.0542[/C][/ROW]
[ROW][C]46[/C][C]4840[/C][C]4886.9083[/C][C]3971.26[/C][C]5802.5566[/C][C]0.46[/C][C]0.8993[/C][C]0.6633[/C][C]0.1505[/C][/ROW]
[ROW][C]47[/C][C]5100[/C][C]4778.5188[/C][C]3862.5388[/C][C]5694.4987[/C][C]0.2458[/C][C]0.4477[/C][C]0.759[/C][C]0.1028[/C][/ROW]
[ROW][C]48[/C][C]6170[/C][C]5069.9144[/C][C]4153.7846[/C][C]5986.0442[/C][C]0.0093[/C][C]0.4743[/C][C]0.24[/C][C]0.2604[/C][/ROW]
[ROW][C]49[/C][C]5990[/C][C]5344.5648[/C][C]4437.5103[/C][C]6251.6193[/C][C]0.0816[/C][C]0.0372[/C][C]0.2979[/C][C]0.4781[/C][/ROW]
[ROW][C]50[/C][C]4950[/C][C]4419.0383[/C][C]3511.6645[/C][C]5326.412[/C][C]0.1257[/C][C]3e-04[/C][C]0.5507[/C][C]0.02[/C][/ROW]
[ROW][C]51[/C][C]5310[/C][C]4866.7188[/C][C]3959.0262[/C][C]5774.4115[/C][C]0.1692[/C][C]0.4286[/C][C]0.1386[/C][C]0.1386[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302722&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302722&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[39])
275010-------
284420-------
294810-------
304690-------
315390-------
324730-------
334770-------
344690-------
354450-------
365400-------
375590-------
384360-------
395370-------
4046604665.20513753.30995577.10040.49550.06490.70090.0649
4144504900.71413986.93295814.49530.16680.69720.57710.1571
4249804634.66163720.2985549.02520.22960.65390.45280.0575
4345904841.93973927.26985756.60960.29460.38370.12010.1289
4445804686.06733771.06925601.06550.41010.58150.46250.0715
4542904620.14993704.82615535.47370.23980.53430.37420.0542
4648404886.90833971.265802.55660.460.89930.66330.1505
4751004778.51883862.53885694.49870.24580.44770.7590.1028
4861705069.91444153.78465986.04420.00930.47430.240.2604
4959905344.56484437.51036251.61930.08160.03720.29790.4781
5049504419.03833511.66455326.4120.12573e-040.55070.02
5153104866.71883959.02625774.41150.16920.42860.13860.1386







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
400.0997-0.00110.00110.001127.093500-0.01170.0117
410.0951-0.10130.05120.0488203143.2306101585.1621318.7243-1.01390.5128
420.10070.06930.05720.0565119258.6283107476.3175327.83580.77680.6008
430.0964-0.05490.05670.055763473.602996475.6388310.6053-0.56670.5923
440.0996-0.02320.050.049111250.27879430.5667281.8343-0.23860.5216
450.1011-0.0770.05450.0533108998.970384358.6339290.4456-0.74270.5584
460.0956-0.00970.04810.04712200.387972621.7416269.4842-0.10550.4937
470.09780.0630.04990.0493103350.165576462.7946276.51910.72320.5224
480.09220.17830.06420.06561210188.3252202432.298449.92482.47460.7393
490.08660.10780.06860.0704416586.5648223847.7247473.12551.45190.8106
500.10480.10730.07210.0743281920.3706229127.0561478.67221.19440.8455
510.09520.08350.0730.0754196498.1827226407.9834475.82350.99720.8581

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
40 & 0.0997 & -0.0011 & 0.0011 & 0.0011 & 27.0935 & 0 & 0 & -0.0117 & 0.0117 \tabularnewline
41 & 0.0951 & -0.1013 & 0.0512 & 0.0488 & 203143.2306 & 101585.1621 & 318.7243 & -1.0139 & 0.5128 \tabularnewline
42 & 0.1007 & 0.0693 & 0.0572 & 0.0565 & 119258.6283 & 107476.3175 & 327.8358 & 0.7768 & 0.6008 \tabularnewline
43 & 0.0964 & -0.0549 & 0.0567 & 0.0557 & 63473.6029 & 96475.6388 & 310.6053 & -0.5667 & 0.5923 \tabularnewline
44 & 0.0996 & -0.0232 & 0.05 & 0.0491 & 11250.278 & 79430.5667 & 281.8343 & -0.2386 & 0.5216 \tabularnewline
45 & 0.1011 & -0.077 & 0.0545 & 0.0533 & 108998.9703 & 84358.6339 & 290.4456 & -0.7427 & 0.5584 \tabularnewline
46 & 0.0956 & -0.0097 & 0.0481 & 0.0471 & 2200.3879 & 72621.7416 & 269.4842 & -0.1055 & 0.4937 \tabularnewline
47 & 0.0978 & 0.063 & 0.0499 & 0.0493 & 103350.1655 & 76462.7946 & 276.5191 & 0.7232 & 0.5224 \tabularnewline
48 & 0.0922 & 0.1783 & 0.0642 & 0.0656 & 1210188.3252 & 202432.298 & 449.9248 & 2.4746 & 0.7393 \tabularnewline
49 & 0.0866 & 0.1078 & 0.0686 & 0.0704 & 416586.5648 & 223847.7247 & 473.1255 & 1.4519 & 0.8106 \tabularnewline
50 & 0.1048 & 0.1073 & 0.0721 & 0.0743 & 281920.3706 & 229127.0561 & 478.6722 & 1.1944 & 0.8455 \tabularnewline
51 & 0.0952 & 0.0835 & 0.073 & 0.0754 & 196498.1827 & 226407.9834 & 475.8235 & 0.9972 & 0.8581 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302722&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]40[/C][C]0.0997[/C][C]-0.0011[/C][C]0.0011[/C][C]0.0011[/C][C]27.0935[/C][C]0[/C][C]0[/C][C]-0.0117[/C][C]0.0117[/C][/ROW]
[ROW][C]41[/C][C]0.0951[/C][C]-0.1013[/C][C]0.0512[/C][C]0.0488[/C][C]203143.2306[/C][C]101585.1621[/C][C]318.7243[/C][C]-1.0139[/C][C]0.5128[/C][/ROW]
[ROW][C]42[/C][C]0.1007[/C][C]0.0693[/C][C]0.0572[/C][C]0.0565[/C][C]119258.6283[/C][C]107476.3175[/C][C]327.8358[/C][C]0.7768[/C][C]0.6008[/C][/ROW]
[ROW][C]43[/C][C]0.0964[/C][C]-0.0549[/C][C]0.0567[/C][C]0.0557[/C][C]63473.6029[/C][C]96475.6388[/C][C]310.6053[/C][C]-0.5667[/C][C]0.5923[/C][/ROW]
[ROW][C]44[/C][C]0.0996[/C][C]-0.0232[/C][C]0.05[/C][C]0.0491[/C][C]11250.278[/C][C]79430.5667[/C][C]281.8343[/C][C]-0.2386[/C][C]0.5216[/C][/ROW]
[ROW][C]45[/C][C]0.1011[/C][C]-0.077[/C][C]0.0545[/C][C]0.0533[/C][C]108998.9703[/C][C]84358.6339[/C][C]290.4456[/C][C]-0.7427[/C][C]0.5584[/C][/ROW]
[ROW][C]46[/C][C]0.0956[/C][C]-0.0097[/C][C]0.0481[/C][C]0.0471[/C][C]2200.3879[/C][C]72621.7416[/C][C]269.4842[/C][C]-0.1055[/C][C]0.4937[/C][/ROW]
[ROW][C]47[/C][C]0.0978[/C][C]0.063[/C][C]0.0499[/C][C]0.0493[/C][C]103350.1655[/C][C]76462.7946[/C][C]276.5191[/C][C]0.7232[/C][C]0.5224[/C][/ROW]
[ROW][C]48[/C][C]0.0922[/C][C]0.1783[/C][C]0.0642[/C][C]0.0656[/C][C]1210188.3252[/C][C]202432.298[/C][C]449.9248[/C][C]2.4746[/C][C]0.7393[/C][/ROW]
[ROW][C]49[/C][C]0.0866[/C][C]0.1078[/C][C]0.0686[/C][C]0.0704[/C][C]416586.5648[/C][C]223847.7247[/C][C]473.1255[/C][C]1.4519[/C][C]0.8106[/C][/ROW]
[ROW][C]50[/C][C]0.1048[/C][C]0.1073[/C][C]0.0721[/C][C]0.0743[/C][C]281920.3706[/C][C]229127.0561[/C][C]478.6722[/C][C]1.1944[/C][C]0.8455[/C][/ROW]
[ROW][C]51[/C][C]0.0952[/C][C]0.0835[/C][C]0.073[/C][C]0.0754[/C][C]196498.1827[/C][C]226407.9834[/C][C]475.8235[/C][C]0.9972[/C][C]0.8581[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302722&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302722&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
400.0997-0.00110.00110.001127.093500-0.01170.0117
410.0951-0.10130.05120.0488203143.2306101585.1621318.7243-1.01390.5128
420.10070.06930.05720.0565119258.6283107476.3175327.83580.77680.6008
430.0964-0.05490.05670.055763473.602996475.6388310.6053-0.56670.5923
440.0996-0.02320.050.049111250.27879430.5667281.8343-0.23860.5216
450.1011-0.0770.05450.0533108998.970384358.6339290.4456-0.74270.5584
460.0956-0.00970.04810.04712200.387972621.7416269.4842-0.10550.4937
470.09780.0630.04990.0493103350.165576462.7946276.51910.72320.5224
480.09220.17830.06420.06561210188.3252202432.298449.92482.47460.7393
490.08660.10780.06860.0704416586.5648223847.7247473.12551.45190.8106
500.10480.10730.07210.0743281920.3706229127.0561478.67221.19440.8455
510.09520.08350.0730.0754196498.1827226407.9834475.82350.99720.8581



Parameters (Session):
par1 = 1 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 2 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '1'
par8 <- '1'
par7 <- '1'
par6 <- '2'
par5 <- '12'
par4 <- '0'
par3 <- '0'
par2 <- '1'
par1 <- '0'
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')