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, 16 Dec 2016 23:26:20 +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/16/t1481927820dzlvt8unmlflzyd.htm/, Retrieved Fri, 03 May 2024 02:16:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300579, Retrieved Fri, 03 May 2024 02:16:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact51
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2016-12-16 22:26:20] [8dbd6448339a84ba150e9d534057ba9c] [Current]
Feedback Forum

Post a new message
Dataseries X:
4400
4300
4610
4100
4000
4130
4320
4560
4430
4580
4370
4480
4520
4320
4960
4450
4680
4570
4520
5450
5110
4820
4640
4510
4450
4650
4720
4380
4870
4350
4160
4770
4400
4700
4520
4290
4520
4500
4690
4380
4620
4230
4310
4900
4740
5080
5090
4500
4670
4710
4310
4390
4530
4490
4720
5150
5220
5490
5260
5050
4890
4960
5120
5060
5430
5360
5090
5390
5330
5560
5370
5040
4760
4630
4790
4550
5180
5020
5040
5590
5330
5550
5630
5540
4880
4550
4530
4580
5090
4720
4900
5840
5250
5530
5370
4730
5030
4980
5080
4750
4890
4640
4800
5600
5040
5720
5650
4900
5240
5120
4950
5320
5590
4850
5180
5700
5370
5820
5940
5270
5350
5320
5300
5440
5390
5400




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300579&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[114])
1135590-------
1144850-------
11551805077.32154524.00085630.64230.3580.78970.78970.7897
11657005205.05114510.75955899.34260.08120.52820.52820.8419
11753704933.92184184.70475683.13890.1270.02250.02250.5869
11858205184.06374275.06266093.06470.08520.34420.34420.7643
11959405035.01434073.13455996.89410.03260.05480.05480.6469
12052705076.59394024.91976128.26810.35930.05380.05380.6636
12153505107.25913981.35566233.16250.33630.38850.38850.6729
12253205049.09563863.88446234.30680.32710.30940.30940.629
12353005101.01633843.61266358.42010.37820.36640.36640.6522
12454405071.08473757.9336384.23640.29090.36630.36630.6293
12553905078.53463705.63226451.43690.32830.30290.30290.6279
12654005085.74913656.66036514.83790.33320.33820.33820.6268

