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 16:38:19 +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/t148190278480win5gu3yzr6zg.htm/, Retrieved Thu, 02 May 2024 17:04:59 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300376, Retrieved Thu, 02 May 2024 17:04:59 +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] [arima forecasting...] [2016-12-16 15:38:19] [31f526a885cd288e1bc58dc4a6a7fb1f] [Current]
Feedback Forum

Post a new message
Dataseries X:
2647.36
2711.22
2733.02
2831
2823.6
2833.46
2885.1
2929.78
3108.46
2921.92
2988.78
3038.84
3005.08
2816.94
3016.28
3242.68
3097.38
3057.18
3014.1
3063.66
3100.36
2964.4
3155.4
3217
3091.1
3192.64
3219.66
3478.26
3284.9
3382.2
3341.9
3402.18
3394.04
3374.1
3383.36
3626.54
3579.84
3530.72
3532.4
3636.68
3639.84
3676.98
3668.92
3718.74
3815.02
3799.9
3925.86
4226.32
4049.72
3883.56
3928.18
4377.66
4146.08
4246.12
4163.4
4144.76
4238.82
4352.28
4379.2
4451.02
4368.22
4337.82
4349.92
4079.42
4463.84
4552.72
4489
4455.9
4583.62
4512.76
4654.04
4768.44
4658.66
4589.98
4572.86
4643
4470.7
4635.34
4373.52
4348.18
4421.02
4363.52
4462.84
4567.34
4367.84
4382.64
4386.44
4489.36
4549.1
4627.66
4646.26
4728.68
4687.46
4755.26
4899.7
5042.06
4983.88
5028.08
4819.3
4889.86
4962.22
4968.92
5019.56
5099.18
5171.08
5353.5
5304.26
5636.62
5322.96
5308.46
5352.02
5358.9
5421.04
5537.66
5519.38
5643.06




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300376&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[104])
1035019.56-------
1045099.18-------
1055171.085063.99864826.74065301.25670.18820.38570.38570.3857
1065353.55063.99864780.74345347.25390.02260.22940.22940.4038
1075304.265063.99864741.23615386.76120.07230.03940.03940.4154
1085636.625063.99864706.06325421.93419e-040.09410.09410.4236
1095322.965063.99864674.055453.94730.09650.0020.0020.4298
1105308.465063.99864644.47265483.52460.12670.11320.11320.4347
1115352.025063.99864616.84745511.14980.10340.1420.1420.4387
1125358.95063.99864590.83245537.16490.11090.11640.11640.4421
1135421.045063.99864566.17495561.82240.07990.12280.12280.4449
1145537.665063.99864542.68245585.31480.03750.08970.08970.4474
1155519.385063.99864520.20395607.79340.05040.04390.04390.4495
1165643.065063.99864498.61845629.37890.02240.05720.05720.4515

