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 22:01:47 +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/t1482354231ntzb6yphaubq924.htm/, Retrieved Tue, 07 May 2024 04:07:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302507, Retrieved Tue, 07 May 2024 04:07:23 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact55
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [forecasting] [2016-12-21 21:01:47] [e7c866b75ad2fc21ab540ba3a0a42299] [Current]
Feedback Forum

Post a new message
Dataseries X:
5396.86
4963.38
5445.73
5038.03
5412.13
4965.15
5706.96
5176.7
5426.78
5083.14
5852.19
5144.63
5454.9
4958.98
5538.78
5044.74
5252.57
4945.69
6064.6
5335.02
5830.26
5391.33
6111.81
5472.44
5869.92
5423.01
6173.75
5592.14
5896.64
5505.83
6383.46
5761.51
5960.74
5772.04
6743.55
5878.49
6385.87
5900.06
7065.42
6147.75
6487.65
6119.33
7087.73
6422.35
6573.97
6301.82
7366.24
6444.26
6619.34
6528.77
7530.53




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302507&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[39])
276173.75-------
285592.14-------
295896.64-------
305505.83-------
316383.46-------
325761.51-------
335960.74-------
345772.04-------
356743.55-------
365878.49-------
376385.87-------
385900.06-------
397065.42-------
406147.756333.96926080.26236598.26230.0836010
416487.656528.1886183.38226892.22140.41360.97970.99970.0019
426119.336227.90935852.53166627.36360.29710.10120.99980
437087.737497.72756972.61518062.38650.077310.99990.9333
446422.356663.34046157.05777211.25370.19430.06450.99940.0752
456573.977120.81666528.31217767.09650.04860.98290.99980.5667
466301.826758.65596159.98617415.50860.08640.70920.99840.18
477366.247755.80727023.72988564.18840.17240.99980.99290.9529
486444.266876.38436193.55217634.49790.1320.10270.99510.3125
496619.347466.4246687.95598335.50460.0280.98940.99260.8171
506528.776955.26246201.07147801.180.16150.78180.99280.3993
517530.538210.63187286.2259252.31850.10030.99920.98440.9844