\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
113 & 5590 & - & - & - & - & - & - & - \tabularnewline
114 & 4850 & - & - & - & - & - & - & - \tabularnewline
115 & 5180 & 5077.3215 & 4524.0008 & 5630.6423 & 0.358 & 0.7897 & 0.7897 & 0.7897 \tabularnewline
116 & 5700 & 5205.0511 & 4510.7595 & 5899.3426 & 0.0812 & 0.5282 & 0.5282 & 0.8419 \tabularnewline
117 & 5370 & 4933.9218 & 4184.7047 & 5683.1389 & 0.127 & 0.0225 & 0.0225 & 0.5869 \tabularnewline
118 & 5820 & 5184.0637 & 4275.0626 & 6093.0647 & 0.0852 & 0.3442 & 0.3442 & 0.7643 \tabularnewline
119 & 5940 & 5035.0143 & 4073.1345 & 5996.8941 & 0.0326 & 0.0548 & 0.0548 & 0.6469 \tabularnewline
120 & 5270 & 5076.5939 & 4024.9197 & 6128.2681 & 0.3593 & 0.0538 & 0.0538 & 0.6636 \tabularnewline
121 & 5350 & 5107.2591 & 3981.3556 & 6233.1625 & 0.3363 & 0.3885 & 0.3885 & 0.6729 \tabularnewline
122 & 5320 & 5049.0956 & 3863.8844 & 6234.3068 & 0.3271 & 0.3094 & 0.3094 & 0.629 \tabularnewline
123 & 5300 & 5101.0163 & 3843.6126 & 6358.4201 & 0.3782 & 0.3664 & 0.3664 & 0.6522 \tabularnewline
124 & 5440 & 5071.0847 & 3757.933 & 6384.2364 & 0.2909 & 0.3663 & 0.3663 & 0.6293 \tabularnewline
125 & 5390 & 5078.5346 & 3705.6322 & 6451.4369 & 0.3283 & 0.3029 & 0.3029 & 0.6279 \tabularnewline
126 & 5400 & 5085.7491 & 3656.6603 & 6514.8379 & 0.3332 & 0.3382 & 0.3382 & 0.6268 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300579&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]113[/C][C]5590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]4850[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]5180[/C][C]5077.3215[/C][C]4524.0008[/C][C]5630.6423[/C][C]0.358[/C][C]0.7897[/C][C]0.7897[/C][C]0.7897[/C][/ROW]
[ROW][C]116[/C][C]5700[/C][C]5205.0511[/C][C]4510.7595[/C][C]5899.3426[/C][C]0.0812[/C][C]0.5282[/C][C]0.5282[/C][C]0.8419[/C][/ROW]
[ROW][C]117[/C][C]5370[/C][C]4933.9218[/C][C]4184.7047[/C][C]5683.1389[/C][C]0.127[/C][C]0.0225[/C][C]0.0225[/C][C]0.5869[/C][/ROW]
[ROW][C]118[/C][C]5820[/C][C]5184.0637[/C][C]4275.0626[/C][C]6093.0647[/C][C]0.0852[/C][C]0.3442[/C][C]0.3442[/C][C]0.7643[/C][/ROW]
[ROW][C]119[/C][C]5940[/C][C]5035.0143[/C][C]4073.1345[/C][C]5996.8941[/C][C]0.0326[/C][C]0.0548[/C][C]0.0548[/C][C]0.6469[/C][/ROW]
[ROW][C]120[/C][C]5270[/C][C]5076.5939[/C][C]4024.9197[/C][C]6128.2681[/C][C]0.3593[/C][C]0.0538[/C][C]0.0538[/C][C]0.6636[/C][/ROW]
[ROW][C]121[/C][C]5350[/C][C]5107.2591[/C][C]3981.3556[/C][C]6233.1625[/C][C]0.3363[/C][C]0.3885[/C][C]0.3885[/C][C]0.6729[/C][/ROW]
[ROW][C]122[/C][C]5320[/C][C]5049.0956[/C][C]3863.8844[/C][C]6234.3068[/C][C]0.3271[/C][C]0.3094[/C][C]0.3094[/C][C]0.629[/C][/ROW]
[ROW][C]123[/C][C]5300[/C][C]5101.0163[/C][C]3843.6126[/C][C]6358.4201[/C][C]0.3782[/C][C]0.3664[/C][C]0.3664[/C][C]0.6522[/C][/ROW]
[ROW][C]124[/C][C]5440[/C][C]5071.0847[/C][C]3757.933[/C][C]6384.2364[/C][C]0.2909[/C][C]0.3663[/C][C]0.3663[/C][C]0.6293[/C][/ROW]
[ROW][C]125[/C][C]5390[/C][C]5078.5346[/C][C]3705.6322[/C][C]6451.4369[/C][C]0.3283[/C][C]0.3029[/C][C]0.3029[/C][C]0.6279[/C][/ROW]
[ROW][C]126[/C][C]5400[/C][C]5085.7491[/C][C]3656.6603[/C][C]6514.8379[/C][C]0.3332[/C][C]0.3382[/C][C]0.3382[/C][C]0.6268[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300579&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300579&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])
1135590-------
1144850-------
11551805077.32154524.00085630.64230.3580.78970.78970.7897
11657005205.05114510.75955899.34260.08120.52820.52820.8419
11753704933.92184184.70475683.13890.1270.02250.02250.5869
11858205184.06374275.06266093.06470.08520.34420.34420.7643
11959405035.01434073.13455996.89410.03260.05480.05480.6469
12052705076.59394024.91976128.26810.35930.05380.05380.6636
12153505107.25913981.35566233.16250.33630.38850.38850.6729
12253205049.09563863.88446234.30680.32710.30940.30940.629
12353005101.01633843.61266358.42010.37820.36640.36640.6522
12454405071.08473757.9336384.23640.29090.36630.36630.6293
12553905078.53463705.63226451.43690.32830.30290.30290.6279
12654005085.74913656.66036514.83790.33320.33820.33820.6268







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.05560.01980.01980.0210542.8672000.46670.4667
1160.06810.08680.05330.0554244974.4592127758.6632357.43342.24981.3582
1170.07750.08120.06260.0651190164.205148560.5104385.43551.98221.5662
1180.08950.10930.07430.0778404415.0244212524.1389461.00342.89061.8973
1190.09750.15240.08990.0952818999.1462333819.1404577.77084.11362.3406
1200.10570.03670.0810.085637405.93284416.9387533.30750.87912.097
1210.11250.04540.07590.0858923.1583252203.5415502.19871.10341.955
1220.11980.05090.07280.076573389.2076229851.7497479.42861.23141.8646
1230.12580.03750.06890.072339594.4938208712.0546456.85010.90451.7579
1240.13210.06780.06880.072136098.4997201450.6991448.83261.67691.7498
1250.13790.05780.06780.070997010.7201191956.1556438.1281.41581.7194
1260.14340.05820.0670.0798753.6392184189.2792429.17281.42841.6952