\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
103 & 5019.56 & - & - & - & - & - & - & - \tabularnewline
104 & 5099.18 & - & - & - & - & - & - & - \tabularnewline
105 & 5171.08 & 5063.9986 & 4826.7406 & 5301.2567 & 0.1882 & 0.3857 & 0.3857 & 0.3857 \tabularnewline
106 & 5353.5 & 5063.9986 & 4780.7434 & 5347.2539 & 0.0226 & 0.2294 & 0.2294 & 0.4038 \tabularnewline
107 & 5304.26 & 5063.9986 & 4741.2361 & 5386.7612 & 0.0723 & 0.0394 & 0.0394 & 0.4154 \tabularnewline
108 & 5636.62 & 5063.9986 & 4706.0632 & 5421.9341 & 9e-04 & 0.0941 & 0.0941 & 0.4236 \tabularnewline
109 & 5322.96 & 5063.9986 & 4674.05 & 5453.9473 & 0.0965 & 0.002 & 0.002 & 0.4298 \tabularnewline
110 & 5308.46 & 5063.9986 & 4644.4726 & 5483.5246 & 0.1267 & 0.1132 & 0.1132 & 0.4347 \tabularnewline
111 & 5352.02 & 5063.9986 & 4616.8474 & 5511.1498 & 0.1034 & 0.142 & 0.142 & 0.4387 \tabularnewline
112 & 5358.9 & 5063.9986 & 4590.8324 & 5537.1649 & 0.1109 & 0.1164 & 0.1164 & 0.4421 \tabularnewline
113 & 5421.04 & 5063.9986 & 4566.1749 & 5561.8224 & 0.0799 & 0.1228 & 0.1228 & 0.4449 \tabularnewline
114 & 5537.66 & 5063.9986 & 4542.6824 & 5585.3148 & 0.0375 & 0.0897 & 0.0897 & 0.4474 \tabularnewline
115 & 5519.38 & 5063.9986 & 4520.2039 & 5607.7934 & 0.0504 & 0.0439 & 0.0439 & 0.4495 \tabularnewline
116 & 5643.06 & 5063.9986 & 4498.6184 & 5629.3789 & 0.0224 & 0.0572 & 0.0572 & 0.4515 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300376&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]103[/C][C]5019.56[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]5099.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]5171.08[/C][C]5063.9986[/C][C]4826.7406[/C][C]5301.2567[/C][C]0.1882[/C][C]0.3857[/C][C]0.3857[/C][C]0.3857[/C][/ROW]
[ROW][C]106[/C][C]5353.5[/C][C]5063.9986[/C][C]4780.7434[/C][C]5347.2539[/C][C]0.0226[/C][C]0.2294[/C][C]0.2294[/C][C]0.4038[/C][/ROW]
[ROW][C]107[/C][C]5304.26[/C][C]5063.9986[/C][C]4741.2361[/C][C]5386.7612[/C][C]0.0723[/C][C]0.0394[/C][C]0.0394[/C][C]0.4154[/C][/ROW]
[ROW][C]108[/C][C]5636.62[/C][C]5063.9986[/C][C]4706.0632[/C][C]5421.9341[/C][C]9e-04[/C][C]0.0941[/C][C]0.0941[/C][C]0.4236[/C][/ROW]
[ROW][C]109[/C][C]5322.96[/C][C]5063.9986[/C][C]4674.05[/C][C]5453.9473[/C][C]0.0965[/C][C]0.002[/C][C]0.002[/C][C]0.4298[/C][/ROW]
[ROW][C]110[/C][C]5308.46[/C][C]5063.9986[/C][C]4644.4726[/C][C]5483.5246[/C][C]0.1267[/C][C]0.1132[/C][C]0.1132[/C][C]0.4347[/C][/ROW]
[ROW][C]111[/C][C]5352.02[/C][C]5063.9986[/C][C]4616.8474[/C][C]5511.1498[/C][C]0.1034[/C][C]0.142[/C][C]0.142[/C][C]0.4387[/C][/ROW]
[ROW][C]112[/C][C]5358.9[/C][C]5063.9986[/C][C]4590.8324[/C][C]5537.1649[/C][C]0.1109[/C][C]0.1164[/C][C]0.1164[/C][C]0.4421[/C][/ROW]
[ROW][C]113[/C][C]5421.04[/C][C]5063.9986[/C][C]4566.1749[/C][C]5561.8224[/C][C]0.0799[/C][C]0.1228[/C][C]0.1228[/C][C]0.4449[/C][/ROW]
[ROW][C]114[/C][C]5537.66[/C][C]5063.9986[/C][C]4542.6824[/C][C]5585.3148[/C][C]0.0375[/C][C]0.0897[/C][C]0.0897[/C][C]0.4474[/C][/ROW]
[ROW][C]115[/C][C]5519.38[/C][C]5063.9986[/C][C]4520.2039[/C][C]5607.7934[/C][C]0.0504[/C][C]0.0439[/C][C]0.0439[/C][C]0.4495[/C][/ROW]
[ROW][C]116[/C][C]5643.06[/C][C]5063.9986[/C][C]4498.6184[/C][C]5629.3789[/C][C]0.0224[/C][C]0.0572[/C][C]0.0572[/C][C]0.4515[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300376&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300376&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])
1035019.56-------
1045099.18-------
1055171.085063.99864826.74065301.25670.18820.38570.38570.3857
1065353.55063.99864780.74345347.25390.02260.22940.22940.4038
1075304.265063.99864741.23615386.76120.07230.03940.03940.4154
1085636.625063.99864706.06325421.93419e-040.09410.09410.4236
1095322.965063.99864674.055453.94730.09650.0020.0020.4298
1105308.465063.99864644.47265483.52460.12670.11320.11320.4347
1115352.025063.99864616.84745511.14980.10340.1420.1420.4387
1125358.95063.99864590.83245537.16490.11090.11640.11640.4421
1135421.045063.99864566.17495561.82240.07990.12280.12280.4449
1145537.665063.99864542.68245585.31480.03750.08970.08970.4474
1155519.385063.99864520.20395607.79340.05040.04390.04390.4495
1165643.065063.99864498.61845629.37890.02240.05720.05720.4515







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1050.02390.02070.02070.020911466.4184000.93240.9324
1060.02850.05410.03740.038383811.039547638.729218.2632.52071.7265
1070.03250.04530.040.040957725.522851000.9936225.8342.0921.8484
1080.03610.10160.05540.0575327895.226120224.5517346.73414.98592.6327
1090.03930.04860.05410.055967060.9878109591.8389331.04662.25482.5571
1100.04230.04610.05270.054559761.3583101286.7588318.25582.12852.4857
1110.04510.05380.05290.054682956.305998668.1227314.11482.50782.4889
1120.04770.0550.05320.054886966.814297205.4591311.77792.56772.4987
1130.05020.06590.05460.0563127478.5353100569.1342317.12643.10882.5665
1140.05250.08550.05770.0596224355.0873112947.7295336.0774.12422.7223
1150.05480.08250.05990.062207372.1863121531.7711348.61413.9652.8353
1160.0570.10260.06350.0659335312.0628139346.7954373.29185.04193.0191

