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 computationTue, 20 Dec 2016 18:34: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/20/t14822552645bbildu8ahc08n3.htm/, Retrieved Sun, 28 Apr 2024 17:45:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301762, Retrieved Sun, 28 Apr 2024 17:45:05 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact59
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecast] [2016-12-20 17:34:03] [e8b5e2ae4a4517822f644e6c122e1af0] [Current]
Feedback Forum

Post a new message
Dataseries X:
3800
1650
4250
3200
2050
3600
3700
6000
8550
9050
6000
8550
6700
3850
2950
2900
2200
3500
4900
6650
10050
8300
7650
5750
4600
5250
3250
1150
1950
2850
2950
4950
6000
6650
6150
4300
4450
1250
3000
2600
1200
2050
2000
5050
4050
5150
6450
3700
3300
2000
2650
900
1350
4550
1850
3650
3250
5950
4050
3250
2200
1050
2250
2650
650
1100
2900
6450
3100
6050
4200
1800
2100
1550
1050
900
1800
1700
1700
2250
4000
3500
3300
1550
2750
1900
1200
1150
1150
2200
1500
3850
2950
3750
4600
3350
2300
1400
900
1250
1650
1600
1200
2300
2950
5650
4000
3300




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301762&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[96])
841550-------
852750-------
861900-------
871200-------
881150-------
891150-------
902200-------
911500-------
923850-------
932950-------
943750-------
954600-------
963350-------
9723002534.06791046.19975711.8680.44260.30740.4470.3074
9814001566.2635617.54773669.63840.43840.24710.37790.0482
999001592.1079590.28753926.08130.28050.56410.6290.0699
10012501484.7469536.31583740.98030.41920.69430.61440.0526
10116501139.9417382.50983050.68390.30040.45510.49590.0117
10216002276.8984824.94815722.60310.35010.63930.51740.2708
10312001752.5122616.91534510.22460.34730.54320.57120.1281
10423004232.86051622.547410153.36230.26110.84230.55040.615
10529503059.97071128.94847576.50840.4810.62920.5190.4499
10656503990.79751513.1319660.12970.28310.64050.53320.5877
10740004986.23341932.239411852.53830.38920.42490.54390.6798
10833003553.2331327.17398708.63760.46170.43260.53080.5308

