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 computationTue, 03 Dec 2013 08:51:23 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2013/Dec/03/t138607872129xbicwnlsx544g.htm/, Retrieved Fri, 19 Apr 2024 21:43:36 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=230311, Retrieved Fri, 19 Apr 2024 21:43:36 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact74
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2013-12-03 13:51:23] [21b6d85133fee8c48741278b4a5999d8] [Current]
Feedback Forum

Post a new message
Dataseries X:
9700
9081
9084
9743
8587
9731
9563
9998
9437
10038
9918
9252
9737
9035
9133
9487
8700
9627
8947
9283
8829
9947
9628
9318
9605
8640
9214
9567
8547
9185
9470
9123
9278
10170
9434
9655
9429
8739
9552
9687
9019
9672
9206
9069
9788
10312
10105
9863
9656
9295
9946
9701
9049
10190
9706
9765
9893
9994
10433
10073
10112
9266
9820
10097
9115
10411
9678
10408
10153
10368
10581
10597
10680
9738
9556




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 4 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230311&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230311&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230311&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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net







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[63])
519946.00000000001-------
529701.00000000001-------
539049-------
5410190-------
559706-------
569765.00000000001-------
579893-------
589994-------
5910433-------
6010073-------
6110112-------
629266.00000000001-------
639820.00000000001-------
64100979921.28449373.218910504.80710.27750.63310.77030.6331
6591159110.58898603.40169650.860.49362e-040.58840.005
661041110156.67699576.853210775.35020.21020.99950.4580.8569
6796789764.25589201.471210365.13580.38920.01740.57540.4279
68104089845.71899270.76910460.13510.03640.70370.60160.5327
69101539861.60119279.114510484.5620.17960.04280.46070.5521
701036810260.55939645.867610918.61510.37450.62570.78640.9053
711058110358.98089731.914111030.77920.25860.48950.41450.9421
721059710007.89359398.836410660.64680.03850.04260.42250.7137
731068010083.40249468.105410742.97030.03810.06350.46610.7831
7497389301.68588734.11399910.09280.079900.54580.0475
7595569775.89019172.183610423.59380.25290.54560.44690.4469

