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, 14 Aug 2019 08:24:40 +0200
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2019/Aug/14/t156576446581roi2p2ly1ht4u.htm/, Retrieved Sun, 05 May 2024 01:54:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=318868, Retrieved Sun, 05 May 2024 01:54:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact134
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2019-08-14 06:24:40] [095936a48fd07f0963d107c0200b1eb5] [Current]
Feedback Forum

Post a new message
Dataseries X:
5331
3075
2002
2306
1507
1992
2487
3490
4647
5594
5611
5788
6204
3013
1931
2549
1504
2090
2702
2939
4500
6208
6415
5657
5964
3163
1997
2422
1376
2202
2683
3303
5202
5231
4880
7998
4977
3531
2025
2205
1442
2238
2179
3218
5139
4990
4914
6084
5672
3548
1793
2086
1262
1743
1964
3258
4966
4944
5907
5561
5321
3582
1757
1894
1192
1658
1919
3354
4529
5233
5910
5164
5152
3057
1855
1978
1255
1693
2449
3178
4831
6025
4492
5174
5600
2752
1925
2824
1041
1476
2239
2727
4303
5160
4103
5554
4906
2677
1677
1991
993
1800
2012
2880
4705
5107
4482
5966
4858
3036
1844
2196




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=318868&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[100])
882824-------
891041-------
901476-------
912239-------
922727-------
934303-------
945160-------
954103-------
965554-------
974906-------
982677-------
991677-------
1001991-------
1019931043.5532896.681223.30030.290700.51110
10218001466.0131239.54911749.34590.01040.99950.47251e-04
10320121970.28571640.81692391.19750.4230.78610.10540.4616
10428802835.02082285.11363570.13320.45230.98590.61330.9878
10547054268.00633347.47885546.64760.25150.98330.47860.9998
10651074986.9053867.71226566.34360.44080.63680.4150.9999
10744824521.22473525.40965915.91460.4780.20520.72160.9998
10859665369.58034134.01227131.53040.25350.83830.41870.9999
10948584911.02123806.17046471.7810.47350.09260.50250.9999
11030362775.56562235.86433497.63290.239800.60550.9834
11118441725.24651429.15662106.29580.270700.5980.0858
11221961980.73811628.1552439.37850.17880.72050.48250.4825

