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, 15 Dec 2016 22:51:03 +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/15/t1481838882dzuw1nmipg7yri5.htm/, Retrieved Fri, 01 Nov 2024 03:44:16 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300029, Retrieved Fri, 01 Nov 2024 03:44:16 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsF1 competition
Estimated Impact96
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2016-12-15 21:51:03] [00d6a26c230b6c589ee3bbc701d55499] [Current]
Feedback Forum

Post a new message
Dataseries X:
3840
3140
4580
4740
3920
4900
3400
3440
2600
2220
2190
2550
2720
3720
4710
5070
6030
5280
4420
3940
2750
2980
2690
2650
4000
4150
6050
6280
5520
4800
4610
3530
2790
2750
2470
2610
3680
3820
4460
4760
3290
3610
3650
3130
2850
2720
2740
2760
3330
3850
5430
5180
4770
5360
4950
3720
3330
3000
2760
3040
3260
3780
4670
4320
4080
4210
3350
3390
2630
2350
2330
2230
2830
3230
4240
3750
4160
3960
3000
2890
2300
2320
2270
1970
2920
3310
4370
3990
3970
3850
3510
2840
2130
2280
1960
1740
2370
1980
2680
3510
3350
3290
3150
2490
2490
2930
3590
2040
2480
2760
3400
3470
3130
3670
3080
2430




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300029&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[104])
922840-------
932130-------
942280-------
951960-------
961740-------
972370-------
981980-------
992680-------
1003510-------
1013350-------
1023290-------
1033150-------
1042490-------
10524902018.85531640.52482484.43470.02370.02370.31990.0237
10629302019.14841600.07112547.98694e-040.04050.16680.0405
10735901811.11491403.30922337.4301000.28960.0057
10820401860.45511378.71532510.52050.294100.64180.0288
10924802413.4611757.89853313.49840.44240.7920.53770.4338
11027602554.02041812.35463599.19650.34960.55520.85910.5478
11134003424.76292373.68444941.26390.48720.80490.83210.8865
11234703452.72732350.01025072.88250.49170.52540.47240.8779
11331303240.83672158.68794865.4660.44680.39110.44760.8175
11436703272.31142140.51855002.53670.32620.5640.4920.8122
11530802831.69961819.79834406.26980.37860.14840.3460.6647
11624302461.41931553.88673898.98750.48290.19950.48450.4845