\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[63]) \tabularnewline
51 & 9946.00000000001 & - & - & - & - & - & - & - \tabularnewline
52 & 9701.00000000001 & - & - & - & - & - & - & - \tabularnewline
53 & 9049 & - & - & - & - & - & - & - \tabularnewline
54 & 10190 & - & - & - & - & - & - & - \tabularnewline
55 & 9706 & - & - & - & - & - & - & - \tabularnewline
56 & 9765.00000000001 & - & - & - & - & - & - & - \tabularnewline
57 & 9893 & - & - & - & - & - & - & - \tabularnewline
58 & 9994 & - & - & - & - & - & - & - \tabularnewline
59 & 10433 & - & - & - & - & - & - & - \tabularnewline
60 & 10073 & - & - & - & - & - & - & - \tabularnewline
61 & 10112 & - & - & - & - & - & - & - \tabularnewline
62 & 9266.00000000001 & - & - & - & - & - & - & - \tabularnewline
63 & 9820.00000000001 & - & - & - & - & - & - & - \tabularnewline
64 & 10097 & 9921.2844 & 9373.2189 & 10504.8071 & 0.2775 & 0.6331 & 0.7703 & 0.6331 \tabularnewline
65 & 9115 & 9110.5889 & 8603.4016 & 9650.86 & 0.4936 & 2e-04 & 0.5884 & 0.005 \tabularnewline
66 & 10411 & 10156.6769 & 9576.8532 & 10775.3502 & 0.2102 & 0.9995 & 0.458 & 0.8569 \tabularnewline
67 & 9678 & 9764.2558 & 9201.4712 & 10365.1358 & 0.3892 & 0.0174 & 0.5754 & 0.4279 \tabularnewline
68 & 10408 & 9845.7189 & 9270.769 & 10460.1351 & 0.0364 & 0.7037 & 0.6016 & 0.5327 \tabularnewline
69 & 10153 & 9861.6011 & 9279.1145 & 10484.562 & 0.1796 & 0.0428 & 0.4607 & 0.5521 \tabularnewline
70 & 10368 & 10260.5593 & 9645.8676 & 10918.6151 & 0.3745 & 0.6257 & 0.7864 & 0.9053 \tabularnewline
71 & 10581 & 10358.9808 & 9731.9141 & 11030.7792 & 0.2586 & 0.4895 & 0.4145 & 0.9421 \tabularnewline
72 & 10597 & 10007.8935 & 9398.8364 & 10660.6468 & 0.0385 & 0.0426 & 0.4225 & 0.7137 \tabularnewline
73 & 10680 & 10083.4024 & 9468.1054 & 10742.9703 & 0.0381 & 0.0635 & 0.4661 & 0.7831 \tabularnewline
74 & 9738 & 9301.6858 & 8734.1139 & 9910.0928 & 0.0799 & 0 & 0.5458 & 0.0475 \tabularnewline
75 & 9556 & 9775.8901 & 9172.1836 & 10423.5938 & 0.2529 & 0.5456 & 0.4469 & 0.4469 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230311&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[63])[/C][/ROW]
[ROW][C]51[/C][C]9946.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]9701.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]9049[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]10190[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]9706[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]9765.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]9893[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]9994[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]10433[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]10073[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]10112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]9266.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]9820.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]10097[/C][C]9921.2844[/C][C]9373.2189[/C][C]10504.8071[/C][C]0.2775[/C][C]0.6331[/C][C]0.7703[/C][C]0.6331[/C][/ROW]
[ROW][C]65[/C][C]9115[/C][C]9110.5889[/C][C]8603.4016[/C][C]9650.86[/C][C]0.4936[/C][C]2e-04[/C][C]0.5884[/C][C]0.005[/C][/ROW]
[ROW][C]66[/C][C]10411[/C][C]10156.6769[/C][C]9576.8532[/C][C]10775.3502[/C][C]0.2102[/C][C]0.9995[/C][C]0.458[/C][C]0.8569[/C][/ROW]
[ROW][C]67[/C][C]9678[/C][C]9764.2558[/C][C]9201.4712[/C][C]10365.1358[/C][C]0.3892[/C][C]0.0174[/C][C]0.5754[/C][C]0.4279[/C][/ROW]
[ROW][C]68[/C][C]10408[/C][C]9845.7189[/C][C]9270.769[/C][C]10460.1351[/C][C]0.0364[/C][C]0.7037[/C][C]0.6016[/C][C]0.5327[/C][/ROW]
[ROW][C]69[/C][C]10153[/C][C]9861.6011[/C][C]9279.1145[/C][C]10484.562[/C][C]0.1796[/C][C]0.0428[/C][C]0.4607[/C][C]0.5521[/C][/ROW]
[ROW][C]70[/C][C]10368[/C][C]10260.5593[/C][C]9645.8676[/C][C]10918.6151[/C][C]0.3745[/C][C]0.6257[/C][C]0.7864[/C][C]0.9053[/C][/ROW]
[ROW][C]71[/C][C]10581[/C][C]10358.9808[/C][C]9731.9141[/C][C]11030.7792[/C][C]0.2586[/C][C]0.4895[/C][C]0.4145[/C][C]0.9421[/C][/ROW]
[ROW][C]72[/C][C]10597[/C][C]10007.8935[/C][C]9398.8364[/C][C]10660.6468[/C][C]0.0385[/C][C]0.0426[/C][C]0.4225[/C][C]0.7137[/C][/ROW]
[ROW][C]73[/C][C]10680[/C][C]10083.4024[/C][C]9468.1054[/C][C]10742.9703[/C][C]0.0381[/C][C]0.0635[/C][C]0.4661[/C][C]0.7831[/C][/ROW]
[ROW][C]74[/C][C]9738[/C][C]9301.6858[/C][C]8734.1139[/C][C]9910.0928[/C][C]0.0799[/C][C]0[/C][C]0.5458[/C][C]0.0475[/C][/ROW]
[ROW][C]75[/C][C]9556[/C][C]9775.8901[/C][C]9172.1836[/C][C]10423.5938[/C][C]0.2529[/C][C]0.5456[/C][C]0.4469[/C][C]0.4469[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230311&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230311&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[63])
519946.00000000001-------
529701.00000000001-------
539049-------
5410190-------
559706-------
569765.00000000001-------
579893-------
589994-------
5910433-------
6010073-------
6110112-------
629266.00000000001-------
639820.00000000001-------
64100979921.28449373.218910504.80710.27750.63310.77030.6331
6591159110.58898603.40169650.860.49362e-040.58840.005
661041110156.67699576.853210775.35020.21020.99950.4580.8569
6796789764.25589201.471210365.13580.38920.01740.57540.4279
68104089845.71899270.76910460.13510.03640.70370.60160.5327
69101539861.60119279.114510484.5620.17960.04280.46070.5521
701036810260.55939645.867610918.61510.37450.62570.78640.9053
711058110358.98089731.914111030.77920.25860.48950.41450.9421
721059710007.89359398.836410660.64680.03850.04260.42250.7137
731068010083.40249468.105410742.97030.03810.06350.46610.7831
7497389301.68588734.11399910.09280.079900.54580.0475
7595569775.89019172.183610423.59380.25290.54560.44690.4469







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
640.030.01740.01740.017630875.9681000.34230.3423
650.03035e-040.00890.00919.457915447.713124.28880.00860.1754
660.03110.02440.01410.014364680.25631858.5607178.48970.49540.2821
670.0314-0.00890.01280.01297440.065325753.9368160.4803-0.1680.2536
680.03180.0540.02110.0214316160.051683835.1598289.5431.09530.4219
690.03220.02870.02230.022784913.335284014.8557289.85320.56760.4462
700.03270.01040.02060.02111543.49673661.8043271.40710.20930.4124
710.03310.0210.02070.02149292.525770615.6445265.7360.43250.4149
720.03330.05560.02450.025347046.4678101330.1804318.3241.14750.4963
730.03340.05590.02770.0283355928.6372126790.0261356.07591.16210.5629
740.03340.04480.02920.0299190370.0589132570.029364.10170.84990.589
750.0338-0.0230.02870.029348351.6487125551.8307354.3329-0.42830.5756

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
64 & 0.03 & 0.0174 & 0.0174 & 0.0176 & 30875.9681 & 0 & 0 & 0.3423 & 0.3423 \tabularnewline
65 & 0.0303 & 5e-04 & 0.0089 & 0.009 & 19.4579 & 15447.713 & 124.2888 & 0.0086 & 0.1754 \tabularnewline
66 & 0.0311 & 0.0244 & 0.0141 & 0.0143 & 64680.256 & 31858.5607 & 178.4897 & 0.4954 & 0.2821 \tabularnewline
67 & 0.0314 & -0.0089 & 0.0128 & 0.0129 & 7440.0653 & 25753.9368 & 160.4803 & -0.168 & 0.2536 \tabularnewline
68 & 0.0318 & 0.054 & 0.0211 & 0.0214 & 316160.0516 & 83835.1598 & 289.543 & 1.0953 & 0.4219 \tabularnewline
69 & 0.0322 & 0.0287 & 0.0223 & 0.0227 & 84913.3352 & 84014.8557 & 289.8532 & 0.5676 & 0.4462 \tabularnewline
70 & 0.0327 & 0.0104 & 0.0206 & 0.021 & 11543.496 & 73661.8043 & 271.4071 & 0.2093 & 0.4124 \tabularnewline
71 & 0.0331 & 0.021 & 0.0207 & 0.021 & 49292.5257 & 70615.6445 & 265.736 & 0.4325 & 0.4149 \tabularnewline
72 & 0.0333 & 0.0556 & 0.0245 & 0.025 & 347046.4678 & 101330.1804 & 318.324 & 1.1475 & 0.4963 \tabularnewline
73 & 0.0334 & 0.0559 & 0.0277 & 0.0283 & 355928.6372 & 126790.0261 & 356.0759 & 1.1621 & 0.5629 \tabularnewline
74 & 0.0334 & 0.0448 & 0.0292 & 0.0299 & 190370.0589 & 132570.029 & 364.1017 & 0.8499 & 0.589 \tabularnewline
75 & 0.0338 & -0.023 & 0.0287 & 0.0293 & 48351.6487 & 125551.8307 & 354.3329 & -0.4283 & 0.5756 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230311&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]64[/C][C]0.03[/C][C]0.0174[/C][C]0.0174[/C][C]0.0176[/C][C]30875.9681[/C][C]0[/C][C]0[/C][C]0.3423[/C][C]0.3423[/C][/ROW]
[ROW][C]65[/C][C]0.0303[/C][C]5e-04[/C][C]0.0089[/C][C]0.009[/C][C]19.4579[/C][C]15447.713[/C][C]124.2888[/C][C]0.0086[/C][C]0.1754[/C][/ROW]
[ROW][C]66[/C][C]0.0311[/C][C]0.0244[/C][C]0.0141[/C][C]0.0143[/C][C]64680.256[/C][C]31858.5607[/C][C]178.4897[/C][C]0.4954[/C][C]0.2821[/C][/ROW]
[ROW][C]67[/C][C]0.0314[/C][C]-0.0089[/C][C]0.0128[/C][C]0.0129[/C][C]7440.0653[/C][C]25753.9368[/C][C]160.4803[/C][C]-0.168[/C][C]0.2536[/C][/ROW]
[ROW][C]68[/C][C]0.0318[/C][C]0.054[/C][C]0.0211[/C][C]0.0214[/C][C]316160.0516[/C][C]83835.1598[/C][C]289.543[/C][C]1.0953[/C][C]0.4219[/C][/ROW]
[ROW][C]69[/C][C]0.0322[/C][C]0.0287[/C][C]0.0223[/C][C]0.0227[/C][C]84913.3352[/C][C]84014.8557[/C][C]289.8532[/C][C]0.5676[/C][C]0.4462[/C][/ROW]
[ROW][C]70[/C][C]0.0327[/C][C]0.0104[/C][C]0.0206[/C][C]0.021[/C][C]11543.496[/C][C]73661.8043[/C][C]271.4071[/C][C]0.2093[/C][C]0.4124[/C][/ROW]
[ROW][C]71[/C][C]0.0331[/C][C]0.021[/C][C]0.0207[/C][C]0.021[/C][C]49292.5257[/C][C]70615.6445[/C][C]265.736[/C][C]0.4325[/C][C]0.4149[/C][/ROW]
[ROW][C]72[/C][C]0.0333[/C][C]0.0556[/C][C]0.0245[/C][C]0.025[/C][C]347046.4678[/C][C]101330.1804[/C][C]318.324[/C][C]1.1475[/C][C]0.4963[/C][/ROW]
[ROW][C]73[/C][C]0.0334[/C][C]0.0559[/C][C]0.0277[/C][C]0.0283[/C][C]355928.6372[/C][C]126790.0261[/C][C]356.0759[/C][C]1.1621[/C][C]0.5629[/C][/ROW]
[ROW][C]74[/C][C]0.0334[/C][C]0.0448[/C][C]0.0292[/C][C]0.0299[/C][C]190370.0589[/C][C]132570.029[/C][C]364.1017[/C][C]0.8499[/C][C]0.589[/C][/ROW]
[ROW][C]75[/C][C]0.0338[/C][C]-0.023[/C][C]0.0287[/C][C]0.0293[/C][C]48351.6487[/C][C]125551.8307[/C][C]354.3329[/C][C]-0.4283[/C][C]0.5756[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230311&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230311&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
640.030.01740.01740.017630875.9681000.34230.3423
650.03035e-040.00890.00919.457915447.713124.28880.00860.1754
660.03110.02440.01410.014364680.25631858.5607178.48970.49540.2821
670.0314-0.00890.01280.01297440.065325753.9368160.4803-0.1680.2536
680.03180.0540.02110.0214316160.051683835.1598289.5431.09530.4219
690.03220.02870.02230.022784913.335284014.8557289.85320.56760.4462
700.03270.01040.02060.02111543.49673661.8043271.40710.20930.4124
710.03310.0210.02070.02149292.525770615.6445265.7360.43250.4149
720.03330.05560.02450.025347046.4678101330.1804318.3241.14750.4963
730.03340.05590.02770.0283355928.6372126790.0261356.07591.16210.5629
740.03340.04480.02920.0299190370.0589132570.029364.10170.84990.589
750.0338-0.0230.02870.029348351.6487125551.8307354.3329-0.42830.5756



Parameters (Session):
par1 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = -0.1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '1'
par8 <- '1'
par7 <- '1'
par6 <- '1'
par5 <- '12'
par4 <- '1'
par3 <- '0'
par2 <- '-0.1'
par1 <- '1'
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
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,par1))
(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')