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 14:49:45 +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/t1482328206dzxxftygis0o3qp.htm/, Retrieved Mon, 06 May 2024 13:58:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302292, Retrieved Mon, 06 May 2024 13:58:57 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsN1910
Estimated Impact89
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ML Fitting and QQ Plot- Normal Distribution] [Normal distribution] [2016-12-15 09:27:42] [061bcad4f8cbfaa4a6cadfe6faec1e5a]
- RMPD  [Chi-Squared Test, McNemar Test, and Fisher Exact Test] [Chisquared simula...] [2016-12-15 10:38:18] [061bcad4f8cbfaa4a6cadfe6faec1e5a]
- RMPD      [ARIMA Forecasting] [ARIMA forecast] [2016-12-21 13:49:45] [9a9519454d094169f95f881e5b6f16f7] [Current]
Feedback Forum

Post a new message
Dataseries X:
4738.4
4687.2
5930.8
5532
5429.8
6107.4
5960.8
5541.8
5362.2
5237
4827
4781.6
4983.2
4718.4
5523.8
5286.6
5389
5810.4
5057.4
5604.4
5285
5215.2
4625.4
4270.4
4685.4
4233.8
5278.4
4978.8
5333.4
5451
5224
5790.2
5079.4
4705.8
4139.6
3720.8
4594
4638.8
4969.4
4764.4
5010.8
5267.8
5312.2
5723.2
4579.6
5015.2
4282.4
3834.2
4523.4
3884.2
3897.8
4845.6
4929
4955.4
5198.4
5122.2
4643.2
4789.8
3950.8
3824.4
4511.8
4262.4
4616.6
5139.6
4972.8
5222
5242
4979.8
4691.8
4821.6
4123.6
4027.4
4365.2
4333.6
4930
5053
5031.4
5342
5191.4
4852.2
4675.6
4689.2
3809.4
4054.2
4409.6
4210.2
4566.4
4907
5021.8
5215.2
4933.6
5197.8
4734.6
4681.8
4172
4037.8
4462.6
4282.6
4962.4
4969.2
5214.6
5416.8
4764.2
5326.2
4545.4
4797.2
4259
4117
4469.2
4203.2
5033.8
4883
5361.6
5044.6
5005.6
5382
4565.4
4825
4290.2
3933.6
4177.6
3949.4
4492.6
4894.2
5224.4
5071




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302292&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[116])
1045326.2-------
1054545.4-------
1064797.2-------
1074259-------
1084117-------
1094469.2-------
1104203.2-------
1115033.8-------
1124883-------
1135361.6-------
1145044.6-------
1155005.6-------
1165382-------
1174565.44598.93134141.34035075.50550.44526e-040.58716e-04
11848254805.65114317.8785314.08440.47030.82280.5130.0131
1194290.24201.86813730.87934694.98990.36280.00660.41020
1203933.64018.37473507.7124556.42530.37870.1610.35970
1214177.64493.87123951.50265063.7870.13840.9730.53380.0011
1223949.44270.75123732.15124838.00510.13340.62620.59231e-04
1234492.64862.98114280.94145474.32420.11750.99830.2920.0481
1244894.24967.2394376.41485587.61450.40880.93310.60490.095
1255224.45183.30884577.71225818.6310.44960.81380.29110.2699
12650715242.42234629.63075885.30750.30060.52190.72680.3352

