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 computationWed, 21 Dec 2016 10:35:12 +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/21/t1482313078j3ql909t84kk7fe.htm/, Retrieved Mon, 06 May 2024 20:02:41 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301947, Retrieved Mon, 06 May 2024 20:02:41 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact53
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [N 2460- ARIMA FOR...] [2016-12-21 09:35:12] [86c7fb9c8a0af864c0a27e2f433e80d7] [Current]
Feedback Forum

Post a new message
Dataseries X:
3850
3900
3900
3950
3950
3900
3400
2150
3800
3950
3950
3850
3750
3900
3850
3900
3900
4000
3450
2300
3900
4100
4150
4150
3950
4150
4150
4150
4150
4250
3750
2350
4200
4250
4350
4300
4150
4250
4250
4200
4150
4350
3750
2450
4250
4350
4450
4500
4350
4500
4550
4550
3050
3850
4100
2700
4450
4800
4950
4950
4800
4850
4850
5000
5000
5000
4450
2800
4850
5150
5050
5100
5100
5250
5250
5350
5150
5200
4600
2950
5100
5350
5350
5400
5250
5450
5500
5450
5200
5400
4800
3050
5450
5600
5750
5750
5650
5700
5750
5800
5750
5750
4950
3500
5750
6050
6150
6200
6150
6250
6300
6100
6350
6250
5400
3900
6100
6450
6600
6350
6500
6700
6550
6550
6550
6500




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

\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
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301947&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] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=301947&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301947&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







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])
1025750-------
1034950-------
1043500-------
1055750-------
1066050-------
1076150-------
1086200-------
1096150-------
1106250-------
1116300-------
1126100-------
1136350-------
1146250-------
11554005443.60445026.50155857.53210.41821e-040.99031e-04
11639003923.5483409.33314431.08920.463800.9490
11761006225.12755726.15036720.13210.310110.970.4608
11864506459.47855955.21336959.83310.48520.92050.94560.7941
11966006576.37616062.08047086.67640.46390.68630.94930.895
12063506604.97336079.09597126.69180.16910.50750.93590.9088
12165006535.18785997.5387068.44490.44850.7520.92160.8527
12267006613.78976066.0717157.0040.37790.65930.90530.9053
12365506663.29746105.46457216.49290.34410.44830.9010.9284
12465506568.02895998.95787132.20480.4750.5250.9480.8654
12565506692.26636114.1217265.45280.31330.68670.87910.9348
12665006634.30526045.60587217.81890.32590.61150.90160.9016