\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[104]) \tabularnewline
92 & 2840 & - & - & - & - & - & - & - \tabularnewline
93 & 2130 & - & - & - & - & - & - & - \tabularnewline
94 & 2280 & - & - & - & - & - & - & - \tabularnewline
95 & 1960 & - & - & - & - & - & - & - \tabularnewline
96 & 1740 & - & - & - & - & - & - & - \tabularnewline
97 & 2370 & - & - & - & - & - & - & - \tabularnewline
98 & 1980 & - & - & - & - & - & - & - \tabularnewline
99 & 2680 & - & - & - & - & - & - & - \tabularnewline
100 & 3510 & - & - & - & - & - & - & - \tabularnewline
101 & 3350 & - & - & - & - & - & - & - \tabularnewline
102 & 3290 & - & - & - & - & - & - & - \tabularnewline
103 & 3150 & - & - & - & - & - & - & - \tabularnewline
104 & 2490 & - & - & - & - & - & - & - \tabularnewline
105 & 2490 & 2018.8553 & 1640.5248 & 2484.4347 & 0.0237 & 0.0237 & 0.3199 & 0.0237 \tabularnewline
106 & 2930 & 2019.1484 & 1600.0711 & 2547.9869 & 4e-04 & 0.0405 & 0.1668 & 0.0405 \tabularnewline
107 & 3590 & 1811.1149 & 1403.3092 & 2337.4301 & 0 & 0 & 0.2896 & 0.0057 \tabularnewline
108 & 2040 & 1860.4551 & 1378.7153 & 2510.5205 & 0.2941 & 0 & 0.6418 & 0.0288 \tabularnewline
109 & 2480 & 2413.461 & 1757.8985 & 3313.4984 & 0.4424 & 0.792 & 0.5377 & 0.4338 \tabularnewline
110 & 2760 & 2554.0204 & 1812.3546 & 3599.1965 & 0.3496 & 0.5552 & 0.8591 & 0.5478 \tabularnewline
111 & 3400 & 3424.7629 & 2373.6844 & 4941.2639 & 0.4872 & 0.8049 & 0.8321 & 0.8865 \tabularnewline
112 & 3470 & 3452.7273 & 2350.0102 & 5072.8825 & 0.4917 & 0.5254 & 0.4724 & 0.8779 \tabularnewline
113 & 3130 & 3240.8367 & 2158.6879 & 4865.466 & 0.4468 & 0.3911 & 0.4476 & 0.8175 \tabularnewline
114 & 3670 & 3272.3114 & 2140.5185 & 5002.5367 & 0.3262 & 0.564 & 0.492 & 0.8122 \tabularnewline
115 & 3080 & 2831.6996 & 1819.7983 & 4406.2698 & 0.3786 & 0.1484 & 0.346 & 0.6647 \tabularnewline
116 & 2430 & 2461.4193 & 1553.8867 & 3898.9875 & 0.4829 & 0.1995 & 0.4845 & 0.4845 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300029&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[104])[/C][/ROW]
[ROW][C]92[/C][C]2840[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]2130[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]2280[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]1960[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]1740[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2370[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]1980[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]2680[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]3510[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]3350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]3290[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]3150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]2490[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]2490[/C][C]2018.8553[/C][C]1640.5248[/C][C]2484.4347[/C][C]0.0237[/C][C]0.0237[/C][C]0.3199[/C][C]0.0237[/C][/ROW]
[ROW][C]106[/C][C]2930[/C][C]2019.1484[/C][C]1600.0711[/C][C]2547.9869[/C][C]4e-04[/C][C]0.0405[/C][C]0.1668[/C][C]0.0405[/C][/ROW]
[ROW][C]107[/C][C]3590[/C][C]1811.1149[/C][C]1403.3092[/C][C]2337.4301[/C][C]0[/C][C]0[/C][C]0.2896[/C][C]0.0057[/C][/ROW]
[ROW][C]108[/C][C]2040[/C][C]1860.4551[/C][C]1378.7153[/C][C]2510.5205[/C][C]0.2941[/C][C]0[/C][C]0.6418[/C][C]0.0288[/C][/ROW]
[ROW][C]109[/C][C]2480[/C][C]2413.461[/C][C]1757.8985[/C][C]3313.4984[/C][C]0.4424[/C][C]0.792[/C][C]0.5377[/C][C]0.4338[/C][/ROW]
[ROW][C]110[/C][C]2760[/C][C]2554.0204[/C][C]1812.3546[/C][C]3599.1965[/C][C]0.3496[/C][C]0.5552[/C][C]0.8591[/C][C]0.5478[/C][/ROW]
[ROW][C]111[/C][C]3400[/C][C]3424.7629[/C][C]2373.6844[/C][C]4941.2639[/C][C]0.4872[/C][C]0.8049[/C][C]0.8321[/C][C]0.8865[/C][/ROW]
[ROW][C]112[/C][C]3470[/C][C]3452.7273[/C][C]2350.0102[/C][C]5072.8825[/C][C]0.4917[/C][C]0.5254[/C][C]0.4724[/C][C]0.8779[/C][/ROW]
[ROW][C]113[/C][C]3130[/C][C]3240.8367[/C][C]2158.6879[/C][C]4865.466[/C][C]0.4468[/C][C]0.3911[/C][C]0.4476[/C][C]0.8175[/C][/ROW]
[ROW][C]114[/C][C]3670[/C][C]3272.3114[/C][C]2140.5185[/C][C]5002.5367[/C][C]0.3262[/C][C]0.564[/C][C]0.492[/C][C]0.8122[/C][/ROW]
[ROW][C]115[/C][C]3080[/C][C]2831.6996[/C][C]1819.7983[/C][C]4406.2698[/C][C]0.3786[/C][C]0.1484[/C][C]0.346[/C][C]0.6647[/C][/ROW]
[ROW][C]116[/C][C]2430[/C][C]2461.4193[/C][C]1553.8867[/C][C]3898.9875[/C][C]0.4829[/C][C]0.1995[/C][C]0.4845[/C][C]0.4845[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300029&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300029&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[104])
922840-------
932130-------
942280-------
951960-------
961740-------
972370-------
981980-------
992680-------
1003510-------
1013350-------
1023290-------
1033150-------
1042490-------
10524902018.85531640.52482484.43470.02370.02370.31990.0237
10629302019.14841600.07112547.98694e-040.04050.16680.0405
10735901811.11491403.30922337.4301000.28960.0057
10820401860.45511378.71532510.52050.294100.64180.0288
10924802413.4611757.89853313.49840.44240.7920.53770.4338
11027602554.02041812.35463599.19650.34960.55520.85910.5478
11134003424.76292373.68444941.26390.48720.80490.83210.8865
11234703452.72732350.01025072.88250.49170.52540.47240.8779
11331303240.83672158.68794865.4660.44680.39110.44760.8175
11436703272.31142140.51855002.53670.32620.5640.4920.8122
11530802831.69961819.79834406.26980.37860.14840.3460.6647
11624302461.41931553.88673898.98750.48290.19950.48450.4845







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1050.11770.18920.18920.209221977.3325000.83590.8359
1060.13360.31090.250.2885829650.6408525813.9867725.13031.6161.226
1070.14830.49550.33190.41193164432.08121405353.35151185.4763.15611.8693
1080.17830.0880.27090.33232236.38451062074.10981030.56980.31851.4816
1090.19030.02680.22210.2714427.438850544.7754922.24980.11811.2089
1100.20880.07460.19750.238842427.6011715858.5797846.08430.36541.0683
1110.2259-0.00730.17030.2057613.2029613680.6687783.3777-0.04390.922
1120.23940.0050.14970.1806298.3457537007.8783732.80820.03060.8106
1130.2558-0.03540.1370.164412284.7726478705.311691.8853-0.19660.7424
1140.26980.10840.13410.1594158156.1902446650.399668.31910.70560.7387
1150.28370.08060.12920.152661653.0998411650.6445641.60010.44050.7116
1160.298-0.01290.11960.1409987.1733377428.6886614.3523-0.05570.6569

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
105 & 0.1177 & 0.1892 & 0.1892 & 0.209 & 221977.3325 & 0 & 0 & 0.8359 & 0.8359 \tabularnewline
106 & 0.1336 & 0.3109 & 0.25 & 0.2885 & 829650.6408 & 525813.9867 & 725.1303 & 1.616 & 1.226 \tabularnewline
107 & 0.1483 & 0.4955 & 0.3319 & 0.4119 & 3164432.0812 & 1405353.3515 & 1185.476 & 3.1561 & 1.8693 \tabularnewline
108 & 0.1783 & 0.088 & 0.2709 & 0.332 & 32236.3845 & 1062074.1098 & 1030.5698 & 0.3185 & 1.4816 \tabularnewline
109 & 0.1903 & 0.0268 & 0.2221 & 0.271 & 4427.438 & 850544.7754 & 922.2498 & 0.1181 & 1.2089 \tabularnewline
110 & 0.2088 & 0.0746 & 0.1975 & 0.2388 & 42427.6011 & 715858.5797 & 846.0843 & 0.3654 & 1.0683 \tabularnewline
111 & 0.2259 & -0.0073 & 0.1703 & 0.2057 & 613.2029 & 613680.6687 & 783.3777 & -0.0439 & 0.922 \tabularnewline
112 & 0.2394 & 0.005 & 0.1497 & 0.1806 & 298.3457 & 537007.8783 & 732.8082 & 0.0306 & 0.8106 \tabularnewline
113 & 0.2558 & -0.0354 & 0.137 & 0.1644 & 12284.7726 & 478705.311 & 691.8853 & -0.1966 & 0.7424 \tabularnewline
114 & 0.2698 & 0.1084 & 0.1341 & 0.1594 & 158156.1902 & 446650.399 & 668.3191 & 0.7056 & 0.7387 \tabularnewline
115 & 0.2837 & 0.0806 & 0.1292 & 0.1526 & 61653.0998 & 411650.6445 & 641.6001 & 0.4405 & 0.7116 \tabularnewline
116 & 0.298 & -0.0129 & 0.1196 & 0.1409 & 987.1733 & 377428.6886 & 614.3523 & -0.0557 & 0.6569 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300029&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]105[/C][C]0.1177[/C][C]0.1892[/C][C]0.1892[/C][C]0.209[/C][C]221977.3325[/C][C]0[/C][C]0[/C][C]0.8359[/C][C]0.8359[/C][/ROW]
[ROW][C]106[/C][C]0.1336[/C][C]0.3109[/C][C]0.25[/C][C]0.2885[/C][C]829650.6408[/C][C]525813.9867[/C][C]725.1303[/C][C]1.616[/C][C]1.226[/C][/ROW]
[ROW][C]107[/C][C]0.1483[/C][C]0.4955[/C][C]0.3319[/C][C]0.4119[/C][C]3164432.0812[/C][C]1405353.3515[/C][C]1185.476[/C][C]3.1561[/C][C]1.8693[/C][/ROW]
[ROW][C]108[/C][C]0.1783[/C][C]0.088[/C][C]0.2709[/C][C]0.332[/C][C]32236.3845[/C][C]1062074.1098[/C][C]1030.5698[/C][C]0.3185[/C][C]1.4816[/C][/ROW]
[ROW][C]109[/C][C]0.1903[/C][C]0.0268[/C][C]0.2221[/C][C]0.271[/C][C]4427.438[/C][C]850544.7754[/C][C]922.2498[/C][C]0.1181[/C][C]1.2089[/C][/ROW]
[ROW][C]110[/C][C]0.2088[/C][C]0.0746[/C][C]0.1975[/C][C]0.2388[/C][C]42427.6011[/C][C]715858.5797[/C][C]846.0843[/C][C]0.3654[/C][C]1.0683[/C][/ROW]
[ROW][C]111[/C][C]0.2259[/C][C]-0.0073[/C][C]0.1703[/C][C]0.2057[/C][C]613.2029[/C][C]613680.6687[/C][C]783.3777[/C][C]-0.0439[/C][C]0.922[/C][/ROW]
[ROW][C]112[/C][C]0.2394[/C][C]0.005[/C][C]0.1497[/C][C]0.1806[/C][C]298.3457[/C][C]537007.8783[/C][C]732.8082[/C][C]0.0306[/C][C]0.8106[/C][/ROW]
[ROW][C]113[/C][C]0.2558[/C][C]-0.0354[/C][C]0.137[/C][C]0.1644[/C][C]12284.7726[/C][C]478705.311[/C][C]691.8853[/C][C]-0.1966[/C][C]0.7424[/C][/ROW]
[ROW][C]114[/C][C]0.2698[/C][C]0.1084[/C][C]0.1341[/C][C]0.1594[/C][C]158156.1902[/C][C]446650.399[/C][C]668.3191[/C][C]0.7056[/C][C]0.7387[/C][/ROW]
[ROW][C]115[/C][C]0.2837[/C][C]0.0806[/C][C]0.1292[/C][C]0.1526[/C][C]61653.0998[/C][C]411650.6445[/C][C]641.6001[/C][C]0.4405[/C][C]0.7116[/C][/ROW]
[ROW][C]116[/C][C]0.298[/C][C]-0.0129[/C][C]0.1196[/C][C]0.1409[/C][C]987.1733[/C][C]377428.6886[/C][C]614.3523[/C][C]-0.0557[/C][C]0.6569[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300029&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300029&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
1050.11770.18920.18920.209221977.3325000.83590.8359
1060.13360.31090.250.2885829650.6408525813.9867725.13031.6161.226
1070.14830.49550.33190.41193164432.08121405353.35151185.4763.15611.8693
1080.17830.0880.27090.33232236.38451062074.10981030.56980.31851.4816
1090.19030.02680.22210.2714427.438850544.7754922.24980.11811.2089
1100.20880.07460.19750.238842427.6011715858.5797846.08430.36541.0683
1110.2259-0.00730.17030.2057613.2029613680.6687783.3777-0.04390.922
1120.23940.0050.14970.1806298.3457537007.8783732.80820.03060.8106
1130.2558-0.03540.1370.164412284.7726478705.311691.8853-0.19660.7424
1140.26980.10840.13410.1594158156.1902446650.399668.31910.70560.7387
1150.28370.08060.12920.152661653.0998411650.6445641.60010.44050.7116
1160.298-0.01290.11960.1409987.1733377428.6886614.3523-0.05570.6569



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