\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[100]) \tabularnewline
88 & 2824 & - & - & - & - & - & - & - \tabularnewline
89 & 1041 & - & - & - & - & - & - & - \tabularnewline
90 & 1476 & - & - & - & - & - & - & - \tabularnewline
91 & 2239 & - & - & - & - & - & - & - \tabularnewline
92 & 2727 & - & - & - & - & - & - & - \tabularnewline
93 & 4303 & - & - & - & - & - & - & - \tabularnewline
94 & 5160 & - & - & - & - & - & - & - \tabularnewline
95 & 4103 & - & - & - & - & - & - & - \tabularnewline
96 & 5554 & - & - & - & - & - & - & - \tabularnewline
97 & 4906 & - & - & - & - & - & - & - \tabularnewline
98 & 2677 & - & - & - & - & - & - & - \tabularnewline
99 & 1677 & - & - & - & - & - & - & - \tabularnewline
100 & 1991 & - & - & - & - & - & - & - \tabularnewline
101 & 993 & 1043.5532 & 896.68 & 1223.3003 & 0.2907 & 0 & 0.5111 & 0 \tabularnewline
102 & 1800 & 1466.013 & 1239.5491 & 1749.3459 & 0.0104 & 0.9995 & 0.4725 & 1e-04 \tabularnewline
103 & 2012 & 1970.2857 & 1640.8169 & 2391.1975 & 0.423 & 0.7861 & 0.1054 & 0.4616 \tabularnewline
104 & 2880 & 2835.0208 & 2285.1136 & 3570.1332 & 0.4523 & 0.9859 & 0.6133 & 0.9878 \tabularnewline
105 & 4705 & 4268.0063 & 3347.4788 & 5546.6476 & 0.2515 & 0.9833 & 0.4786 & 0.9998 \tabularnewline
106 & 5107 & 4986.905 & 3867.7122 & 6566.3436 & 0.4408 & 0.6368 & 0.415 & 0.9999 \tabularnewline
107 & 4482 & 4521.2247 & 3525.4096 & 5915.9146 & 0.478 & 0.2052 & 0.7216 & 0.9998 \tabularnewline
108 & 5966 & 5369.5803 & 4134.0122 & 7131.5304 & 0.2535 & 0.8383 & 0.4187 & 0.9999 \tabularnewline
109 & 4858 & 4911.0212 & 3806.1704 & 6471.781 & 0.4735 & 0.0926 & 0.5025 & 0.9999 \tabularnewline
110 & 3036 & 2775.5656 & 2235.8643 & 3497.6329 & 0.2398 & 0 & 0.6055 & 0.9834 \tabularnewline
111 & 1844 & 1725.2465 & 1429.1566 & 2106.2958 & 0.2707 & 0 & 0.598 & 0.0858 \tabularnewline
112 & 2196 & 1980.7381 & 1628.155 & 2439.3785 & 0.1788 & 0.7205 & 0.4825 & 0.4825 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=318868&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[100])[/C][/ROW]
[ROW][C]88[/C][C]2824[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]1041[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]1476[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]2239[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]2727[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]4303[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]5160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]4103[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]5554[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]4906[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]2677[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]1677[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]1991[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]993[/C][C]1043.5532[/C][C]896.68[/C][C]1223.3003[/C][C]0.2907[/C][C]0[/C][C]0.5111[/C][C]0[/C][/ROW]
[ROW][C]102[/C][C]1800[/C][C]1466.013[/C][C]1239.5491[/C][C]1749.3459[/C][C]0.0104[/C][C]0.9995[/C][C]0.4725[/C][C]1e-04[/C][/ROW]
[ROW][C]103[/C][C]2012[/C][C]1970.2857[/C][C]1640.8169[/C][C]2391.1975[/C][C]0.423[/C][C]0.7861[/C][C]0.1054[/C][C]0.4616[/C][/ROW]
[ROW][C]104[/C][C]2880[/C][C]2835.0208[/C][C]2285.1136[/C][C]3570.1332[/C][C]0.4523[/C][C]0.9859[/C][C]0.6133[/C][C]0.9878[/C][/ROW]
[ROW][C]105[/C][C]4705[/C][C]4268.0063[/C][C]3347.4788[/C][C]5546.6476[/C][C]0.2515[/C][C]0.9833[/C][C]0.4786[/C][C]0.9998[/C][/ROW]
[ROW][C]106[/C][C]5107[/C][C]4986.905[/C][C]3867.7122[/C][C]6566.3436[/C][C]0.4408[/C][C]0.6368[/C][C]0.415[/C][C]0.9999[/C][/ROW]
[ROW][C]107[/C][C]4482[/C][C]4521.2247[/C][C]3525.4096[/C][C]5915.9146[/C][C]0.478[/C][C]0.2052[/C][C]0.7216[/C][C]0.9998[/C][/ROW]
[ROW][C]108[/C][C]5966[/C][C]5369.5803[/C][C]4134.0122[/C][C]7131.5304[/C][C]0.2535[/C][C]0.8383[/C][C]0.4187[/C][C]0.9999[/C][/ROW]
[ROW][C]109[/C][C]4858[/C][C]4911.0212[/C][C]3806.1704[/C][C]6471.781[/C][C]0.4735[/C][C]0.0926[/C][C]0.5025[/C][C]0.9999[/C][/ROW]
[ROW][C]110[/C][C]3036[/C][C]2775.5656[/C][C]2235.8643[/C][C]3497.6329[/C][C]0.2398[/C][C]0[/C][C]0.6055[/C][C]0.9834[/C][/ROW]
[ROW][C]111[/C][C]1844[/C][C]1725.2465[/C][C]1429.1566[/C][C]2106.2958[/C][C]0.2707[/C][C]0[/C][C]0.598[/C][C]0.0858[/C][/ROW]
[ROW][C]112[/C][C]2196[/C][C]1980.7381[/C][C]1628.155[/C][C]2439.3785[/C][C]0.1788[/C][C]0.7205[/C][C]0.4825[/C][C]0.4825[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=318868&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=318868&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[100])
882824-------
891041-------
901476-------
912239-------
922727-------
934303-------
945160-------
954103-------
965554-------
974906-------
982677-------
991677-------
1001991-------
1019931043.5532896.681223.30030.290700.51110
10218001466.0131239.54911749.34590.01040.99950.47251e-04
10320121970.28571640.81692391.19750.4230.78610.10540.4616
10428802835.02082285.11363570.13320.45230.98590.61330.9878
10547054268.00633347.47885546.64760.25150.98330.47860.9998
10651074986.9053867.71226566.34360.44080.63680.4150.9999
10744824521.22473525.40965915.91460.4780.20520.72160.9998
10859665369.58034134.01227131.53040.25350.83830.41870.9999
10948584911.02123806.17046471.7810.47350.09260.50250.9999
11030362775.56562235.86433497.63290.239800.60550.9834
11118441725.24651429.15662106.29580.270700.5980.0858
11221961980.73811628.1552439.37850.17880.72050.48250.4825







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1010.0879-0.05090.05090.04962555.629400-0.0520.052
1020.09860.18550.11820.1271111547.345357051.4873238.85450.34340.1977
1030.1090.02070.08570.09171740.083238614.3526196.50540.04290.1461
1040.13230.01560.06820.07272023.126129466.546171.65820.04630.1211
1050.15290.09290.07310.0777190963.526461765.9421248.52750.44940.1868
1060.16160.02350.06490.068714422.819253875.4216232.11080.12350.1762
1070.1574-0.00880.05690.06011538.577546398.7296215.4036-0.04030.1568
1080.16740.10.06220.0657355716.430285063.4421291.65640.61330.2139
1090.1621-0.01090.05650.05972811.248475924.3095275.5437-0.05450.1962
1100.13270.08580.05950.062667826.067975114.4854274.07020.26780.2033
1110.11270.06440.05990.06314102.400769567.9322263.75730.12210.196
1120.11810.0980.06310.066346337.691867632.0788260.06170.22140.1981

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
101 & 0.0879 & -0.0509 & 0.0509 & 0.0496 & 2555.6294 & 0 & 0 & -0.052 & 0.052 \tabularnewline
102 & 0.0986 & 0.1855 & 0.1182 & 0.1271 & 111547.3453 & 57051.4873 & 238.8545 & 0.3434 & 0.1977 \tabularnewline
103 & 0.109 & 0.0207 & 0.0857 & 0.0917 & 1740.0832 & 38614.3526 & 196.5054 & 0.0429 & 0.1461 \tabularnewline
104 & 0.1323 & 0.0156 & 0.0682 & 0.0727 & 2023.1261 & 29466.546 & 171.6582 & 0.0463 & 0.1211 \tabularnewline
105 & 0.1529 & 0.0929 & 0.0731 & 0.0777 & 190963.5264 & 61765.9421 & 248.5275 & 0.4494 & 0.1868 \tabularnewline
106 & 0.1616 & 0.0235 & 0.0649 & 0.0687 & 14422.8192 & 53875.4216 & 232.1108 & 0.1235 & 0.1762 \tabularnewline
107 & 0.1574 & -0.0088 & 0.0569 & 0.0601 & 1538.5775 & 46398.7296 & 215.4036 & -0.0403 & 0.1568 \tabularnewline
108 & 0.1674 & 0.1 & 0.0622 & 0.0657 & 355716.4302 & 85063.4421 & 291.6564 & 0.6133 & 0.2139 \tabularnewline
109 & 0.1621 & -0.0109 & 0.0565 & 0.0597 & 2811.2484 & 75924.3095 & 275.5437 & -0.0545 & 0.1962 \tabularnewline
110 & 0.1327 & 0.0858 & 0.0595 & 0.0626 & 67826.0679 & 75114.4854 & 274.0702 & 0.2678 & 0.2033 \tabularnewline
111 & 0.1127 & 0.0644 & 0.0599 & 0.063 & 14102.4007 & 69567.9322 & 263.7573 & 0.1221 & 0.196 \tabularnewline
112 & 0.1181 & 0.098 & 0.0631 & 0.0663 & 46337.6918 & 67632.0788 & 260.0617 & 0.2214 & 0.1981 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=318868&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]101[/C][C]0.0879[/C][C]-0.0509[/C][C]0.0509[/C][C]0.0496[/C][C]2555.6294[/C][C]0[/C][C]0[/C][C]-0.052[/C][C]0.052[/C][/ROW]
[ROW][C]102[/C][C]0.0986[/C][C]0.1855[/C][C]0.1182[/C][C]0.1271[/C][C]111547.3453[/C][C]57051.4873[/C][C]238.8545[/C][C]0.3434[/C][C]0.1977[/C][/ROW]
[ROW][C]103[/C][C]0.109[/C][C]0.0207[/C][C]0.0857[/C][C]0.0917[/C][C]1740.0832[/C][C]38614.3526[/C][C]196.5054[/C][C]0.0429[/C][C]0.1461[/C][/ROW]
[ROW][C]104[/C][C]0.1323[/C][C]0.0156[/C][C]0.0682[/C][C]0.0727[/C][C]2023.1261[/C][C]29466.546[/C][C]171.6582[/C][C]0.0463[/C][C]0.1211[/C][/ROW]
[ROW][C]105[/C][C]0.1529[/C][C]0.0929[/C][C]0.0731[/C][C]0.0777[/C][C]190963.5264[/C][C]61765.9421[/C][C]248.5275[/C][C]0.4494[/C][C]0.1868[/C][/ROW]
[ROW][C]106[/C][C]0.1616[/C][C]0.0235[/C][C]0.0649[/C][C]0.0687[/C][C]14422.8192[/C][C]53875.4216[/C][C]232.1108[/C][C]0.1235[/C][C]0.1762[/C][/ROW]
[ROW][C]107[/C][C]0.1574[/C][C]-0.0088[/C][C]0.0569[/C][C]0.0601[/C][C]1538.5775[/C][C]46398.7296[/C][C]215.4036[/C][C]-0.0403[/C][C]0.1568[/C][/ROW]
[ROW][C]108[/C][C]0.1674[/C][C]0.1[/C][C]0.0622[/C][C]0.0657[/C][C]355716.4302[/C][C]85063.4421[/C][C]291.6564[/C][C]0.6133[/C][C]0.2139[/C][/ROW]
[ROW][C]109[/C][C]0.1621[/C][C]-0.0109[/C][C]0.0565[/C][C]0.0597[/C][C]2811.2484[/C][C]75924.3095[/C][C]275.5437[/C][C]-0.0545[/C][C]0.1962[/C][/ROW]
[ROW][C]110[/C][C]0.1327[/C][C]0.0858[/C][C]0.0595[/C][C]0.0626[/C][C]67826.0679[/C][C]75114.4854[/C][C]274.0702[/C][C]0.2678[/C][C]0.2033[/C][/ROW]
[ROW][C]111[/C][C]0.1127[/C][C]0.0644[/C][C]0.0599[/C][C]0.063[/C][C]14102.4007[/C][C]69567.9322[/C][C]263.7573[/C][C]0.1221[/C][C]0.196[/C][/ROW]
[ROW][C]112[/C][C]0.1181[/C][C]0.098[/C][C]0.0631[/C][C]0.0663[/C][C]46337.6918[/C][C]67632.0788[/C][C]260.0617[/C][C]0.2214[/C][C]0.1981[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=318868&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=318868&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
1010.0879-0.05090.05090.04962555.629400-0.0520.052
1020.09860.18550.11820.1271111547.345357051.4873238.85450.34340.1977
1030.1090.02070.08570.09171740.083238614.3526196.50540.04290.1461
1040.13230.01560.06820.07272023.126129466.546171.65820.04630.1211
1050.15290.09290.07310.0777190963.526461765.9421248.52750.44940.1868
1060.16160.02350.06490.068714422.819253875.4216232.11080.12350.1762
1070.1574-0.00880.05690.06011538.577546398.7296215.4036-0.04030.1568
1080.16740.10.06220.0657355716.430285063.4421291.65640.61330.2139
1090.1621-0.01090.05650.05972811.248475924.3095275.5437-0.05450.1962
1100.13270.08580.05950.062667826.067975114.4854274.07020.26780.2033
1110.11270.06440.05990.06314102.400769567.9322263.75730.12210.196
1120.11810.0980.06310.066346337.691867632.0788260.06170.22140.1981



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