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 computationFri, 23 Dec 2016 09:49:33 +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/23/t1482483018c0awqgz0r1c0s5a.htm/, Retrieved Tue, 07 May 2024 21:55:37 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302784, Retrieved Tue, 07 May 2024 21:55:37 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact82
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [forecast N2170 ar...] [2016-12-21 12:23:55] [5d300c3f2919dcb76af3d6c83a609189]
- R P     [ARIMA Forecasting] [forecast met seizon] [2016-12-23 08:49:33] [111362aa4cdbe055231fbc5cb9e916c4] [Current]
Feedback Forum

Post a new message
Dataseries X:
4030
4320
4840
4410
4180
4240
3680
4270
4140
4470
4180
4510
4490
3960
3750
3670
3590
2840
3530
4320
3740
3710
3830
3490
4200
4280
4650
2100
2410
1230
2420
2360
1870
2250
1960
2550
3180
3330
3760
3930
3710
3250
3450
3480
3090
3690
3250
3300
4040
3630
3820
3400
2500
2380
2520
2340
2420
2430
2080
2420
2430
2400
2790
2370
2700
2640
2910
2420
2800
2830
2310
2540
2780
2820
3610
3270
3030
3250
3040
3630
3320
3440
3110
3180
3330
3100
3440
3320
3380
3610
3320
3860
3430
3510
3290
3010
3860
3530
3610
3370
3700
3500
4110
4590
3680
4220
3740
3550
4150
4110
4160
3780
3150
3260
4750
4110
3610
3890
2800
2610
3600
3400
3400
3120
3150
3240




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time4 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 time4 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302784&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]4 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302784&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302784&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 time4 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[114])
1023500-------
1034110-------
1044590-------
1053680-------
1064220-------
1073740-------
1083550-------
1094150-------
1104110-------
1114160-------
1123780-------
1133150-------
1143260-------
11547503349.7582537.42974162.08634e-040.58570.03330.5857
11641103646.58022662.11874631.04170.17810.0140.03020.7792
11736103331.71472145.28634518.14310.32290.09930.28250.5472
11838903551.80132200.02264903.580.31190.46640.16630.6639
11928003246.54741749.51174743.5830.27940.19980.25910.493
12026103326.51931694.66344958.37510.19470.73640.39420.5318
12136003762.15522007.0835517.22740.42810.90090.33250.7125
12234003654.54951784.94665524.15240.39480.52280.31650.6604
12334003941.01641963.60145918.43130.29590.70410.41410.7502
12431203469.08081389.43785548.72380.37110.5260.38470.5781
12531503352.90431175.8125529.99650.42750.5830.57250.5333
12632403139.4687869.11565409.82180.46540.49640.45860.4586

