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 13:52:31 +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/t1482151989wlzfyssnmw6p5jh.htm/, Retrieved Sat, 18 May 2024 02:28:28 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301333, Retrieved Sat, 18 May 2024 02:28:28 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact85
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA FOREWARD] [2016-12-19 12:52:31] [33f2a624cfeb2efbc43d2c77b7c0dad6] [Current]
Feedback Forum

Post a new message
Dataseries X:
4870
4240
3800
3990
3290
4710
4210
4440
5040
5070
4900
4790
3890
3450
4080
3280
3130
3310
3860
4570
5110
4820
4250
4210
3610
3710
2760
2710
2710
3290
2670
3620
4440
3910
4610
3760
3460
3020
3360
2610
2670
2480
2610
3320
2800
3030
3740
3060
3040
2620
3190
2750
2630
3290
2430
2730
3690
2980
2590
3360
2370
2200
2330
2370
2200
2430
2400
2840
2870
3320
3090
2680
2420
2550
2420
2430
2330
2520
2630
2570
2800
2680
2430
2790
2420
2750
2350
2330
2290
2330
2490
2480
2760
2590
2950
2570
2960
2540
2400
2470
2390
2310
2470
2490
2510
2690
3060
2690








































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
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.

\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
R Framework error message & 
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=301333&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] [ROW]R Framework error message[/C][C]
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=301333&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301333&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
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.







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[96])
842790-------
852420-------
862750-------
872350-------
882330-------
892290-------
902330-------
912490-------
922480-------
932760-------
942590-------
952950-------
962570-------
9729602370.02182040.15892827.12520.00570.19560.41520.1956
9825402293.50051978.69792727.42210.13280.00130.01960.1058
9924002273.15281959.19252706.93960.28330.1140.36420.0899
10024702160.0241870.67852555.25590.06210.1170.19960.021
10123902084.77581810.3832457.2050.05410.02130.14010.0053
10223102264.48111940.31082718.69740.42210.2940.38870.0937
10324702201.41721890.02322635.65990.11270.3120.09640.0481
10424902422.80082046.52192968.61880.40470.43270.41860.2985
10525102593.10862161.88633239.22250.40050.62280.30630.5279
10626902534.66682116.53673158.67560.31280.53090.4310.4558
10730602536.75582113.48923172.01180.05320.31820.10120.4592
10826902479.03472069.00863091.74080.24990.03160.38550.3855