\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[116]) \tabularnewline
104 & 5326.2 & - & - & - & - & - & - & - \tabularnewline
105 & 4545.4 & - & - & - & - & - & - & - \tabularnewline
106 & 4797.2 & - & - & - & - & - & - & - \tabularnewline
107 & 4259 & - & - & - & - & - & - & - \tabularnewline
108 & 4117 & - & - & - & - & - & - & - \tabularnewline
109 & 4469.2 & - & - & - & - & - & - & - \tabularnewline
110 & 4203.2 & - & - & - & - & - & - & - \tabularnewline
111 & 5033.8 & - & - & - & - & - & - & - \tabularnewline
112 & 4883 & - & - & - & - & - & - & - \tabularnewline
113 & 5361.6 & - & - & - & - & - & - & - \tabularnewline
114 & 5044.6 & - & - & - & - & - & - & - \tabularnewline
115 & 5005.6 & - & - & - & - & - & - & - \tabularnewline
116 & 5382 & - & - & - & - & - & - & - \tabularnewline
117 & 4565.4 & 4598.9313 & 4141.3403 & 5075.5055 & 0.4452 & 6e-04 & 0.5871 & 6e-04 \tabularnewline
118 & 4825 & 4805.6511 & 4317.878 & 5314.0844 & 0.4703 & 0.8228 & 0.513 & 0.0131 \tabularnewline
119 & 4290.2 & 4201.8681 & 3730.8793 & 4694.9899 & 0.3628 & 0.0066 & 0.4102 & 0 \tabularnewline
120 & 3933.6 & 4018.3747 & 3507.712 & 4556.4253 & 0.3787 & 0.161 & 0.3597 & 0 \tabularnewline
121 & 4177.6 & 4493.8712 & 3951.5026 & 5063.787 & 0.1384 & 0.973 & 0.5338 & 0.0011 \tabularnewline
122 & 3949.4 & 4270.7512 & 3732.1512 & 4838.0051 & 0.1334 & 0.6262 & 0.5923 & 1e-04 \tabularnewline
123 & 4492.6 & 4862.9811 & 4280.9414 & 5474.3242 & 0.1175 & 0.9983 & 0.292 & 0.0481 \tabularnewline
124 & 4894.2 & 4967.239 & 4376.4148 & 5587.6145 & 0.4088 & 0.9331 & 0.6049 & 0.095 \tabularnewline
125 & 5224.4 & 5183.3088 & 4577.7122 & 5818.631 & 0.4496 & 0.8138 & 0.2911 & 0.2699 \tabularnewline
126 & 5071 & 5242.4223 & 4629.6307 & 5885.3075 & 0.3006 & 0.5219 & 0.7268 & 0.3352 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302292&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[116])[/C][/ROW]
[ROW][C]104[/C][C]5326.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]4545.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]4797.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]4259[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]4117[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]4469.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]4203.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]5033.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]4883[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]5361.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]5044.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]5005.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]5382[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]4565.4[/C][C]4598.9313[/C][C]4141.3403[/C][C]5075.5055[/C][C]0.4452[/C][C]6e-04[/C][C]0.5871[/C][C]6e-04[/C][/ROW]
[ROW][C]118[/C][C]4825[/C][C]4805.6511[/C][C]4317.878[/C][C]5314.0844[/C][C]0.4703[/C][C]0.8228[/C][C]0.513[/C][C]0.0131[/C][/ROW]
[ROW][C]119[/C][C]4290.2[/C][C]4201.8681[/C][C]3730.8793[/C][C]4694.9899[/C][C]0.3628[/C][C]0.0066[/C][C]0.4102[/C][C]0[/C][/ROW]
[ROW][C]120[/C][C]3933.6[/C][C]4018.3747[/C][C]3507.712[/C][C]4556.4253[/C][C]0.3787[/C][C]0.161[/C][C]0.3597[/C][C]0[/C][/ROW]
[ROW][C]121[/C][C]4177.6[/C][C]4493.8712[/C][C]3951.5026[/C][C]5063.787[/C][C]0.1384[/C][C]0.973[/C][C]0.5338[/C][C]0.0011[/C][/ROW]
[ROW][C]122[/C][C]3949.4[/C][C]4270.7512[/C][C]3732.1512[/C][C]4838.0051[/C][C]0.1334[/C][C]0.6262[/C][C]0.5923[/C][C]1e-04[/C][/ROW]
[ROW][C]123[/C][C]4492.6[/C][C]4862.9811[/C][C]4280.9414[/C][C]5474.3242[/C][C]0.1175[/C][C]0.9983[/C][C]0.292[/C][C]0.0481[/C][/ROW]
[ROW][C]124[/C][C]4894.2[/C][C]4967.239[/C][C]4376.4148[/C][C]5587.6145[/C][C]0.4088[/C][C]0.9331[/C][C]0.6049[/C][C]0.095[/C][/ROW]
[ROW][C]125[/C][C]5224.4[/C][C]5183.3088[/C][C]4577.7122[/C][C]5818.631[/C][C]0.4496[/C][C]0.8138[/C][C]0.2911[/C][C]0.2699[/C][/ROW]
[ROW][C]126[/C][C]5071[/C][C]5242.4223[/C][C]4629.6307[/C][C]5885.3075[/C][C]0.3006[/C][C]0.5219[/C][C]0.7268[/C][C]0.3352[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302292&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302292&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[116])
1045326.2-------
1054545.4-------
1064797.2-------
1074259-------
1084117-------
1094469.2-------
1104203.2-------
1115033.8-------
1124883-------
1135361.6-------
1145044.6-------
1155005.6-------
1165382-------
1174565.44598.93134141.34035075.50550.44526e-040.58716e-04
11848254805.65114317.8785314.08440.47030.82280.5130.0131
1194290.24201.86813730.87934694.98990.36280.00660.41020
1203933.64018.37473507.7124556.42530.37870.1610.35970
1214177.64493.87123951.50265063.7870.13840.9730.53380.0011
1223949.44270.75123732.15124838.00510.13340.62620.59231e-04
1234492.64862.98114280.94145474.32420.11750.99830.2920.0481
1244894.24967.2394376.41485587.61450.40880.93310.60490.095
1255224.45183.30884577.71225818.6310.44960.81380.29110.2699
12650715242.42234629.63075885.30750.30060.52190.72680.3352







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1170.0529-0.00730.00730.00731124.347400-0.09890.0989
1180.0540.0040.00570.0057374.3784749.362927.37450.05710.078
1190.05990.02060.01060.01077802.51763100.414555.68140.26050.1388
1200.0683-0.02160.01340.01347186.74174121.996364.2028-0.250.1666
1210.0647-0.07570.02580.0253100027.468223303.0907152.6535-0.93280.3199
1220.0678-0.08140.03510.0341103266.624736630.3464191.3906-0.94780.4245
1230.0641-0.08240.04190.0405137182.125250994.8862225.8205-1.09240.5199
1240.0637-0.01490.03850.03735334.701445287.3631212.8083-0.21540.4818
1250.06250.00790.03510.03411688.48440443.0432201.10460.12120.4418
1260.0626-0.03380.0350.03429385.609639337.2998198.3363-0.50560.4482

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
117 & 0.0529 & -0.0073 & 0.0073 & 0.0073 & 1124.3474 & 0 & 0 & -0.0989 & 0.0989 \tabularnewline
118 & 0.054 & 0.004 & 0.0057 & 0.0057 & 374.3784 & 749.3629 & 27.3745 & 0.0571 & 0.078 \tabularnewline
119 & 0.0599 & 0.0206 & 0.0106 & 0.0107 & 7802.5176 & 3100.4145 & 55.6814 & 0.2605 & 0.1388 \tabularnewline
120 & 0.0683 & -0.0216 & 0.0134 & 0.0134 & 7186.7417 & 4121.9963 & 64.2028 & -0.25 & 0.1666 \tabularnewline
121 & 0.0647 & -0.0757 & 0.0258 & 0.0253 & 100027.4682 & 23303.0907 & 152.6535 & -0.9328 & 0.3199 \tabularnewline
122 & 0.0678 & -0.0814 & 0.0351 & 0.0341 & 103266.6247 & 36630.3464 & 191.3906 & -0.9478 & 0.4245 \tabularnewline
123 & 0.0641 & -0.0824 & 0.0419 & 0.0405 & 137182.1252 & 50994.8862 & 225.8205 & -1.0924 & 0.5199 \tabularnewline
124 & 0.0637 & -0.0149 & 0.0385 & 0.0373 & 5334.7014 & 45287.3631 & 212.8083 & -0.2154 & 0.4818 \tabularnewline
125 & 0.0625 & 0.0079 & 0.0351 & 0.0341 & 1688.484 & 40443.0432 & 201.1046 & 0.1212 & 0.4418 \tabularnewline
126 & 0.0626 & -0.0338 & 0.035 & 0.034 & 29385.6096 & 39337.2998 & 198.3363 & -0.5056 & 0.4482 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302292&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]117[/C][C]0.0529[/C][C]-0.0073[/C][C]0.0073[/C][C]0.0073[/C][C]1124.3474[/C][C]0[/C][C]0[/C][C]-0.0989[/C][C]0.0989[/C][/ROW]
[ROW][C]118[/C][C]0.054[/C][C]0.004[/C][C]0.0057[/C][C]0.0057[/C][C]374.3784[/C][C]749.3629[/C][C]27.3745[/C][C]0.0571[/C][C]0.078[/C][/ROW]
[ROW][C]119[/C][C]0.0599[/C][C]0.0206[/C][C]0.0106[/C][C]0.0107[/C][C]7802.5176[/C][C]3100.4145[/C][C]55.6814[/C][C]0.2605[/C][C]0.1388[/C][/ROW]
[ROW][C]120[/C][C]0.0683[/C][C]-0.0216[/C][C]0.0134[/C][C]0.0134[/C][C]7186.7417[/C][C]4121.9963[/C][C]64.2028[/C][C]-0.25[/C][C]0.1666[/C][/ROW]
[ROW][C]121[/C][C]0.0647[/C][C]-0.0757[/C][C]0.0258[/C][C]0.0253[/C][C]100027.4682[/C][C]23303.0907[/C][C]152.6535[/C][C]-0.9328[/C][C]0.3199[/C][/ROW]
[ROW][C]122[/C][C]0.0678[/C][C]-0.0814[/C][C]0.0351[/C][C]0.0341[/C][C]103266.6247[/C][C]36630.3464[/C][C]191.3906[/C][C]-0.9478[/C][C]0.4245[/C][/ROW]
[ROW][C]123[/C][C]0.0641[/C][C]-0.0824[/C][C]0.0419[/C][C]0.0405[/C][C]137182.1252[/C][C]50994.8862[/C][C]225.8205[/C][C]-1.0924[/C][C]0.5199[/C][/ROW]
[ROW][C]124[/C][C]0.0637[/C][C]-0.0149[/C][C]0.0385[/C][C]0.0373[/C][C]5334.7014[/C][C]45287.3631[/C][C]212.8083[/C][C]-0.2154[/C][C]0.4818[/C][/ROW]
[ROW][C]125[/C][C]0.0625[/C][C]0.0079[/C][C]0.0351[/C][C]0.0341[/C][C]1688.484[/C][C]40443.0432[/C][C]201.1046[/C][C]0.1212[/C][C]0.4418[/C][/ROW]
[ROW][C]126[/C][C]0.0626[/C][C]-0.0338[/C][C]0.035[/C][C]0.034[/C][C]29385.6096[/C][C]39337.2998[/C][C]198.3363[/C][C]-0.5056[/C][C]0.4482[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302292&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302292&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
1170.0529-0.00730.00730.00731124.347400-0.09890.0989
1180.0540.0040.00570.0057374.3784749.362927.37450.05710.078
1190.05990.02060.01060.01077802.51763100.414555.68140.26050.1388
1200.0683-0.02160.01340.01347186.74174121.996364.2028-0.250.1666
1210.0647-0.07570.02580.0253100027.468223303.0907152.6535-0.93280.3199
1220.0678-0.08140.03510.0341103266.624736630.3464191.3906-0.94780.4245
1230.0641-0.08240.04190.0405137182.125250994.8862225.8205-1.09240.5199
1240.0637-0.01490.03850.03735334.701445287.3631212.8083-0.21540.4818
1250.06250.00790.03510.03411688.48440443.0432201.10460.12120.4418
1260.0626-0.03380.0350.03429385.609639337.2998198.3363-0.50560.4482



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