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 17:05:54 +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/t1481904387uvq967sd17u6rlb.htm/, Retrieved Fri, 01 Nov 2024 03:46:45 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300403, Retrieved Fri, 01 Nov 2024 03:46:45 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact97
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [Arima forecast 3e] [2016-12-14 14:39:22] [5f979cb1c6fa86b57093c7542788c28c]
-   PD    [ARIMA Forecasting] [dsfgdhj] [2016-12-16 16:05:54] [4c05fa0998bf98e29c2e453b139976f4] [Current]
- R         [ARIMA Forecasting] [dfgyhuijk] [2016-12-16 16:18:52] [5f979cb1c6fa86b57093c7542788c28c]
Feedback Forum

Post a new message
Dataseries X:
5345
5245
5100
5070
5035
5050
5065
5255
5335
5440
5490
5445
5675
5615
5545
5510
5570
5610
5555
5630
5685
5545
5625
5570
5555
5635
5535
5430
5400
5410
5255
5350
5405
5420
5430
5580
5595
5485
5295
5055
4975
4895
4795
4855
4785
4875
5010
4970
4995
5020
4950
4880
4850
4885
4785
5025
5030
5160
5240
5175
5130
5140
5140
5055
5015
5015
4920
5095
5010
5100
5115
5060
5035
5005
4960
5035
4980
4940
4810
5025
5035
5060
5140
4955
5135
5135
5070
5070
5005
5045
4975
5080
5125
5225
5240
5090
5105
5200
5115
4990
4905
4980
4840
4960
4970
5035
5030
4965
4925
4920
4895
4890
4895
4850
4830
4870




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300403&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[104])
925080-------
935125-------
945225-------
955240-------
965090-------
975105-------
985200-------
995115-------
1004990-------
1014905-------
1024980-------
1034840-------
1044960-------
10549704968.08464819.29185116.87730.48990.54240.01940.5424
10650355030.02164819.59685240.44630.48150.71190.03470.7429
10750305083.57114825.85455341.28770.34180.64410.11710.8263
10849655003.62424706.03875301.20970.39960.4310.28470.6131
10949255049.62114716.91045382.33180.23140.69090.37210.7012
11049205056.61674692.25465420.97880.23120.76050.22030.6984
11148954979.74924586.27355373.22490.33650.6170.25020.5392
11248904917.15724496.57855337.73590.44960.54110.36710.4209
11348954866.02124419.98335312.05910.44930.4580.4320.3398
11448504884.50824414.38785354.62850.44280.48260.34530.3765
11548304783.22554290.19765276.25330.42620.39530.41070.2411
11648704926.13214411.21485441.04940.41540.64280.44870.4487