\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[114]) \tabularnewline
102 & 3500 & - & - & - & - & - & - & - \tabularnewline
103 & 4110 & - & - & - & - & - & - & - \tabularnewline
104 & 4590 & - & - & - & - & - & - & - \tabularnewline
105 & 3680 & - & - & - & - & - & - & - \tabularnewline
106 & 4220 & - & - & - & - & - & - & - \tabularnewline
107 & 3740 & - & - & - & - & - & - & - \tabularnewline
108 & 3550 & - & - & - & - & - & - & - \tabularnewline
109 & 4150 & - & - & - & - & - & - & - \tabularnewline
110 & 4110 & - & - & - & - & - & - & - \tabularnewline
111 & 4160 & - & - & - & - & - & - & - \tabularnewline
112 & 3780 & - & - & - & - & - & - & - \tabularnewline
113 & 3150 & - & - & - & - & - & - & - \tabularnewline
114 & 3260 & - & - & - & - & - & - & - \tabularnewline
115 & 4750 & 3349.758 & 2537.4297 & 4162.0863 & 4e-04 & 0.5857 & 0.0333 & 0.5857 \tabularnewline
116 & 4110 & 3646.5802 & 2662.1187 & 4631.0417 & 0.1781 & 0.014 & 0.0302 & 0.7792 \tabularnewline
117 & 3610 & 3331.7147 & 2145.2863 & 4518.1431 & 0.3229 & 0.0993 & 0.2825 & 0.5472 \tabularnewline
118 & 3890 & 3551.8013 & 2200.0226 & 4903.58 & 0.3119 & 0.4664 & 0.1663 & 0.6639 \tabularnewline
119 & 2800 & 3246.5474 & 1749.5117 & 4743.583 & 0.2794 & 0.1998 & 0.2591 & 0.493 \tabularnewline
120 & 2610 & 3326.5193 & 1694.6634 & 4958.3751 & 0.1947 & 0.7364 & 0.3942 & 0.5318 \tabularnewline
121 & 3600 & 3762.1552 & 2007.083 & 5517.2274 & 0.4281 & 0.9009 & 0.3325 & 0.7125 \tabularnewline
122 & 3400 & 3654.5495 & 1784.9466 & 5524.1524 & 0.3948 & 0.5228 & 0.3165 & 0.6604 \tabularnewline
123 & 3400 & 3941.0164 & 1963.6014 & 5918.4313 & 0.2959 & 0.7041 & 0.4141 & 0.7502 \tabularnewline
124 & 3120 & 3469.0808 & 1389.4378 & 5548.7238 & 0.3711 & 0.526 & 0.3847 & 0.5781 \tabularnewline
125 & 3150 & 3352.9043 & 1175.812 & 5529.9965 & 0.4275 & 0.583 & 0.5725 & 0.5333 \tabularnewline
126 & 3240 & 3139.4687 & 869.1156 & 5409.8218 & 0.4654 & 0.4964 & 0.4586 & 0.4586 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302784&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[114])[/C][/ROW]
[ROW][C]102[/C][C]3500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]4110[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]4590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]3680[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]4220[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]3740[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]3550[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]4150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]4110[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]4160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]3780[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]3150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]3260[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]4750[/C][C]3349.758[/C][C]2537.4297[/C][C]4162.0863[/C][C]4e-04[/C][C]0.5857[/C][C]0.0333[/C][C]0.5857[/C][/ROW]
[ROW][C]116[/C][C]4110[/C][C]3646.5802[/C][C]2662.1187[/C][C]4631.0417[/C][C]0.1781[/C][C]0.014[/C][C]0.0302[/C][C]0.7792[/C][/ROW]
[ROW][C]117[/C][C]3610[/C][C]3331.7147[/C][C]2145.2863[/C][C]4518.1431[/C][C]0.3229[/C][C]0.0993[/C][C]0.2825[/C][C]0.5472[/C][/ROW]
[ROW][C]118[/C][C]3890[/C][C]3551.8013[/C][C]2200.0226[/C][C]4903.58[/C][C]0.3119[/C][C]0.4664[/C][C]0.1663[/C][C]0.6639[/C][/ROW]
[ROW][C]119[/C][C]2800[/C][C]3246.5474[/C][C]1749.5117[/C][C]4743.583[/C][C]0.2794[/C][C]0.1998[/C][C]0.2591[/C][C]0.493[/C][/ROW]
[ROW][C]120[/C][C]2610[/C][C]3326.5193[/C][C]1694.6634[/C][C]4958.3751[/C][C]0.1947[/C][C]0.7364[/C][C]0.3942[/C][C]0.5318[/C][/ROW]
[ROW][C]121[/C][C]3600[/C][C]3762.1552[/C][C]2007.083[/C][C]5517.2274[/C][C]0.4281[/C][C]0.9009[/C][C]0.3325[/C][C]0.7125[/C][/ROW]
[ROW][C]122[/C][C]3400[/C][C]3654.5495[/C][C]1784.9466[/C][C]5524.1524[/C][C]0.3948[/C][C]0.5228[/C][C]0.3165[/C][C]0.6604[/C][/ROW]
[ROW][C]123[/C][C]3400[/C][C]3941.0164[/C][C]1963.6014[/C][C]5918.4313[/C][C]0.2959[/C][C]0.7041[/C][C]0.4141[/C][C]0.7502[/C][/ROW]
[ROW][C]124[/C][C]3120[/C][C]3469.0808[/C][C]1389.4378[/C][C]5548.7238[/C][C]0.3711[/C][C]0.526[/C][C]0.3847[/C][C]0.5781[/C][/ROW]
[ROW][C]125[/C][C]3150[/C][C]3352.9043[/C][C]1175.812[/C][C]5529.9965[/C][C]0.4275[/C][C]0.583[/C][C]0.5725[/C][C]0.5333[/C][/ROW]
[ROW][C]126[/C][C]3240[/C][C]3139.4687[/C][C]869.1156[/C][C]5409.8218[/C][C]0.4654[/C][C]0.4964[/C][C]0.4586[/C][C]0.4586[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302784&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302784&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[114])
1023500-------
1034110-------
1044590-------
1053680-------
1064220-------
1073740-------
1083550-------
1094150-------
1104110-------
1114160-------
1123780-------
1133150-------
1143260-------
11547503349.7582537.42974162.08634e-040.58570.03330.5857
11641103646.58022662.11874631.04170.17810.0140.03020.7792
11736103331.71472145.28634518.14310.32290.09930.28250.5472
11838903551.80132200.02264903.580.31190.46640.16630.6639
11928003246.54741749.51174743.5830.27940.19980.25910.493
12026103326.51931694.66344958.37510.19470.73640.39420.5318
12136003762.15522007.0835517.22740.42810.90090.33250.7125
12234003654.54951784.94665524.15240.39480.52280.31650.6604
12334003941.01641963.60145918.43130.29590.70410.41410.7502
12431203469.08081389.43785548.72380.37110.5260.38470.5781
12531503352.90431175.8125529.99650.42750.5830.57250.5333
12632403139.4687869.11565409.82180.46540.49640.45860.4586







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.12370.29480.29480.34571960677.6393003.59043.5904
1160.13770.11280.20380.2326214757.90781087717.77351042.93711.18832.3893
1170.18170.07710.16150.181877442.7032750959.4167866.57910.71361.8307
1180.19420.08690.14290.1591114378.3686591814.1547769.29460.86721.5898
1190.2353-0.15950.14620.1568199404.5515513332.234716.4721-1.1451.5009
1200.2503-0.27450.16760.1709513399.8776513343.508716.4799-1.83721.5569
1210.238-0.0450.15010.152826294.312443765.0514666.1569-0.41581.3939
1220.261-0.07490.14070.142764795.4576396393.8522629.5982-0.65271.3013
1230.256-0.15910.14270.1432292698.7085384872.1695620.3807-1.38721.3108
1240.3059-0.11190.13960.1395121857.4301358570.6956598.8077-0.89511.2692
1250.3313-0.06440.13280.132541170.1372329716.0994574.2091-0.52031.2011
1260.3690.0310.12430.124110106.5443303081.9698550.52880.25781.1225

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
115 & 0.1237 & 0.2948 & 0.2948 & 0.3457 & 1960677.6393 & 0 & 0 & 3.5904 & 3.5904 \tabularnewline
116 & 0.1377 & 0.1128 & 0.2038 & 0.2326 & 214757.9078 & 1087717.7735 & 1042.9371 & 1.1883 & 2.3893 \tabularnewline
117 & 0.1817 & 0.0771 & 0.1615 & 0.1818 & 77442.7032 & 750959.4167 & 866.5791 & 0.7136 & 1.8307 \tabularnewline
118 & 0.1942 & 0.0869 & 0.1429 & 0.1591 & 114378.3686 & 591814.1547 & 769.2946 & 0.8672 & 1.5898 \tabularnewline
119 & 0.2353 & -0.1595 & 0.1462 & 0.1568 & 199404.5515 & 513332.234 & 716.4721 & -1.145 & 1.5009 \tabularnewline
120 & 0.2503 & -0.2745 & 0.1676 & 0.1709 & 513399.8776 & 513343.508 & 716.4799 & -1.8372 & 1.5569 \tabularnewline
121 & 0.238 & -0.045 & 0.1501 & 0.1528 & 26294.312 & 443765.0514 & 666.1569 & -0.4158 & 1.3939 \tabularnewline
122 & 0.261 & -0.0749 & 0.1407 & 0.1427 & 64795.4576 & 396393.8522 & 629.5982 & -0.6527 & 1.3013 \tabularnewline
123 & 0.256 & -0.1591 & 0.1427 & 0.1432 & 292698.7085 & 384872.1695 & 620.3807 & -1.3872 & 1.3108 \tabularnewline
124 & 0.3059 & -0.1119 & 0.1396 & 0.1395 & 121857.4301 & 358570.6956 & 598.8077 & -0.8951 & 1.2692 \tabularnewline
125 & 0.3313 & -0.0644 & 0.1328 & 0.1325 & 41170.1372 & 329716.0994 & 574.2091 & -0.5203 & 1.2011 \tabularnewline
126 & 0.369 & 0.031 & 0.1243 & 0.1241 & 10106.5443 & 303081.9698 & 550.5288 & 0.2578 & 1.1225 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302784&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]115[/C][C]0.1237[/C][C]0.2948[/C][C]0.2948[/C][C]0.3457[/C][C]1960677.6393[/C][C]0[/C][C]0[/C][C]3.5904[/C][C]3.5904[/C][/ROW]
[ROW][C]116[/C][C]0.1377[/C][C]0.1128[/C][C]0.2038[/C][C]0.2326[/C][C]214757.9078[/C][C]1087717.7735[/C][C]1042.9371[/C][C]1.1883[/C][C]2.3893[/C][/ROW]
[ROW][C]117[/C][C]0.1817[/C][C]0.0771[/C][C]0.1615[/C][C]0.1818[/C][C]77442.7032[/C][C]750959.4167[/C][C]866.5791[/C][C]0.7136[/C][C]1.8307[/C][/ROW]
[ROW][C]118[/C][C]0.1942[/C][C]0.0869[/C][C]0.1429[/C][C]0.1591[/C][C]114378.3686[/C][C]591814.1547[/C][C]769.2946[/C][C]0.8672[/C][C]1.5898[/C][/ROW]
[ROW][C]119[/C][C]0.2353[/C][C]-0.1595[/C][C]0.1462[/C][C]0.1568[/C][C]199404.5515[/C][C]513332.234[/C][C]716.4721[/C][C]-1.145[/C][C]1.5009[/C][/ROW]
[ROW][C]120[/C][C]0.2503[/C][C]-0.2745[/C][C]0.1676[/C][C]0.1709[/C][C]513399.8776[/C][C]513343.508[/C][C]716.4799[/C][C]-1.8372[/C][C]1.5569[/C][/ROW]
[ROW][C]121[/C][C]0.238[/C][C]-0.045[/C][C]0.1501[/C][C]0.1528[/C][C]26294.312[/C][C]443765.0514[/C][C]666.1569[/C][C]-0.4158[/C][C]1.3939[/C][/ROW]
[ROW][C]122[/C][C]0.261[/C][C]-0.0749[/C][C]0.1407[/C][C]0.1427[/C][C]64795.4576[/C][C]396393.8522[/C][C]629.5982[/C][C]-0.6527[/C][C]1.3013[/C][/ROW]
[ROW][C]123[/C][C]0.256[/C][C]-0.1591[/C][C]0.1427[/C][C]0.1432[/C][C]292698.7085[/C][C]384872.1695[/C][C]620.3807[/C][C]-1.3872[/C][C]1.3108[/C][/ROW]
[ROW][C]124[/C][C]0.3059[/C][C]-0.1119[/C][C]0.1396[/C][C]0.1395[/C][C]121857.4301[/C][C]358570.6956[/C][C]598.8077[/C][C]-0.8951[/C][C]1.2692[/C][/ROW]
[ROW][C]125[/C][C]0.3313[/C][C]-0.0644[/C][C]0.1328[/C][C]0.1325[/C][C]41170.1372[/C][C]329716.0994[/C][C]574.2091[/C][C]-0.5203[/C][C]1.2011[/C][/ROW]
[ROW][C]126[/C][C]0.369[/C][C]0.031[/C][C]0.1243[/C][C]0.1241[/C][C]10106.5443[/C][C]303081.9698[/C][C]550.5288[/C][C]0.2578[/C][C]1.1225[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302784&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302784&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
1150.12370.29480.29480.34571960677.6393003.59043.5904
1160.13770.11280.20380.2326214757.90781087717.77351042.93711.18832.3893
1170.18170.07710.16150.181877442.7032750959.4167866.57910.71361.8307
1180.19420.08690.14290.1591114378.3686591814.1547769.29460.86721.5898
1190.2353-0.15950.14620.1568199404.5515513332.234716.4721-1.1451.5009
1200.2503-0.27450.16760.1709513399.8776513343.508716.4799-1.83721.5569
1210.238-0.0450.15010.152826294.312443765.0514666.1569-0.41581.3939
1220.261-0.07490.14070.142764795.4576396393.8522629.5982-0.65271.3013
1230.256-0.15910.14270.1432292698.7085384872.1695620.3807-1.38721.3108
1240.3059-0.11190.13960.1395121857.4301358570.6956598.8077-0.89511.2692
1250.3313-0.06440.13280.132541170.1372329716.0994574.2091-0.52031.2011
1260.3690.0310.12430.124110106.5443303081.9698550.52880.25781.1225



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