\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 & 1550 & - & - & - & - & - & - & - \tabularnewline
85 & 2750 & - & - & - & - & - & - & - \tabularnewline
86 & 1900 & - & - & - & - & - & - & - \tabularnewline
87 & 1200 & - & - & - & - & - & - & - \tabularnewline
88 & 1150 & - & - & - & - & - & - & - \tabularnewline
89 & 1150 & - & - & - & - & - & - & - \tabularnewline
90 & 2200 & - & - & - & - & - & - & - \tabularnewline
91 & 1500 & - & - & - & - & - & - & - \tabularnewline
92 & 3850 & - & - & - & - & - & - & - \tabularnewline
93 & 2950 & - & - & - & - & - & - & - \tabularnewline
94 & 3750 & - & - & - & - & - & - & - \tabularnewline
95 & 4600 & - & - & - & - & - & - & - \tabularnewline
96 & 3350 & - & - & - & - & - & - & - \tabularnewline
97 & 2300 & 2534.0679 & 1046.1997 & 5711.868 & 0.4426 & 0.3074 & 0.447 & 0.3074 \tabularnewline
98 & 1400 & 1566.2635 & 617.5477 & 3669.6384 & 0.4384 & 0.2471 & 0.3779 & 0.0482 \tabularnewline
99 & 900 & 1592.1079 & 590.2875 & 3926.0813 & 0.2805 & 0.5641 & 0.629 & 0.0699 \tabularnewline
100 & 1250 & 1484.7469 & 536.3158 & 3740.9803 & 0.4192 & 0.6943 & 0.6144 & 0.0526 \tabularnewline
101 & 1650 & 1139.9417 & 382.5098 & 3050.6839 & 0.3004 & 0.4551 & 0.4959 & 0.0117 \tabularnewline
102 & 1600 & 2276.8984 & 824.9481 & 5722.6031 & 0.3501 & 0.6393 & 0.5174 & 0.2708 \tabularnewline
103 & 1200 & 1752.5122 & 616.9153 & 4510.2246 & 0.3473 & 0.5432 & 0.5712 & 0.1281 \tabularnewline
104 & 2300 & 4232.8605 & 1622.5474 & 10153.3623 & 0.2611 & 0.8423 & 0.5504 & 0.615 \tabularnewline
105 & 2950 & 3059.9707 & 1128.9484 & 7576.5084 & 0.481 & 0.6292 & 0.519 & 0.4499 \tabularnewline
106 & 5650 & 3990.7975 & 1513.131 & 9660.1297 & 0.2831 & 0.6405 & 0.5332 & 0.5877 \tabularnewline
107 & 4000 & 4986.2334 & 1932.2394 & 11852.5383 & 0.3892 & 0.4249 & 0.5439 & 0.6798 \tabularnewline
108 & 3300 & 3553.233 & 1327.1739 & 8708.6376 & 0.4617 & 0.4326 & 0.5308 & 0.5308 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301762&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]1550[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]2750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]1900[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]1200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]1150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]1150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]2200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]1500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]3850[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]2950[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]3750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]4600[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]3350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2300[/C][C]2534.0679[/C][C]1046.1997[/C][C]5711.868[/C][C]0.4426[/C][C]0.3074[/C][C]0.447[/C][C]0.3074[/C][/ROW]
[ROW][C]98[/C][C]1400[/C][C]1566.2635[/C][C]617.5477[/C][C]3669.6384[/C][C]0.4384[/C][C]0.2471[/C][C]0.3779[/C][C]0.0482[/C][/ROW]
[ROW][C]99[/C][C]900[/C][C]1592.1079[/C][C]590.2875[/C][C]3926.0813[/C][C]0.2805[/C][C]0.5641[/C][C]0.629[/C][C]0.0699[/C][/ROW]
[ROW][C]100[/C][C]1250[/C][C]1484.7469[/C][C]536.3158[/C][C]3740.9803[/C][C]0.4192[/C][C]0.6943[/C][C]0.6144[/C][C]0.0526[/C][/ROW]
[ROW][C]101[/C][C]1650[/C][C]1139.9417[/C][C]382.5098[/C][C]3050.6839[/C][C]0.3004[/C][C]0.4551[/C][C]0.4959[/C][C]0.0117[/C][/ROW]
[ROW][C]102[/C][C]1600[/C][C]2276.8984[/C][C]824.9481[/C][C]5722.6031[/C][C]0.3501[/C][C]0.6393[/C][C]0.5174[/C][C]0.2708[/C][/ROW]
[ROW][C]103[/C][C]1200[/C][C]1752.5122[/C][C]616.9153[/C][C]4510.2246[/C][C]0.3473[/C][C]0.5432[/C][C]0.5712[/C][C]0.1281[/C][/ROW]
[ROW][C]104[/C][C]2300[/C][C]4232.8605[/C][C]1622.5474[/C][C]10153.3623[/C][C]0.2611[/C][C]0.8423[/C][C]0.5504[/C][C]0.615[/C][/ROW]
[ROW][C]105[/C][C]2950[/C][C]3059.9707[/C][C]1128.9484[/C][C]7576.5084[/C][C]0.481[/C][C]0.6292[/C][C]0.519[/C][C]0.4499[/C][/ROW]
[ROW][C]106[/C][C]5650[/C][C]3990.7975[/C][C]1513.131[/C][C]9660.1297[/C][C]0.2831[/C][C]0.6405[/C][C]0.5332[/C][C]0.5877[/C][/ROW]
[ROW][C]107[/C][C]4000[/C][C]4986.2334[/C][C]1932.2394[/C][C]11852.5383[/C][C]0.3892[/C][C]0.4249[/C][C]0.5439[/C][C]0.6798[/C][/ROW]
[ROW][C]108[/C][C]3300[/C][C]3553.233[/C][C]1327.1739[/C][C]8708.6376[/C][C]0.4617[/C][C]0.4326[/C][C]0.5308[/C][C]0.5308[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301762&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301762&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])
841550-------
852750-------
861900-------
871200-------
881150-------
891150-------
902200-------
911500-------
923850-------
932950-------
943750-------
954600-------
963350-------
9723002534.06791046.19975711.8680.44260.30740.4470.3074
9814001566.2635617.54773669.63840.43840.24710.37790.0482
999001592.1079590.28753926.08130.28050.56410.6290.0699
10012501484.7469536.31583740.98030.41920.69430.61440.0526
10116501139.9417382.50983050.68390.30040.45510.49590.0117
10216002276.8984824.94815722.60310.35010.63930.51740.2708
10312001752.5122616.91534510.22460.34730.54320.57120.1281
10423004232.86051622.547410153.36230.26110.84230.55040.615
10529503059.97071128.94847576.50840.4810.62920.5190.4499
10656503990.79751513.1319660.12970.28310.64050.53320.5877
10740004986.23341932.239411852.53830.38920.42490.54390.6798
10833003553.2331327.17398708.63760.46170.43260.53080.5308







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
970.6398-0.10180.10180.096854787.77800-0.27390.2739
980.6852-0.11880.11030.104527643.549441215.6637203.0164-0.19460.2342
990.7479-0.7690.32980.2548479013.3447187148.2241432.6063-0.80990.4261
1000.7753-0.18780.29430.23455106.097154137.6923392.6037-0.27470.3883
1010.85520.30910.29730.2603260159.4261175342.0391418.73860.59690.43
1020.7721-0.42310.31830.2751458191.4518222483.6079471.6817-0.79210.4903
1030.8028-0.46040.33860.2893305269.737234310.1977484.056-0.64660.5127
1040.7136-0.84040.40130.32713735949.8084672015.1491819.7653-2.26190.7313
1050.7531-0.03730.36080.294812093.5511598690.5271773.7509-0.12870.6644
1060.72480.29370.35410.29982752953.0986814116.7842902.28421.94160.7921
1070.7026-0.24660.34430.2925972656.398828529.4764910.2359-1.15410.825
1080.7403-0.07670.3220.274364126.9375764829.2648874.5452-0.29630.7809