\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 & 5750 & - & - & - & - & - & - & - \tabularnewline
103 & 4950 & - & - & - & - & - & - & - \tabularnewline
104 & 3500 & - & - & - & - & - & - & - \tabularnewline
105 & 5750 & - & - & - & - & - & - & - \tabularnewline
106 & 6050 & - & - & - & - & - & - & - \tabularnewline
107 & 6150 & - & - & - & - & - & - & - \tabularnewline
108 & 6200 & - & - & - & - & - & - & - \tabularnewline
109 & 6150 & - & - & - & - & - & - & - \tabularnewline
110 & 6250 & - & - & - & - & - & - & - \tabularnewline
111 & 6300 & - & - & - & - & - & - & - \tabularnewline
112 & 6100 & - & - & - & - & - & - & - \tabularnewline
113 & 6350 & - & - & - & - & - & - & - \tabularnewline
114 & 6250 & - & - & - & - & - & - & - \tabularnewline
115 & 5400 & 5443.6044 & 5026.5015 & 5857.5321 & 0.4182 & 1e-04 & 0.9903 & 1e-04 \tabularnewline
116 & 3900 & 3923.548 & 3409.3331 & 4431.0892 & 0.4638 & 0 & 0.949 & 0 \tabularnewline
117 & 6100 & 6225.1275 & 5726.1503 & 6720.1321 & 0.3101 & 1 & 0.97 & 0.4608 \tabularnewline
118 & 6450 & 6459.4785 & 5955.2133 & 6959.8331 & 0.4852 & 0.9205 & 0.9456 & 0.7941 \tabularnewline
119 & 6600 & 6576.3761 & 6062.0804 & 7086.6764 & 0.4639 & 0.6863 & 0.9493 & 0.895 \tabularnewline
120 & 6350 & 6604.9733 & 6079.0959 & 7126.6918 & 0.1691 & 0.5075 & 0.9359 & 0.9088 \tabularnewline
121 & 6500 & 6535.1878 & 5997.538 & 7068.4449 & 0.4485 & 0.752 & 0.9216 & 0.8527 \tabularnewline
122 & 6700 & 6613.7897 & 6066.071 & 7157.004 & 0.3779 & 0.6593 & 0.9053 & 0.9053 \tabularnewline
123 & 6550 & 6663.2974 & 6105.4645 & 7216.4929 & 0.3441 & 0.4483 & 0.901 & 0.9284 \tabularnewline
124 & 6550 & 6568.0289 & 5998.9578 & 7132.2048 & 0.475 & 0.525 & 0.948 & 0.8654 \tabularnewline
125 & 6550 & 6692.2663 & 6114.121 & 7265.4528 & 0.3133 & 0.6867 & 0.8791 & 0.9348 \tabularnewline
126 & 6500 & 6634.3052 & 6045.6058 & 7217.8189 & 0.3259 & 0.6115 & 0.9016 & 0.9016 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301947&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]5750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]4950[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]3500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]5750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]6050[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]6150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]6200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]6150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]6250[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]6300[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]6100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]6350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]6250[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]5400[/C][C]5443.6044[/C][C]5026.5015[/C][C]5857.5321[/C][C]0.4182[/C][C]1e-04[/C][C]0.9903[/C][C]1e-04[/C][/ROW]
[ROW][C]116[/C][C]3900[/C][C]3923.548[/C][C]3409.3331[/C][C]4431.0892[/C][C]0.4638[/C][C]0[/C][C]0.949[/C][C]0[/C][/ROW]
[ROW][C]117[/C][C]6100[/C][C]6225.1275[/C][C]5726.1503[/C][C]6720.1321[/C][C]0.3101[/C][C]1[/C][C]0.97[/C][C]0.4608[/C][/ROW]
[ROW][C]118[/C][C]6450[/C][C]6459.4785[/C][C]5955.2133[/C][C]6959.8331[/C][C]0.4852[/C][C]0.9205[/C][C]0.9456[/C][C]0.7941[/C][/ROW]
[ROW][C]119[/C][C]6600[/C][C]6576.3761[/C][C]6062.0804[/C][C]7086.6764[/C][C]0.4639[/C][C]0.6863[/C][C]0.9493[/C][C]0.895[/C][/ROW]
[ROW][C]120[/C][C]6350[/C][C]6604.9733[/C][C]6079.0959[/C][C]7126.6918[/C][C]0.1691[/C][C]0.5075[/C][C]0.9359[/C][C]0.9088[/C][/ROW]
[ROW][C]121[/C][C]6500[/C][C]6535.1878[/C][C]5997.538[/C][C]7068.4449[/C][C]0.4485[/C][C]0.752[/C][C]0.9216[/C][C]0.8527[/C][/ROW]
[ROW][C]122[/C][C]6700[/C][C]6613.7897[/C][C]6066.071[/C][C]7157.004[/C][C]0.3779[/C][C]0.6593[/C][C]0.9053[/C][C]0.9053[/C][/ROW]
[ROW][C]123[/C][C]6550[/C][C]6663.2974[/C][C]6105.4645[/C][C]7216.4929[/C][C]0.3441[/C][C]0.4483[/C][C]0.901[/C][C]0.9284[/C][/ROW]
[ROW][C]124[/C][C]6550[/C][C]6568.0289[/C][C]5998.9578[/C][C]7132.2048[/C][C]0.475[/C][C]0.525[/C][C]0.948[/C][C]0.8654[/C][/ROW]
[ROW][C]125[/C][C]6550[/C][C]6692.2663[/C][C]6114.121[/C][C]7265.4528[/C][C]0.3133[/C][C]0.6867[/C][C]0.8791[/C][C]0.9348[/C][/ROW]
[ROW][C]126[/C][C]6500[/C][C]6634.3052[/C][C]6045.6058[/C][C]7217.8189[/C][C]0.3259[/C][C]0.6115[/C][C]0.9016[/C][C]0.9016[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301947&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301947&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])
1025750-------
1034950-------
1043500-------
1055750-------
1066050-------
1076150-------
1086200-------
1096150-------
1106250-------
1116300-------
1126100-------
1136350-------
1146250-------
11554005443.60445026.50155857.53210.41821e-040.99031e-04
11639003923.5483409.33314431.08920.463800.9490
11761006225.12755726.15036720.13210.310110.970.4608
11864506459.47855955.21336959.83310.48520.92050.94560.7941
11966006576.37616062.08047086.67640.46390.68630.94930.895
12063506604.97336079.09597126.69180.16910.50750.93590.9088
12165006535.18785997.5387068.44490.44850.7520.92160.8527
12267006613.78976066.0717157.0040.37790.65930.90530.9053
12365506663.29746105.46457216.49290.34410.44830.9010.9284
12465506568.02895998.95787132.20480.4750.5250.9480.8654
12565506692.26636114.1217265.45280.31330.68670.87910.9348
12665006634.30526045.60587217.81890.32590.61150.90160.9016







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.0388-0.00810.00810.0081901.344500-0.09590.0959
1160.066-0.0060.00710.007554.50811227.926335.0418-0.05180.0739
1170.0406-0.02050.01150.011515656.90336037.585377.7019-0.27530.141
1180.0395-0.00150.0090.00989.84224550.649567.4585-0.02090.111
1190.03960.00360.00790.0079558.08973752.137561.25470.0520.0992
1200.0403-0.04020.01330.013165011.370513962.0097118.1609-0.56090.1761
1210.0416-0.00540.01220.0121238.183112144.3202110.2013-0.07740.162
1220.04190.01290.01230.01217432.209711555.3064107.49560.18970.1655
1230.0424-0.01730.01280.012712836.304511697.6395108.1556-0.24930.1748
1240.0438-0.00280.01180.0117325.040910560.3796102.7637-0.03970.1613
1250.0437-0.02170.01270.012620239.706711440.3185106.9594-0.3130.1751
1260.0449-0.02070.01340.013218037.878111990.1151109.4994-0.29550.1851