\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[39]) \tabularnewline
27 & 6173.75 & - & - & - & - & - & - & - \tabularnewline
28 & 5592.14 & - & - & - & - & - & - & - \tabularnewline
29 & 5896.64 & - & - & - & - & - & - & - \tabularnewline
30 & 5505.83 & - & - & - & - & - & - & - \tabularnewline
31 & 6383.46 & - & - & - & - & - & - & - \tabularnewline
32 & 5761.51 & - & - & - & - & - & - & - \tabularnewline
33 & 5960.74 & - & - & - & - & - & - & - \tabularnewline
34 & 5772.04 & - & - & - & - & - & - & - \tabularnewline
35 & 6743.55 & - & - & - & - & - & - & - \tabularnewline
36 & 5878.49 & - & - & - & - & - & - & - \tabularnewline
37 & 6385.87 & - & - & - & - & - & - & - \tabularnewline
38 & 5900.06 & - & - & - & - & - & - & - \tabularnewline
39 & 7065.42 & - & - & - & - & - & - & - \tabularnewline
40 & 6147.75 & 6333.9692 & 6080.2623 & 6598.2623 & 0.0836 & 0 & 1 & 0 \tabularnewline
41 & 6487.65 & 6528.188 & 6183.3822 & 6892.2214 & 0.4136 & 0.9797 & 0.9997 & 0.0019 \tabularnewline
42 & 6119.33 & 6227.9093 & 5852.5316 & 6627.3636 & 0.2971 & 0.1012 & 0.9998 & 0 \tabularnewline
43 & 7087.73 & 7497.7275 & 6972.6151 & 8062.3865 & 0.0773 & 1 & 0.9999 & 0.9333 \tabularnewline
44 & 6422.35 & 6663.3404 & 6157.0577 & 7211.2537 & 0.1943 & 0.0645 & 0.9994 & 0.0752 \tabularnewline
45 & 6573.97 & 7120.8166 & 6528.3121 & 7767.0965 & 0.0486 & 0.9829 & 0.9998 & 0.5667 \tabularnewline
46 & 6301.82 & 6758.6559 & 6159.9861 & 7415.5086 & 0.0864 & 0.7092 & 0.9984 & 0.18 \tabularnewline
47 & 7366.24 & 7755.8072 & 7023.7298 & 8564.1884 & 0.1724 & 0.9998 & 0.9929 & 0.9529 \tabularnewline
48 & 6444.26 & 6876.3843 & 6193.5521 & 7634.4979 & 0.132 & 0.1027 & 0.9951 & 0.3125 \tabularnewline
49 & 6619.34 & 7466.424 & 6687.9559 & 8335.5046 & 0.028 & 0.9894 & 0.9926 & 0.8171 \tabularnewline
50 & 6528.77 & 6955.2624 & 6201.0714 & 7801.18 & 0.1615 & 0.7818 & 0.9928 & 0.3993 \tabularnewline
51 & 7530.53 & 8210.6318 & 7286.225 & 9252.3185 & 0.1003 & 0.9992 & 0.9844 & 0.9844 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302507&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[39])[/C][/ROW]
[ROW][C]27[/C][C]6173.75[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]5592.14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]5896.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]5505.83[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]6383.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]5761.51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]5960.74[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]5772.04[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]6743.55[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]5878.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]6385.87[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]5900.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]7065.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]6147.75[/C][C]6333.9692[/C][C]6080.2623[/C][C]6598.2623[/C][C]0.0836[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]41[/C][C]6487.65[/C][C]6528.188[/C][C]6183.3822[/C][C]6892.2214[/C][C]0.4136[/C][C]0.9797[/C][C]0.9997[/C][C]0.0019[/C][/ROW]
[ROW][C]42[/C][C]6119.33[/C][C]6227.9093[/C][C]5852.5316[/C][C]6627.3636[/C][C]0.2971[/C][C]0.1012[/C][C]0.9998[/C][C]0[/C][/ROW]
[ROW][C]43[/C][C]7087.73[/C][C]7497.7275[/C][C]6972.6151[/C][C]8062.3865[/C][C]0.0773[/C][C]1[/C][C]0.9999[/C][C]0.9333[/C][/ROW]
[ROW][C]44[/C][C]6422.35[/C][C]6663.3404[/C][C]6157.0577[/C][C]7211.2537[/C][C]0.1943[/C][C]0.0645[/C][C]0.9994[/C][C]0.0752[/C][/ROW]
[ROW][C]45[/C][C]6573.97[/C][C]7120.8166[/C][C]6528.3121[/C][C]7767.0965[/C][C]0.0486[/C][C]0.9829[/C][C]0.9998[/C][C]0.5667[/C][/ROW]
[ROW][C]46[/C][C]6301.82[/C][C]6758.6559[/C][C]6159.9861[/C][C]7415.5086[/C][C]0.0864[/C][C]0.7092[/C][C]0.9984[/C][C]0.18[/C][/ROW]
[ROW][C]47[/C][C]7366.24[/C][C]7755.8072[/C][C]7023.7298[/C][C]8564.1884[/C][C]0.1724[/C][C]0.9998[/C][C]0.9929[/C][C]0.9529[/C][/ROW]
[ROW][C]48[/C][C]6444.26[/C][C]6876.3843[/C][C]6193.5521[/C][C]7634.4979[/C][C]0.132[/C][C]0.1027[/C][C]0.9951[/C][C]0.3125[/C][/ROW]
[ROW][C]49[/C][C]6619.34[/C][C]7466.424[/C][C]6687.9559[/C][C]8335.5046[/C][C]0.028[/C][C]0.9894[/C][C]0.9926[/C][C]0.8171[/C][/ROW]
[ROW][C]50[/C][C]6528.77[/C][C]6955.2624[/C][C]6201.0714[/C][C]7801.18[/C][C]0.1615[/C][C]0.7818[/C][C]0.9928[/C][C]0.3993[/C][/ROW]
[ROW][C]51[/C][C]7530.53[/C][C]8210.6318[/C][C]7286.225[/C][C]9252.3185[/C][C]0.1003[/C][C]0.9992[/C][C]0.9844[/C][C]0.9844[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302507&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302507&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[39])
276173.75-------
285592.14-------
295896.64-------
305505.83-------
316383.46-------
325761.51-------
335960.74-------
345772.04-------
356743.55-------
365878.49-------
376385.87-------
385900.06-------
397065.42-------
406147.756333.96926080.26236598.26230.0836010
416487.656528.1886183.38226892.22140.41360.97970.99970.0019
426119.336227.90935852.53166627.36360.29710.10120.99980
437087.737497.72756972.61518062.38650.077310.99990.9333
446422.356663.34046157.05777211.25370.19430.06450.99940.0752
456573.977120.81666528.31217767.09650.04860.98290.99980.5667
466301.826758.65596159.98617415.50860.08640.70920.99840.18
477366.247755.80727023.72988564.18840.17240.99980.99290.9529
486444.266876.38436193.55217634.49790.1320.10270.99510.3125
496619.347466.4246687.95598335.50460.0280.98940.99260.8171
506528.776955.26246201.07147801.180.16150.78180.99280.3993
517530.538210.63187286.2259252.31850.10030.99920.98440.9844







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
400.0213-0.03030.03030.029834677.582800-0.34030.3403
410.0285-0.00620.01830.0181643.33118160.4569134.7607-0.07410.2072
420.0327-0.01770.01810.017911789.473516036.7958126.6365-0.19840.2043
430.0384-0.05780.0280.0275168097.972454052.0899232.4911-0.74920.3405
440.042-0.03750.02990.029358076.36954856.9457234.2156-0.44040.3605
450.0463-0.08320.03880.0378299041.241695554.3284309.1186-0.99930.4669
460.0496-0.07250.04360.0424208699.0573111717.8611334.2422-0.83480.5195
470.0532-0.05290.04480.0435151762.5855116723.4516341.6481-0.71190.5435
480.0562-0.06710.04730.0459186731.3789124502.1102352.8486-0.78970.5709
490.0594-0.1280.05530.0533717551.2764183807.0268428.7272-1.54790.6686
500.0621-0.06530.05620.0542181895.7424183633.2737428.5245-0.77940.6787
510.0647-0.09030.05910.0569462538.4335206875.3704454.8355-1.24280.7257

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
40 & 0.0213 & -0.0303 & 0.0303 & 0.0298 & 34677.5828 & 0 & 0 & -0.3403 & 0.3403 \tabularnewline
41 & 0.0285 & -0.0062 & 0.0183 & 0.018 & 1643.331 & 18160.4569 & 134.7607 & -0.0741 & 0.2072 \tabularnewline
42 & 0.0327 & -0.0177 & 0.0181 & 0.0179 & 11789.4735 & 16036.7958 & 126.6365 & -0.1984 & 0.2043 \tabularnewline
43 & 0.0384 & -0.0578 & 0.028 & 0.0275 & 168097.9724 & 54052.0899 & 232.4911 & -0.7492 & 0.3405 \tabularnewline
44 & 0.042 & -0.0375 & 0.0299 & 0.0293 & 58076.369 & 54856.9457 & 234.2156 & -0.4404 & 0.3605 \tabularnewline
45 & 0.0463 & -0.0832 & 0.0388 & 0.0378 & 299041.2416 & 95554.3284 & 309.1186 & -0.9993 & 0.4669 \tabularnewline
46 & 0.0496 & -0.0725 & 0.0436 & 0.0424 & 208699.0573 & 111717.8611 & 334.2422 & -0.8348 & 0.5195 \tabularnewline
47 & 0.0532 & -0.0529 & 0.0448 & 0.0435 & 151762.5855 & 116723.4516 & 341.6481 & -0.7119 & 0.5435 \tabularnewline
48 & 0.0562 & -0.0671 & 0.0473 & 0.0459 & 186731.3789 & 124502.1102 & 352.8486 & -0.7897 & 0.5709 \tabularnewline
49 & 0.0594 & -0.128 & 0.0553 & 0.0533 & 717551.2764 & 183807.0268 & 428.7272 & -1.5479 & 0.6686 \tabularnewline
50 & 0.0621 & -0.0653 & 0.0562 & 0.0542 & 181895.7424 & 183633.2737 & 428.5245 & -0.7794 & 0.6787 \tabularnewline
51 & 0.0647 & -0.0903 & 0.0591 & 0.0569 & 462538.4335 & 206875.3704 & 454.8355 & -1.2428 & 0.7257 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302507&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]40[/C][C]0.0213[/C][C]-0.0303[/C][C]0.0303[/C][C]0.0298[/C][C]34677.5828[/C][C]0[/C][C]0[/C][C]-0.3403[/C][C]0.3403[/C][/ROW]
[ROW][C]41[/C][C]0.0285[/C][C]-0.0062[/C][C]0.0183[/C][C]0.018[/C][C]1643.331[/C][C]18160.4569[/C][C]134.7607[/C][C]-0.0741[/C][C]0.2072[/C][/ROW]
[ROW][C]42[/C][C]0.0327[/C][C]-0.0177[/C][C]0.0181[/C][C]0.0179[/C][C]11789.4735[/C][C]16036.7958[/C][C]126.6365[/C][C]-0.1984[/C][C]0.2043[/C][/ROW]
[ROW][C]43[/C][C]0.0384[/C][C]-0.0578[/C][C]0.028[/C][C]0.0275[/C][C]168097.9724[/C][C]54052.0899[/C][C]232.4911[/C][C]-0.7492[/C][C]0.3405[/C][/ROW]
[ROW][C]44[/C][C]0.042[/C][C]-0.0375[/C][C]0.0299[/C][C]0.0293[/C][C]58076.369[/C][C]54856.9457[/C][C]234.2156[/C][C]-0.4404[/C][C]0.3605[/C][/ROW]
[ROW][C]45[/C][C]0.0463[/C][C]-0.0832[/C][C]0.0388[/C][C]0.0378[/C][C]299041.2416[/C][C]95554.3284[/C][C]309.1186[/C][C]-0.9993[/C][C]0.4669[/C][/ROW]
[ROW][C]46[/C][C]0.0496[/C][C]-0.0725[/C][C]0.0436[/C][C]0.0424[/C][C]208699.0573[/C][C]111717.8611[/C][C]334.2422[/C][C]-0.8348[/C][C]0.5195[/C][/ROW]
[ROW][C]47[/C][C]0.0532[/C][C]-0.0529[/C][C]0.0448[/C][C]0.0435[/C][C]151762.5855[/C][C]116723.4516[/C][C]341.6481[/C][C]-0.7119[/C][C]0.5435[/C][/ROW]
[ROW][C]48[/C][C]0.0562[/C][C]-0.0671[/C][C]0.0473[/C][C]0.0459[/C][C]186731.3789[/C][C]124502.1102[/C][C]352.8486[/C][C]-0.7897[/C][C]0.5709[/C][/ROW]
[ROW][C]49[/C][C]0.0594[/C][C]-0.128[/C][C]0.0553[/C][C]0.0533[/C][C]717551.2764[/C][C]183807.0268[/C][C]428.7272[/C][C]-1.5479[/C][C]0.6686[/C][/ROW]
[ROW][C]50[/C][C]0.0621[/C][C]-0.0653[/C][C]0.0562[/C][C]0.0542[/C][C]181895.7424[/C][C]183633.2737[/C][C]428.5245[/C][C]-0.7794[/C][C]0.6787[/C][/ROW]
[ROW][C]51[/C][C]0.0647[/C][C]-0.0903[/C][C]0.0591[/C][C]0.0569[/C][C]462538.4335[/C][C]206875.3704[/C][C]454.8355[/C][C]-1.2428[/C][C]0.7257[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302507&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302507&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
400.0213-0.03030.03030.029834677.582800-0.34030.3403
410.0285-0.00620.01830.0181643.33118160.4569134.7607-0.07410.2072
420.0327-0.01770.01810.017911789.473516036.7958126.6365-0.19840.2043
430.0384-0.05780.0280.0275168097.972454052.0899232.4911-0.74920.3405
440.042-0.03750.02990.029358076.36954856.9457234.2156-0.44040.3605
450.0463-0.08320.03880.0378299041.241695554.3284309.1186-0.99930.4669
460.0496-0.07250.04360.0424208699.0573111717.8611334.2422-0.83480.5195
470.0532-0.05290.04480.0435151762.5855116723.4516341.6481-0.71190.5435
480.0562-0.06710.04730.0459186731.3789124502.1102352.8486-0.78970.5709
490.0594-0.1280.05530.0533717551.2764183807.0268428.7272-1.54790.6686
500.0621-0.06530.05620.0542181895.7424183633.2737428.5245-0.77940.6787
510.0647-0.09030.05910.0569462538.4335206875.3704454.8355-1.24280.7257



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