\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.0239 & 0.0207 & 0.0207 & 0.0209 & 11466.4184 & 0 & 0 & 0.9324 & 0.9324 \tabularnewline
106 & 0.0285 & 0.0541 & 0.0374 & 0.0383 & 83811.0395 & 47638.729 & 218.263 & 2.5207 & 1.7265 \tabularnewline
107 & 0.0325 & 0.0453 & 0.04 & 0.0409 & 57725.5228 & 51000.9936 & 225.834 & 2.092 & 1.8484 \tabularnewline
108 & 0.0361 & 0.1016 & 0.0554 & 0.0575 & 327895.226 & 120224.5517 & 346.7341 & 4.9859 & 2.6327 \tabularnewline
109 & 0.0393 & 0.0486 & 0.0541 & 0.0559 & 67060.9878 & 109591.8389 & 331.0466 & 2.2548 & 2.5571 \tabularnewline
110 & 0.0423 & 0.0461 & 0.0527 & 0.0545 & 59761.3583 & 101286.7588 & 318.2558 & 2.1285 & 2.4857 \tabularnewline
111 & 0.0451 & 0.0538 & 0.0529 & 0.0546 & 82956.3059 & 98668.1227 & 314.1148 & 2.5078 & 2.4889 \tabularnewline
112 & 0.0477 & 0.055 & 0.0532 & 0.0548 & 86966.8142 & 97205.4591 & 311.7779 & 2.5677 & 2.4987 \tabularnewline
113 & 0.0502 & 0.0659 & 0.0546 & 0.0563 & 127478.5353 & 100569.1342 & 317.1264 & 3.1088 & 2.5665 \tabularnewline
114 & 0.0525 & 0.0855 & 0.0577 & 0.0596 & 224355.0873 & 112947.7295 & 336.077 & 4.1242 & 2.7223 \tabularnewline
115 & 0.0548 & 0.0825 & 0.0599 & 0.062 & 207372.1863 & 121531.7711 & 348.6141 & 3.965 & 2.8353 \tabularnewline
116 & 0.057 & 0.1026 & 0.0635 & 0.0659 & 335312.0628 & 139346.7954 & 373.2918 & 5.0419 & 3.0191 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300376&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.0239[/C][C]0.0207[/C][C]0.0207[/C][C]0.0209[/C][C]11466.4184[/C][C]0[/C][C]0[/C][C]0.9324[/C][C]0.9324[/C][/ROW]
[ROW][C]106[/C][C]0.0285[/C][C]0.0541[/C][C]0.0374[/C][C]0.0383[/C][C]83811.0395[/C][C]47638.729[/C][C]218.263[/C][C]2.5207[/C][C]1.7265[/C][/ROW]
[ROW][C]107[/C][C]0.0325[/C][C]0.0453[/C][C]0.04[/C][C]0.0409[/C][C]57725.5228[/C][C]51000.9936[/C][C]225.834[/C][C]2.092[/C][C]1.8484[/C][/ROW]
[ROW][C]108[/C][C]0.0361[/C][C]0.1016[/C][C]0.0554[/C][C]0.0575[/C][C]327895.226[/C][C]120224.5517[/C][C]346.7341[/C][C]4.9859[/C][C]2.6327[/C][/ROW]
[ROW][C]109[/C][C]0.0393[/C][C]0.0486[/C][C]0.0541[/C][C]0.0559[/C][C]67060.9878[/C][C]109591.8389[/C][C]331.0466[/C][C]2.2548[/C][C]2.5571[/C][/ROW]
[ROW][C]110[/C][C]0.0423[/C][C]0.0461[/C][C]0.0527[/C][C]0.0545[/C][C]59761.3583[/C][C]101286.7588[/C][C]318.2558[/C][C]2.1285[/C][C]2.4857[/C][/ROW]
[ROW][C]111[/C][C]0.0451[/C][C]0.0538[/C][C]0.0529[/C][C]0.0546[/C][C]82956.3059[/C][C]98668.1227[/C][C]314.1148[/C][C]2.5078[/C][C]2.4889[/C][/ROW]
[ROW][C]112[/C][C]0.0477[/C][C]0.055[/C][C]0.0532[/C][C]0.0548[/C][C]86966.8142[/C][C]97205.4591[/C][C]311.7779[/C][C]2.5677[/C][C]2.4987[/C][/ROW]
[ROW][C]113[/C][C]0.0502[/C][C]0.0659[/C][C]0.0546[/C][C]0.0563[/C][C]127478.5353[/C][C]100569.1342[/C][C]317.1264[/C][C]3.1088[/C][C]2.5665[/C][/ROW]
[ROW][C]114[/C][C]0.0525[/C][C]0.0855[/C][C]0.0577[/C][C]0.0596[/C][C]224355.0873[/C][C]112947.7295[/C][C]336.077[/C][C]4.1242[/C][C]2.7223[/C][/ROW]
[ROW][C]115[/C][C]0.0548[/C][C]0.0825[/C][C]0.0599[/C][C]0.062[/C][C]207372.1863[/C][C]121531.7711[/C][C]348.6141[/C][C]3.965[/C][C]2.8353[/C][/ROW]
[ROW][C]116[/C][C]0.057[/C][C]0.1026[/C][C]0.0635[/C][C]0.0659[/C][C]335312.0628[/C][C]139346.7954[/C][C]373.2918[/C][C]5.0419[/C][C]3.0191[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300376&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300376&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.02390.02070.02070.020911466.4184000.93240.9324
1060.02850.05410.03740.038383811.039547638.729218.2632.52071.7265
1070.03250.04530.040.040957725.522851000.9936225.8342.0921.8484
1080.03610.10160.05540.0575327895.226120224.5517346.73414.98592.6327
1090.03930.04860.05410.055967060.9878109591.8389331.04662.25482.5571
1100.04230.04610.05270.054559761.3583101286.7588318.25582.12852.4857
1110.04510.05380.05290.054682956.305998668.1227314.11482.50782.4889
1120.04770.0550.05320.054886966.814297205.4591311.77792.56772.4987
1130.05020.06590.05460.0563127478.5353100569.1342317.12643.10882.5665
1140.05250.08550.05770.0596224355.0873112947.7295336.0774.12422.7223
1150.05480.08250.05990.062207372.1863121531.7711348.61413.9652.8353
1160.0570.10260.06350.0659335312.0628139346.7954373.29185.04193.0191



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