\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.0388 & -0.0081 & 0.0081 & 0.008 & 1901.3445 & 0 & 0 & -0.0959 & 0.0959 \tabularnewline
116 & 0.066 & -0.006 & 0.0071 & 0.007 & 554.5081 & 1227.9263 & 35.0418 & -0.0518 & 0.0739 \tabularnewline
117 & 0.0406 & -0.0205 & 0.0115 & 0.0115 & 15656.9033 & 6037.5853 & 77.7019 & -0.2753 & 0.141 \tabularnewline
118 & 0.0395 & -0.0015 & 0.009 & 0.009 & 89.8422 & 4550.6495 & 67.4585 & -0.0209 & 0.111 \tabularnewline
119 & 0.0396 & 0.0036 & 0.0079 & 0.0079 & 558.0897 & 3752.1375 & 61.2547 & 0.052 & 0.0992 \tabularnewline
120 & 0.0403 & -0.0402 & 0.0133 & 0.0131 & 65011.3705 & 13962.0097 & 118.1609 & -0.5609 & 0.1761 \tabularnewline
121 & 0.0416 & -0.0054 & 0.0122 & 0.012 & 1238.1831 & 12144.3202 & 110.2013 & -0.0774 & 0.162 \tabularnewline
122 & 0.0419 & 0.0129 & 0.0123 & 0.0121 & 7432.2097 & 11555.3064 & 107.4956 & 0.1897 & 0.1655 \tabularnewline
123 & 0.0424 & -0.0173 & 0.0128 & 0.0127 & 12836.3045 & 11697.6395 & 108.1556 & -0.2493 & 0.1748 \tabularnewline
124 & 0.0438 & -0.0028 & 0.0118 & 0.0117 & 325.0409 & 10560.3796 & 102.7637 & -0.0397 & 0.1613 \tabularnewline
125 & 0.0437 & -0.0217 & 0.0127 & 0.0126 & 20239.7067 & 11440.3185 & 106.9594 & -0.313 & 0.1751 \tabularnewline
126 & 0.0449 & -0.0207 & 0.0134 & 0.0132 & 18037.8781 & 11990.1151 & 109.4994 & -0.2955 & 0.1851 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301947&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.0388[/C][C]-0.0081[/C][C]0.0081[/C][C]0.008[/C][C]1901.3445[/C][C]0[/C][C]0[/C][C]-0.0959[/C][C]0.0959[/C][/ROW]
[ROW][C]116[/C][C]0.066[/C][C]-0.006[/C][C]0.0071[/C][C]0.007[/C][C]554.5081[/C][C]1227.9263[/C][C]35.0418[/C][C]-0.0518[/C][C]0.0739[/C][/ROW]
[ROW][C]117[/C][C]0.0406[/C][C]-0.0205[/C][C]0.0115[/C][C]0.0115[/C][C]15656.9033[/C][C]6037.5853[/C][C]77.7019[/C][C]-0.2753[/C][C]0.141[/C][/ROW]
[ROW][C]118[/C][C]0.0395[/C][C]-0.0015[/C][C]0.009[/C][C]0.009[/C][C]89.8422[/C][C]4550.6495[/C][C]67.4585[/C][C]-0.0209[/C][C]0.111[/C][/ROW]
[ROW][C]119[/C][C]0.0396[/C][C]0.0036[/C][C]0.0079[/C][C]0.0079[/C][C]558.0897[/C][C]3752.1375[/C][C]61.2547[/C][C]0.052[/C][C]0.0992[/C][/ROW]
[ROW][C]120[/C][C]0.0403[/C][C]-0.0402[/C][C]0.0133[/C][C]0.0131[/C][C]65011.3705[/C][C]13962.0097[/C][C]118.1609[/C][C]-0.5609[/C][C]0.1761[/C][/ROW]
[ROW][C]121[/C][C]0.0416[/C][C]-0.0054[/C][C]0.0122[/C][C]0.012[/C][C]1238.1831[/C][C]12144.3202[/C][C]110.2013[/C][C]-0.0774[/C][C]0.162[/C][/ROW]
[ROW][C]122[/C][C]0.0419[/C][C]0.0129[/C][C]0.0123[/C][C]0.0121[/C][C]7432.2097[/C][C]11555.3064[/C][C]107.4956[/C][C]0.1897[/C][C]0.1655[/C][/ROW]
[ROW][C]123[/C][C]0.0424[/C][C]-0.0173[/C][C]0.0128[/C][C]0.0127[/C][C]12836.3045[/C][C]11697.6395[/C][C]108.1556[/C][C]-0.2493[/C][C]0.1748[/C][/ROW]
[ROW][C]124[/C][C]0.0438[/C][C]-0.0028[/C][C]0.0118[/C][C]0.0117[/C][C]325.0409[/C][C]10560.3796[/C][C]102.7637[/C][C]-0.0397[/C][C]0.1613[/C][/ROW]
[ROW][C]125[/C][C]0.0437[/C][C]-0.0217[/C][C]0.0127[/C][C]0.0126[/C][C]20239.7067[/C][C]11440.3185[/C][C]106.9594[/C][C]-0.313[/C][C]0.1751[/C][/ROW]
[ROW][C]126[/C][C]0.0449[/C][C]-0.0207[/C][C]0.0134[/C][C]0.0132[/C][C]18037.8781[/C][C]11990.1151[/C][C]109.4994[/C][C]-0.2955[/C][C]0.1851[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301947&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301947&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.0388-0.00810.00810.0081901.344500-0.09590.0959
1160.066-0.0060.00710.007554.50811227.926335.0418-0.05180.0739
1170.0406-0.02050.01150.011515656.90336037.585377.7019-0.27530.141
1180.0395-0.00150.0090.00989.84224550.649567.4585-0.02090.111
1190.03960.00360.00790.0079558.08973752.137561.25470.0520.0992
1200.0403-0.04020.01330.013165011.370513962.0097118.1609-0.56090.1761
1210.0416-0.00540.01220.0121238.183112144.3202110.2013-0.07740.162
1220.04190.01290.01230.01217432.209711555.3064107.49560.18970.1655
1230.0424-0.01730.01280.012712836.304511697.6395108.1556-0.24930.1748
1240.0438-0.00280.01180.0117325.040910560.3796102.7637-0.03970.1613
1250.0437-0.02170.01270.012620239.706711440.3185106.9594-0.3130.1751
1260.0449-0.02070.01340.013218037.878111990.1151109.4994-0.29550.1851



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