\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[96]) \tabularnewline
84 & 2790 & - & - & - & - & - & - & - \tabularnewline
85 & 2420 & - & - & - & - & - & - & - \tabularnewline
86 & 2750 & - & - & - & - & - & - & - \tabularnewline
87 & 2350 & - & - & - & - & - & - & - \tabularnewline
88 & 2330 & - & - & - & - & - & - & - \tabularnewline
89 & 2290 & - & - & - & - & - & - & - \tabularnewline
90 & 2330 & - & - & - & - & - & - & - \tabularnewline
91 & 2490 & - & - & - & - & - & - & - \tabularnewline
92 & 2480 & - & - & - & - & - & - & - \tabularnewline
93 & 2760 & - & - & - & - & - & - & - \tabularnewline
94 & 2590 & - & - & - & - & - & - & - \tabularnewline
95 & 2950 & - & - & - & - & - & - & - \tabularnewline
96 & 2570 & - & - & - & - & - & - & - \tabularnewline
97 & 2960 & 2370.0218 & 2040.1589 & 2827.1252 & 0.0057 & 0.1956 & 0.4152 & 0.1956 \tabularnewline
98 & 2540 & 2293.5005 & 1978.6979 & 2727.4221 & 0.1328 & 0.0013 & 0.0196 & 0.1058 \tabularnewline
99 & 2400 & 2273.1528 & 1959.1925 & 2706.9396 & 0.2833 & 0.114 & 0.3642 & 0.0899 \tabularnewline
100 & 2470 & 2160.024 & 1870.6785 & 2555.2559 & 0.0621 & 0.117 & 0.1996 & 0.021 \tabularnewline
101 & 2390 & 2084.7758 & 1810.383 & 2457.205 & 0.0541 & 0.0213 & 0.1401 & 0.0053 \tabularnewline
102 & 2310 & 2264.4811 & 1940.3108 & 2718.6974 & 0.4221 & 0.294 & 0.3887 & 0.0937 \tabularnewline
103 & 2470 & 2201.4172 & 1890.0232 & 2635.6599 & 0.1127 & 0.312 & 0.0964 & 0.0481 \tabularnewline
104 & 2490 & 2422.8008 & 2046.5219 & 2968.6188 & 0.4047 & 0.4327 & 0.4186 & 0.2985 \tabularnewline
105 & 2510 & 2593.1086 & 2161.8863 & 3239.2225 & 0.4005 & 0.6228 & 0.3063 & 0.5279 \tabularnewline
106 & 2690 & 2534.6668 & 2116.5367 & 3158.6756 & 0.3128 & 0.5309 & 0.431 & 0.4558 \tabularnewline
107 & 3060 & 2536.7558 & 2113.4892 & 3172.0118 & 0.0532 & 0.3182 & 0.1012 & 0.4592 \tabularnewline
108 & 2690 & 2479.0347 & 2069.0086 & 3091.7408 & 0.2499 & 0.0316 & 0.3855 & 0.3855 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301333&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[96])[/C][/ROW]
[ROW][C]84[/C][C]2790[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]2420[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]2750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]2350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]2330[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]2290[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]2330[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]2490[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]2480[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]2760[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]2590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]2950[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]2570[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2960[/C][C]2370.0218[/C][C]2040.1589[/C][C]2827.1252[/C][C]0.0057[/C][C]0.1956[/C][C]0.4152[/C][C]0.1956[/C][/ROW]
[ROW][C]98[/C][C]2540[/C][C]2293.5005[/C][C]1978.6979[/C][C]2727.4221[/C][C]0.1328[/C][C]0.0013[/C][C]0.0196[/C][C]0.1058[/C][/ROW]
[ROW][C]99[/C][C]2400[/C][C]2273.1528[/C][C]1959.1925[/C][C]2706.9396[/C][C]0.2833[/C][C]0.114[/C][C]0.3642[/C][C]0.0899[/C][/ROW]
[ROW][C]100[/C][C]2470[/C][C]2160.024[/C][C]1870.6785[/C][C]2555.2559[/C][C]0.0621[/C][C]0.117[/C][C]0.1996[/C][C]0.021[/C][/ROW]
[ROW][C]101[/C][C]2390[/C][C]2084.7758[/C][C]1810.383[/C][C]2457.205[/C][C]0.0541[/C][C]0.0213[/C][C]0.1401[/C][C]0.0053[/C][/ROW]
[ROW][C]102[/C][C]2310[/C][C]2264.4811[/C][C]1940.3108[/C][C]2718.6974[/C][C]0.4221[/C][C]0.294[/C][C]0.3887[/C][C]0.0937[/C][/ROW]
[ROW][C]103[/C][C]2470[/C][C]2201.4172[/C][C]1890.0232[/C][C]2635.6599[/C][C]0.1127[/C][C]0.312[/C][C]0.0964[/C][C]0.0481[/C][/ROW]
[ROW][C]104[/C][C]2490[/C][C]2422.8008[/C][C]2046.5219[/C][C]2968.6188[/C][C]0.4047[/C][C]0.4327[/C][C]0.4186[/C][C]0.2985[/C][/ROW]
[ROW][C]105[/C][C]2510[/C][C]2593.1086[/C][C]2161.8863[/C][C]3239.2225[/C][C]0.4005[/C][C]0.6228[/C][C]0.3063[/C][C]0.5279[/C][/ROW]
[ROW][C]106[/C][C]2690[/C][C]2534.6668[/C][C]2116.5367[/C][C]3158.6756[/C][C]0.3128[/C][C]0.5309[/C][C]0.431[/C][C]0.4558[/C][/ROW]
[ROW][C]107[/C][C]3060[/C][C]2536.7558[/C][C]2113.4892[/C][C]3172.0118[/C][C]0.0532[/C][C]0.3182[/C][C]0.1012[/C][C]0.4592[/C][/ROW]
[ROW][C]108[/C][C]2690[/C][C]2479.0347[/C][C]2069.0086[/C][C]3091.7408[/C][C]0.2499[/C][C]0.0316[/C][C]0.3855[/C][C]0.3855[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301333&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301333&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[96])
842790-------
852420-------
862750-------
872350-------
882330-------
892290-------
902330-------
912490-------
922480-------
932760-------
942590-------
952950-------
962570-------
9729602370.02182040.15892827.12520.00570.19560.41520.1956
9825402293.50051978.69792727.42210.13280.00130.01960.1058
9924002273.15281959.19252706.93960.28330.1140.36420.0899
10024702160.0241870.67852555.25590.06210.1170.19960.021
10123902084.77581810.3832457.2050.05410.02130.14010.0053
10223102264.48111940.31082718.69740.42210.2940.38870.0937
10324702201.41721890.02322635.65990.11270.3120.09640.0481
10424902422.80082046.52192968.61880.40470.43270.41860.2985
10525102593.10862161.88633239.22250.40050.62280.30630.5279
10626902534.66682116.53673158.67560.31280.53090.4310.4558
10730602536.75582113.48923172.01180.05320.31820.10120.4592
10826902479.03472069.00863091.74080.24990.03160.38550.3855







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
970.09840.19930.19930.2214348074.3061003.39783.3978
980.09650.0970.14820.161760761.9832204418.1446452.12621.41962.4087
990.09740.05290.11640.125916090.2067141642.1653376.35380.73051.8493
1000.09340.12550.11870.127996085.1138130252.9024360.90571.78521.8333
1010.09110.12770.12050.129693161.8125122834.6844350.47781.75781.8182
1020.10230.01970.10370.11132071.9735102707.5659320.48020.26221.5589
1030.10060.10870.10440.111872136.710898340.3009313.59261.54681.5571
1040.11490.0270.09470.10134515.73986612.2307294.29960.3871.4109
1050.1271-0.03310.08790.09366907.037777756.0981278.8478-0.47861.3073
1060.12560.05770.08490.090224128.401672393.3285269.06010.89461.266
1070.12780.1710.09270.099273784.509990701.6177301.16713.01341.4249
1080.12610.07840.09150.097644506.365986852.0134294.70671.2151.4074

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
97 & 0.0984 & 0.1993 & 0.1993 & 0.2214 & 348074.3061 & 0 & 0 & 3.3978 & 3.3978 \tabularnewline
98 & 0.0965 & 0.097 & 0.1482 & 0.1617 & 60761.9832 & 204418.1446 & 452.1262 & 1.4196 & 2.4087 \tabularnewline
99 & 0.0974 & 0.0529 & 0.1164 & 0.1259 & 16090.2067 & 141642.1653 & 376.3538 & 0.7305 & 1.8493 \tabularnewline
100 & 0.0934 & 0.1255 & 0.1187 & 0.1279 & 96085.1138 & 130252.9024 & 360.9057 & 1.7852 & 1.8333 \tabularnewline
101 & 0.0911 & 0.1277 & 0.1205 & 0.1296 & 93161.8125 & 122834.6844 & 350.4778 & 1.7578 & 1.8182 \tabularnewline
102 & 0.1023 & 0.0197 & 0.1037 & 0.1113 & 2071.9735 & 102707.5659 & 320.4802 & 0.2622 & 1.5589 \tabularnewline
103 & 0.1006 & 0.1087 & 0.1044 & 0.1118 & 72136.7108 & 98340.3009 & 313.5926 & 1.5468 & 1.5571 \tabularnewline
104 & 0.1149 & 0.027 & 0.0947 & 0.1013 & 4515.739 & 86612.2307 & 294.2996 & 0.387 & 1.4109 \tabularnewline
105 & 0.1271 & -0.0331 & 0.0879 & 0.0936 & 6907.0377 & 77756.0981 & 278.8478 & -0.4786 & 1.3073 \tabularnewline
106 & 0.1256 & 0.0577 & 0.0849 & 0.0902 & 24128.4016 & 72393.3285 & 269.0601 & 0.8946 & 1.266 \tabularnewline
107 & 0.1278 & 0.171 & 0.0927 & 0.099 & 273784.5099 & 90701.6177 & 301.1671 & 3.0134 & 1.4249 \tabularnewline
108 & 0.1261 & 0.0784 & 0.0915 & 0.0976 & 44506.3659 & 86852.0134 & 294.7067 & 1.215 & 1.4074 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301333&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]97[/C][C]0.0984[/C][C]0.1993[/C][C]0.1993[/C][C]0.2214[/C][C]348074.3061[/C][C]0[/C][C]0[/C][C]3.3978[/C][C]3.3978[/C][/ROW]
[ROW][C]98[/C][C]0.0965[/C][C]0.097[/C][C]0.1482[/C][C]0.1617[/C][C]60761.9832[/C][C]204418.1446[/C][C]452.1262[/C][C]1.4196[/C][C]2.4087[/C][/ROW]
[ROW][C]99[/C][C]0.0974[/C][C]0.0529[/C][C]0.1164[/C][C]0.1259[/C][C]16090.2067[/C][C]141642.1653[/C][C]376.3538[/C][C]0.7305[/C][C]1.8493[/C][/ROW]
[ROW][C]100[/C][C]0.0934[/C][C]0.1255[/C][C]0.1187[/C][C]0.1279[/C][C]96085.1138[/C][C]130252.9024[/C][C]360.9057[/C][C]1.7852[/C][C]1.8333[/C][/ROW]
[ROW][C]101[/C][C]0.0911[/C][C]0.1277[/C][C]0.1205[/C][C]0.1296[/C][C]93161.8125[/C][C]122834.6844[/C][C]350.4778[/C][C]1.7578[/C][C]1.8182[/C][/ROW]
[ROW][C]102[/C][C]0.1023[/C][C]0.0197[/C][C]0.1037[/C][C]0.1113[/C][C]2071.9735[/C][C]102707.5659[/C][C]320.4802[/C][C]0.2622[/C][C]1.5589[/C][/ROW]
[ROW][C]103[/C][C]0.1006[/C][C]0.1087[/C][C]0.1044[/C][C]0.1118[/C][C]72136.7108[/C][C]98340.3009[/C][C]313.5926[/C][C]1.5468[/C][C]1.5571[/C][/ROW]
[ROW][C]104[/C][C]0.1149[/C][C]0.027[/C][C]0.0947[/C][C]0.1013[/C][C]4515.739[/C][C]86612.2307[/C][C]294.2996[/C][C]0.387[/C][C]1.4109[/C][/ROW]
[ROW][C]105[/C][C]0.1271[/C][C]-0.0331[/C][C]0.0879[/C][C]0.0936[/C][C]6907.0377[/C][C]77756.0981[/C][C]278.8478[/C][C]-0.4786[/C][C]1.3073[/C][/ROW]
[ROW][C]106[/C][C]0.1256[/C][C]0.0577[/C][C]0.0849[/C][C]0.0902[/C][C]24128.4016[/C][C]72393.3285[/C][C]269.0601[/C][C]0.8946[/C][C]1.266[/C][/ROW]
[ROW][C]107[/C][C]0.1278[/C][C]0.171[/C][C]0.0927[/C][C]0.099[/C][C]273784.5099[/C][C]90701.6177[/C][C]301.1671[/C][C]3.0134[/C][C]1.4249[/C][/ROW]
[ROW][C]108[/C][C]0.1261[/C][C]0.0784[/C][C]0.0915[/C][C]0.0976[/C][C]44506.3659[/C][C]86852.0134[/C][C]294.7067[/C][C]1.215[/C][C]1.4074[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301333&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301333&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
970.09840.19930.19930.2214348074.3061003.39783.3978
980.09650.0970.14820.161760761.9832204418.1446452.12621.41962.4087
990.09740.05290.11640.125916090.2067141642.1653376.35380.73051.8493
1000.09340.12550.11870.127996085.1138130252.9024360.90571.78521.8333
1010.09110.12770.12050.129693161.8125122834.6844350.47781.75781.8182
1020.10230.01970.10370.11132071.9735102707.5659320.48020.26221.5589
1030.10060.10870.10440.111872136.710898340.3009313.59261.54681.5571
1040.11490.0270.09470.10134515.73986612.2307294.29960.3871.4109
1050.1271-0.03310.08790.09366907.037777756.0981278.8478-0.47861.3073
1060.12560.05770.08490.090224128.401672393.3285269.06010.89461.266
1070.12780.1710.09270.099273784.509990701.6177301.16713.01341.4249
1080.12610.07840.09150.097644506.365986852.0134294.70671.2151.4074



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