\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.0556 & 0.0198 & 0.0198 & 0.02 & 10542.8672 & 0 & 0 & 0.4667 & 0.4667 \tabularnewline
116 & 0.0681 & 0.0868 & 0.0533 & 0.0554 & 244974.4592 & 127758.6632 & 357.4334 & 2.2498 & 1.3582 \tabularnewline
117 & 0.0775 & 0.0812 & 0.0626 & 0.0651 & 190164.205 & 148560.5104 & 385.4355 & 1.9822 & 1.5662 \tabularnewline
118 & 0.0895 & 0.1093 & 0.0743 & 0.0778 & 404415.0244 & 212524.1389 & 461.0034 & 2.8906 & 1.8973 \tabularnewline
119 & 0.0975 & 0.1524 & 0.0899 & 0.0952 & 818999.1462 & 333819.1404 & 577.7708 & 4.1136 & 2.3406 \tabularnewline
120 & 0.1057 & 0.0367 & 0.081 & 0.0856 & 37405.93 & 284416.9387 & 533.3075 & 0.8791 & 2.097 \tabularnewline
121 & 0.1125 & 0.0454 & 0.0759 & 0.08 & 58923.1583 & 252203.5415 & 502.1987 & 1.1034 & 1.955 \tabularnewline
122 & 0.1198 & 0.0509 & 0.0728 & 0.0765 & 73389.2076 & 229851.7497 & 479.4286 & 1.2314 & 1.8646 \tabularnewline
123 & 0.1258 & 0.0375 & 0.0689 & 0.0723 & 39594.4938 & 208712.0546 & 456.8501 & 0.9045 & 1.7579 \tabularnewline
124 & 0.1321 & 0.0678 & 0.0688 & 0.072 & 136098.4997 & 201450.6991 & 448.8326 & 1.6769 & 1.7498 \tabularnewline
125 & 0.1379 & 0.0578 & 0.0678 & 0.0709 & 97010.7201 & 191956.1556 & 438.128 & 1.4158 & 1.7194 \tabularnewline
126 & 0.1434 & 0.0582 & 0.067 & 0.07 & 98753.6392 & 184189.2792 & 429.1728 & 1.4284 & 1.6952 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300579&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.0556[/C][C]0.0198[/C][C]0.0198[/C][C]0.02[/C][C]10542.8672[/C][C]0[/C][C]0[/C][C]0.4667[/C][C]0.4667[/C][/ROW]
[ROW][C]116[/C][C]0.0681[/C][C]0.0868[/C][C]0.0533[/C][C]0.0554[/C][C]244974.4592[/C][C]127758.6632[/C][C]357.4334[/C][C]2.2498[/C][C]1.3582[/C][/ROW]
[ROW][C]117[/C][C]0.0775[/C][C]0.0812[/C][C]0.0626[/C][C]0.0651[/C][C]190164.205[/C][C]148560.5104[/C][C]385.4355[/C][C]1.9822[/C][C]1.5662[/C][/ROW]
[ROW][C]118[/C][C]0.0895[/C][C]0.1093[/C][C]0.0743[/C][C]0.0778[/C][C]404415.0244[/C][C]212524.1389[/C][C]461.0034[/C][C]2.8906[/C][C]1.8973[/C][/ROW]
[ROW][C]119[/C][C]0.0975[/C][C]0.1524[/C][C]0.0899[/C][C]0.0952[/C][C]818999.1462[/C][C]333819.1404[/C][C]577.7708[/C][C]4.1136[/C][C]2.3406[/C][/ROW]
[ROW][C]120[/C][C]0.1057[/C][C]0.0367[/C][C]0.081[/C][C]0.0856[/C][C]37405.93[/C][C]284416.9387[/C][C]533.3075[/C][C]0.8791[/C][C]2.097[/C][/ROW]
[ROW][C]121[/C][C]0.1125[/C][C]0.0454[/C][C]0.0759[/C][C]0.08[/C][C]58923.1583[/C][C]252203.5415[/C][C]502.1987[/C][C]1.1034[/C][C]1.955[/C][/ROW]
[ROW][C]122[/C][C]0.1198[/C][C]0.0509[/C][C]0.0728[/C][C]0.0765[/C][C]73389.2076[/C][C]229851.7497[/C][C]479.4286[/C][C]1.2314[/C][C]1.8646[/C][/ROW]
[ROW][C]123[/C][C]0.1258[/C][C]0.0375[/C][C]0.0689[/C][C]0.0723[/C][C]39594.4938[/C][C]208712.0546[/C][C]456.8501[/C][C]0.9045[/C][C]1.7579[/C][/ROW]
[ROW][C]124[/C][C]0.1321[/C][C]0.0678[/C][C]0.0688[/C][C]0.072[/C][C]136098.4997[/C][C]201450.6991[/C][C]448.8326[/C][C]1.6769[/C][C]1.7498[/C][/ROW]
[ROW][C]125[/C][C]0.1379[/C][C]0.0578[/C][C]0.0678[/C][C]0.0709[/C][C]97010.7201[/C][C]191956.1556[/C][C]438.128[/C][C]1.4158[/C][C]1.7194[/C][/ROW]
[ROW][C]126[/C][C]0.1434[/C][C]0.0582[/C][C]0.067[/C][C]0.07[/C][C]98753.6392[/C][C]184189.2792[/C][C]429.1728[/C][C]1.4284[/C][C]1.6952[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300579&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300579&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.05560.01980.01980.0210542.8672000.46670.4667
1160.06810.08680.05330.0554244974.4592127758.6632357.43342.24981.3582
1170.07750.08120.06260.0651190164.205148560.5104385.43551.98221.5662
1180.08950.10930.07430.0778404415.0244212524.1389461.00342.89061.8973
1190.09750.15240.08990.0952818999.1462333819.1404577.77084.11362.3406
1200.10570.03670.0810.085637405.93284416.9387533.30750.87912.097
1210.11250.04540.07590.0858923.1583252203.5415502.19871.10341.955
1220.11980.05090.07280.076573389.2076229851.7497479.42861.23141.8646
1230.12580.03750.06890.072339594.4938208712.0546456.85010.90451.7579
1240.13210.06780.06880.072136098.4997201450.6991448.83261.67691.7498
1250.13790.05780.06780.070997010.7201191956.1556438.1281.41581.7194
1260.14340.05820.0670.0798753.6392184189.2792429.17281.42841.6952



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