\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[104]) \tabularnewline
92 & 5080 & - & - & - & - & - & - & - \tabularnewline
93 & 5125 & - & - & - & - & - & - & - \tabularnewline
94 & 5225 & - & - & - & - & - & - & - \tabularnewline
95 & 5240 & - & - & - & - & - & - & - \tabularnewline
96 & 5090 & - & - & - & - & - & - & - \tabularnewline
97 & 5105 & - & - & - & - & - & - & - \tabularnewline
98 & 5200 & - & - & - & - & - & - & - \tabularnewline
99 & 5115 & - & - & - & - & - & - & - \tabularnewline
100 & 4990 & - & - & - & - & - & - & - \tabularnewline
101 & 4905 & - & - & - & - & - & - & - \tabularnewline
102 & 4980 & - & - & - & - & - & - & - \tabularnewline
103 & 4840 & - & - & - & - & - & - & - \tabularnewline
104 & 4960 & - & - & - & - & - & - & - \tabularnewline
105 & 4970 & 4968.0846 & 4819.2918 & 5116.8773 & 0.4899 & 0.5424 & 0.0194 & 0.5424 \tabularnewline
106 & 5035 & 5030.0216 & 4819.5968 & 5240.4463 & 0.4815 & 0.7119 & 0.0347 & 0.7429 \tabularnewline
107 & 5030 & 5083.5711 & 4825.8545 & 5341.2877 & 0.3418 & 0.6441 & 0.1171 & 0.8263 \tabularnewline
108 & 4965 & 5003.6242 & 4706.0387 & 5301.2097 & 0.3996 & 0.431 & 0.2847 & 0.6131 \tabularnewline
109 & 4925 & 5049.6211 & 4716.9104 & 5382.3318 & 0.2314 & 0.6909 & 0.3721 & 0.7012 \tabularnewline
110 & 4920 & 5056.6167 & 4692.2546 & 5420.9788 & 0.2312 & 0.7605 & 0.2203 & 0.6984 \tabularnewline
111 & 4895 & 4979.7492 & 4586.2735 & 5373.2249 & 0.3365 & 0.617 & 0.2502 & 0.5392 \tabularnewline
112 & 4890 & 4917.1572 & 4496.5785 & 5337.7359 & 0.4496 & 0.5411 & 0.3671 & 0.4209 \tabularnewline
113 & 4895 & 4866.0212 & 4419.9833 & 5312.0591 & 0.4493 & 0.458 & 0.432 & 0.3398 \tabularnewline
114 & 4850 & 4884.5082 & 4414.3878 & 5354.6285 & 0.4428 & 0.4826 & 0.3453 & 0.3765 \tabularnewline
115 & 4830 & 4783.2255 & 4290.1976 & 5276.2533 & 0.4262 & 0.3953 & 0.4107 & 0.2411 \tabularnewline
116 & 4870 & 4926.1321 & 4411.2148 & 5441.0494 & 0.4154 & 0.6428 & 0.4487 & 0.4487 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300403&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[104])[/C][/ROW]
[ROW][C]92[/C][C]5080[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]5125[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]5225[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]5240[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]5090[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]5105[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]5200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]5115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]4990[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]4905[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]4980[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]4840[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]4960[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]4970[/C][C]4968.0846[/C][C]4819.2918[/C][C]5116.8773[/C][C]0.4899[/C][C]0.5424[/C][C]0.0194[/C][C]0.5424[/C][/ROW]
[ROW][C]106[/C][C]5035[/C][C]5030.0216[/C][C]4819.5968[/C][C]5240.4463[/C][C]0.4815[/C][C]0.7119[/C][C]0.0347[/C][C]0.7429[/C][/ROW]
[ROW][C]107[/C][C]5030[/C][C]5083.5711[/C][C]4825.8545[/C][C]5341.2877[/C][C]0.3418[/C][C]0.6441[/C][C]0.1171[/C][C]0.8263[/C][/ROW]
[ROW][C]108[/C][C]4965[/C][C]5003.6242[/C][C]4706.0387[/C][C]5301.2097[/C][C]0.3996[/C][C]0.431[/C][C]0.2847[/C][C]0.6131[/C][/ROW]
[ROW][C]109[/C][C]4925[/C][C]5049.6211[/C][C]4716.9104[/C][C]5382.3318[/C][C]0.2314[/C][C]0.6909[/C][C]0.3721[/C][C]0.7012[/C][/ROW]
[ROW][C]110[/C][C]4920[/C][C]5056.6167[/C][C]4692.2546[/C][C]5420.9788[/C][C]0.2312[/C][C]0.7605[/C][C]0.2203[/C][C]0.6984[/C][/ROW]
[ROW][C]111[/C][C]4895[/C][C]4979.7492[/C][C]4586.2735[/C][C]5373.2249[/C][C]0.3365[/C][C]0.617[/C][C]0.2502[/C][C]0.5392[/C][/ROW]
[ROW][C]112[/C][C]4890[/C][C]4917.1572[/C][C]4496.5785[/C][C]5337.7359[/C][C]0.4496[/C][C]0.5411[/C][C]0.3671[/C][C]0.4209[/C][/ROW]
[ROW][C]113[/C][C]4895[/C][C]4866.0212[/C][C]4419.9833[/C][C]5312.0591[/C][C]0.4493[/C][C]0.458[/C][C]0.432[/C][C]0.3398[/C][/ROW]
[ROW][C]114[/C][C]4850[/C][C]4884.5082[/C][C]4414.3878[/C][C]5354.6285[/C][C]0.4428[/C][C]0.4826[/C][C]0.3453[/C][C]0.3765[/C][/ROW]
[ROW][C]115[/C][C]4830[/C][C]4783.2255[/C][C]4290.1976[/C][C]5276.2533[/C][C]0.4262[/C][C]0.3953[/C][C]0.4107[/C][C]0.2411[/C][/ROW]
[ROW][C]116[/C][C]4870[/C][C]4926.1321[/C][C]4411.2148[/C][C]5441.0494[/C][C]0.4154[/C][C]0.6428[/C][C]0.4487[/C][C]0.4487[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300403&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300403&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[104])
925080-------
935125-------
945225-------
955240-------
965090-------
975105-------
985200-------
995115-------
1004990-------
1014905-------
1024980-------
1034840-------
1044960-------
10549704968.08464819.29185116.87730.48990.54240.01940.5424
10650355030.02164819.59685240.44630.48150.71190.03470.7429
10750305083.57114825.85455341.28770.34180.64410.11710.8263
10849655003.62424706.03875301.20970.39960.4310.28470.6131
10949255049.62114716.91045382.33180.23140.69090.37210.7012
11049205056.61674692.25465420.97880.23120.76050.22030.6984
11148954979.74924586.27355373.22490.33650.6170.25020.5392
11248904917.15724496.57855337.73590.44960.54110.36710.4209
11348954866.02124419.98335312.05910.44930.4580.4320.3398
11448504884.50824414.38785354.62850.44280.48260.34530.3765
11548304783.22554290.19765276.25330.42620.39530.41070.2411
11648704926.13214411.21485441.04940.41540.64280.44870.4487







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1050.01534e-044e-044e-043.6689000.06580.0658
1060.02130.0017e-047e-0424.784914.22693.77190.17110.1185
1070.0259-0.01070.0040.0042869.8657966.106531.0823-1.84150.6928
1080.0303-0.00780.0050.00491491.82711097.536633.1291-1.32770.8515
1090.0336-0.02530.0090.008915530.41233984.111863.1198-4.28381.538
1100.0368-0.02780.01210.01218664.12486430.780680.1921-4.69622.0644
1110.0403-0.01730.01290.01287182.42436538.158380.8589-2.91332.1856
1120.0436-0.00560.0120.0118737.51255813.077676.2435-0.93352.0291
1130.04680.00590.01130.0112839.77295260.488172.52920.99611.9144
1140.0491-0.00710.01090.01081190.81524853.520969.6672-1.18621.8415
1150.05260.00970.01080.01072187.85654611.187767.90571.60791.8203
1160.0533-0.01150.01080.01083150.81764489.490267.0037-1.92951.8294

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
105 & 0.0153 & 4e-04 & 4e-04 & 4e-04 & 3.6689 & 0 & 0 & 0.0658 & 0.0658 \tabularnewline
106 & 0.0213 & 0.001 & 7e-04 & 7e-04 & 24.7849 & 14.2269 & 3.7719 & 0.1711 & 0.1185 \tabularnewline
107 & 0.0259 & -0.0107 & 0.004 & 0.004 & 2869.8657 & 966.1065 & 31.0823 & -1.8415 & 0.6928 \tabularnewline
108 & 0.0303 & -0.0078 & 0.005 & 0.0049 & 1491.8271 & 1097.5366 & 33.1291 & -1.3277 & 0.8515 \tabularnewline
109 & 0.0336 & -0.0253 & 0.009 & 0.0089 & 15530.4123 & 3984.1118 & 63.1198 & -4.2838 & 1.538 \tabularnewline
110 & 0.0368 & -0.0278 & 0.0121 & 0.012 & 18664.1248 & 6430.7806 & 80.1921 & -4.6962 & 2.0644 \tabularnewline
111 & 0.0403 & -0.0173 & 0.0129 & 0.0128 & 7182.4243 & 6538.1583 & 80.8589 & -2.9133 & 2.1856 \tabularnewline
112 & 0.0436 & -0.0056 & 0.012 & 0.0118 & 737.5125 & 5813.0776 & 76.2435 & -0.9335 & 2.0291 \tabularnewline
113 & 0.0468 & 0.0059 & 0.0113 & 0.0112 & 839.7729 & 5260.4881 & 72.5292 & 0.9961 & 1.9144 \tabularnewline
114 & 0.0491 & -0.0071 & 0.0109 & 0.0108 & 1190.8152 & 4853.5209 & 69.6672 & -1.1862 & 1.8415 \tabularnewline
115 & 0.0526 & 0.0097 & 0.0108 & 0.0107 & 2187.8565 & 4611.1877 & 67.9057 & 1.6079 & 1.8203 \tabularnewline
116 & 0.0533 & -0.0115 & 0.0108 & 0.0108 & 3150.8176 & 4489.4902 & 67.0037 & -1.9295 & 1.8294 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300403&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]105[/C][C]0.0153[/C][C]4e-04[/C][C]4e-04[/C][C]4e-04[/C][C]3.6689[/C][C]0[/C][C]0[/C][C]0.0658[/C][C]0.0658[/C][/ROW]
[ROW][C]106[/C][C]0.0213[/C][C]0.001[/C][C]7e-04[/C][C]7e-04[/C][C]24.7849[/C][C]14.2269[/C][C]3.7719[/C][C]0.1711[/C][C]0.1185[/C][/ROW]
[ROW][C]107[/C][C]0.0259[/C][C]-0.0107[/C][C]0.004[/C][C]0.004[/C][C]2869.8657[/C][C]966.1065[/C][C]31.0823[/C][C]-1.8415[/C][C]0.6928[/C][/ROW]
[ROW][C]108[/C][C]0.0303[/C][C]-0.0078[/C][C]0.005[/C][C]0.0049[/C][C]1491.8271[/C][C]1097.5366[/C][C]33.1291[/C][C]-1.3277[/C][C]0.8515[/C][/ROW]
[ROW][C]109[/C][C]0.0336[/C][C]-0.0253[/C][C]0.009[/C][C]0.0089[/C][C]15530.4123[/C][C]3984.1118[/C][C]63.1198[/C][C]-4.2838[/C][C]1.538[/C][/ROW]
[ROW][C]110[/C][C]0.0368[/C][C]-0.0278[/C][C]0.0121[/C][C]0.012[/C][C]18664.1248[/C][C]6430.7806[/C][C]80.1921[/C][C]-4.6962[/C][C]2.0644[/C][/ROW]
[ROW][C]111[/C][C]0.0403[/C][C]-0.0173[/C][C]0.0129[/C][C]0.0128[/C][C]7182.4243[/C][C]6538.1583[/C][C]80.8589[/C][C]-2.9133[/C][C]2.1856[/C][/ROW]
[ROW][C]112[/C][C]0.0436[/C][C]-0.0056[/C][C]0.012[/C][C]0.0118[/C][C]737.5125[/C][C]5813.0776[/C][C]76.2435[/C][C]-0.9335[/C][C]2.0291[/C][/ROW]
[ROW][C]113[/C][C]0.0468[/C][C]0.0059[/C][C]0.0113[/C][C]0.0112[/C][C]839.7729[/C][C]5260.4881[/C][C]72.5292[/C][C]0.9961[/C][C]1.9144[/C][/ROW]
[ROW][C]114[/C][C]0.0491[/C][C]-0.0071[/C][C]0.0109[/C][C]0.0108[/C][C]1190.8152[/C][C]4853.5209[/C][C]69.6672[/C][C]-1.1862[/C][C]1.8415[/C][/ROW]
[ROW][C]115[/C][C]0.0526[/C][C]0.0097[/C][C]0.0108[/C][C]0.0107[/C][C]2187.8565[/C][C]4611.1877[/C][C]67.9057[/C][C]1.6079[/C][C]1.8203[/C][/ROW]
[ROW][C]116[/C][C]0.0533[/C][C]-0.0115[/C][C]0.0108[/C][C]0.0108[/C][C]3150.8176[/C][C]4489.4902[/C][C]67.0037[/C][C]-1.9295[/C][C]1.8294[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300403&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300403&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
1050.01534e-044e-044e-043.6689000.06580.0658
1060.02130.0017e-047e-0424.784914.22693.77190.17110.1185
1070.0259-0.01070.0040.0042869.8657966.106531.0823-1.84150.6928
1080.0303-0.00780.0050.00491491.82711097.536633.1291-1.32770.8515
1090.0336-0.02530.0090.008915530.41233984.111863.1198-4.28381.538
1100.0368-0.02780.01210.01218664.12486430.780680.1921-4.69622.0644
1110.0403-0.01730.01290.01287182.42436538.158380.8589-2.91332.1856
1120.0436-0.00560.0120.0118737.51255813.077676.2435-0.93352.0291
1130.04680.00590.01130.0112839.77295260.488172.52920.99611.9144
1140.0491-0.00710.01090.01081190.81524853.520969.6672-1.18621.8415
1150.05260.00970.01080.01072187.85654611.187767.90571.60791.8203
1160.0533-0.01150.01080.01083150.81764489.490267.0037-1.92951.8294



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