\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.6398 & -0.1018 & 0.1018 & 0.0968 & 54787.778 & 0 & 0 & -0.2739 & 0.2739 \tabularnewline
98 & 0.6852 & -0.1188 & 0.1103 & 0.1045 & 27643.5494 & 41215.6637 & 203.0164 & -0.1946 & 0.2342 \tabularnewline
99 & 0.7479 & -0.769 & 0.3298 & 0.2548 & 479013.3447 & 187148.2241 & 432.6063 & -0.8099 & 0.4261 \tabularnewline
100 & 0.7753 & -0.1878 & 0.2943 & 0.234 & 55106.097 & 154137.6923 & 392.6037 & -0.2747 & 0.3883 \tabularnewline
101 & 0.8552 & 0.3091 & 0.2973 & 0.2603 & 260159.4261 & 175342.0391 & 418.7386 & 0.5969 & 0.43 \tabularnewline
102 & 0.7721 & -0.4231 & 0.3183 & 0.2751 & 458191.4518 & 222483.6079 & 471.6817 & -0.7921 & 0.4903 \tabularnewline
103 & 0.8028 & -0.4604 & 0.3386 & 0.2893 & 305269.737 & 234310.1977 & 484.056 & -0.6466 & 0.5127 \tabularnewline
104 & 0.7136 & -0.8404 & 0.4013 & 0.3271 & 3735949.8084 & 672015.1491 & 819.7653 & -2.2619 & 0.7313 \tabularnewline
105 & 0.7531 & -0.0373 & 0.3608 & 0.2948 & 12093.5511 & 598690.5271 & 773.7509 & -0.1287 & 0.6644 \tabularnewline
106 & 0.7248 & 0.2937 & 0.3541 & 0.2998 & 2752953.0986 & 814116.7842 & 902.2842 & 1.9416 & 0.7921 \tabularnewline
107 & 0.7026 & -0.2466 & 0.3443 & 0.2925 & 972656.398 & 828529.4764 & 910.2359 & -1.1541 & 0.825 \tabularnewline
108 & 0.7403 & -0.0767 & 0.322 & 0.2743 & 64126.9375 & 764829.2648 & 874.5452 & -0.2963 & 0.7809 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301762&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.6398[/C][C]-0.1018[/C][C]0.1018[/C][C]0.0968[/C][C]54787.778[/C][C]0[/C][C]0[/C][C]-0.2739[/C][C]0.2739[/C][/ROW]
[ROW][C]98[/C][C]0.6852[/C][C]-0.1188[/C][C]0.1103[/C][C]0.1045[/C][C]27643.5494[/C][C]41215.6637[/C][C]203.0164[/C][C]-0.1946[/C][C]0.2342[/C][/ROW]
[ROW][C]99[/C][C]0.7479[/C][C]-0.769[/C][C]0.3298[/C][C]0.2548[/C][C]479013.3447[/C][C]187148.2241[/C][C]432.6063[/C][C]-0.8099[/C][C]0.4261[/C][/ROW]
[ROW][C]100[/C][C]0.7753[/C][C]-0.1878[/C][C]0.2943[/C][C]0.234[/C][C]55106.097[/C][C]154137.6923[/C][C]392.6037[/C][C]-0.2747[/C][C]0.3883[/C][/ROW]
[ROW][C]101[/C][C]0.8552[/C][C]0.3091[/C][C]0.2973[/C][C]0.2603[/C][C]260159.4261[/C][C]175342.0391[/C][C]418.7386[/C][C]0.5969[/C][C]0.43[/C][/ROW]
[ROW][C]102[/C][C]0.7721[/C][C]-0.4231[/C][C]0.3183[/C][C]0.2751[/C][C]458191.4518[/C][C]222483.6079[/C][C]471.6817[/C][C]-0.7921[/C][C]0.4903[/C][/ROW]
[ROW][C]103[/C][C]0.8028[/C][C]-0.4604[/C][C]0.3386[/C][C]0.2893[/C][C]305269.737[/C][C]234310.1977[/C][C]484.056[/C][C]-0.6466[/C][C]0.5127[/C][/ROW]
[ROW][C]104[/C][C]0.7136[/C][C]-0.8404[/C][C]0.4013[/C][C]0.3271[/C][C]3735949.8084[/C][C]672015.1491[/C][C]819.7653[/C][C]-2.2619[/C][C]0.7313[/C][/ROW]
[ROW][C]105[/C][C]0.7531[/C][C]-0.0373[/C][C]0.3608[/C][C]0.2948[/C][C]12093.5511[/C][C]598690.5271[/C][C]773.7509[/C][C]-0.1287[/C][C]0.6644[/C][/ROW]
[ROW][C]106[/C][C]0.7248[/C][C]0.2937[/C][C]0.3541[/C][C]0.2998[/C][C]2752953.0986[/C][C]814116.7842[/C][C]902.2842[/C][C]1.9416[/C][C]0.7921[/C][/ROW]
[ROW][C]107[/C][C]0.7026[/C][C]-0.2466[/C][C]0.3443[/C][C]0.2925[/C][C]972656.398[/C][C]828529.4764[/C][C]910.2359[/C][C]-1.1541[/C][C]0.825[/C][/ROW]
[ROW][C]108[/C][C]0.7403[/C][C]-0.0767[/C][C]0.322[/C][C]0.2743[/C][C]64126.9375[/C][C]764829.2648[/C][C]874.5452[/C][C]-0.2963[/C][C]0.7809[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301762&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301762&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.6398-0.10180.10180.096854787.77800-0.27390.2739
980.6852-0.11880.11030.104527643.549441215.6637203.0164-0.19460.2342
990.7479-0.7690.32980.2548479013.3447187148.2241432.6063-0.80990.4261
1000.7753-0.18780.29430.23455106.097154137.6923392.6037-0.27470.3883
1010.85520.30910.29730.2603260159.4261175342.0391418.73860.59690.43
1020.7721-0.42310.31830.2751458191.4518222483.6079471.6817-0.79210.4903
1030.8028-0.46040.33860.2893305269.737234310.1977484.056-0.64660.5127
1040.7136-0.84040.40130.32713735949.8084672015.1491819.7653-2.26190.7313
1050.7531-0.03730.36080.294812093.5511598690.5271773.7509-0.12870.6644
1060.72480.29370.35410.29982752953.0986814116.7842902.28421.94160.7921
1070.7026-0.24660.34430.2925972656.398828529.4764910.2359-1.15410.825
1080.7403-0.07670.3220.274364126.9375764829.2648874.5452-0.29630.7809



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