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, 17 Dec 2014 14:03:06 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2014/Dec/17/t1418825053bz2q2vxcwvp11in.htm/, Retrieved Thu, 16 May 2024 21:19:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=270287, Retrieved Thu, 16 May 2024 21:19:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact60
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Exponential Smoothing] [ES] [2014-12-17 12:09:36] [40df8d8b5657a9599acc6ccced535535]
- RMP     [ARIMA Forecasting] [ARIMA] [2014-12-17 14:03:06] [eeaae55b7499419163eef5a1870a44a7] [Current]
Feedback Forum

Post a new message
Dataseries X:
12.9
12.2
12.8
7.4
6.7
12.6
14.8
13.3
11.1
8.2
11.4
6.4
10.6
12
6.3
11.3
11.9
9.3
9.6
10
6.4
13.8
10.8
13.8
11.7
10.9
16.1
13.4
9.9
11.5
8.3
11.7
9
9.7
10.8
10.3
10.4
12.7
9.3
11.8
5.9
11.4
13
10.8
12.3
11.3
11.8
7.9
12.7
12.3
11.6
6.7
10.9
12.1
13.3
10.1
5.7
14.3
8
13.3
9.3
12.5
7.6
15.9
9.2
9.1
11.1
13
14.5
12.2
12.3
11.4
8.8
14.6
12.6
13
12.6
13.2
9.9
7.7
10.5
13.4
10.9
4.3
10.3
11.8
11.2
11.4
8.6
13.2
12.6
5.6
9.9
8.8
7.7
9
7.3
11.4
13.6
7.9
10.7
10.3
8.3
9.6
14.2
8.5
13.5
4.9
6.4
9.6
11.6
11.1




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270287&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]1 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=270287&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270287&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 time1 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[100])
8811.4-------
898.6-------
9013.2-------
9112.6-------
925.6-------
939.9-------
948.8-------
957.7-------
969-------
977.3-------
9811.4-------
9913.6-------
1007.9-------
10110.710.896.080215.69970.46910.88850.82460.8885
10210.310.75175.939315.5640.4270.50840.15930.8773
1038.310.7585.945415.57070.15840.5740.22660.8778
1049.610.75775.944915.57050.31860.84160.98220.8777
10514.210.75775.944815.57060.08050.68130.63660.8777
1068.510.75775.944615.57080.17890.08050.78730.8777
10713.510.75775.944415.57090.13210.8210.89350.8777
1084.910.75775.944315.5710.00850.13210.76290.8777
1096.410.75765.944115.57120.0380.99150.92040.8777
1109.610.75765.943915.57130.31870.9620.39680.8777
11111.610.75765.943715.57150.36580.68130.12360.8777
11211.110.75765.943615.57160.44460.36580.87770.8777

\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 & 11.4 & - & - & - & - & - & - & - \tabularnewline
89 & 8.6 & - & - & - & - & - & - & - \tabularnewline
90 & 13.2 & - & - & - & - & - & - & - \tabularnewline
91 & 12.6 & - & - & - & - & - & - & - \tabularnewline
92 & 5.6 & - & - & - & - & - & - & - \tabularnewline
93 & 9.9 & - & - & - & - & - & - & - \tabularnewline
94 & 8.8 & - & - & - & - & - & - & - \tabularnewline
95 & 7.7 & - & - & - & - & - & - & - \tabularnewline
96 & 9 & - & - & - & - & - & - & - \tabularnewline
97 & 7.3 & - & - & - & - & - & - & - \tabularnewline
98 & 11.4 & - & - & - & - & - & - & - \tabularnewline
99 & 13.6 & - & - & - & - & - & - & - \tabularnewline
100 & 7.9 & - & - & - & - & - & - & - \tabularnewline
101 & 10.7 & 10.89 & 6.0802 & 15.6997 & 0.4691 & 0.8885 & 0.8246 & 0.8885 \tabularnewline
102 & 10.3 & 10.7517 & 5.9393 & 15.564 & 0.427 & 0.5084 & 0.1593 & 0.8773 \tabularnewline
103 & 8.3 & 10.758 & 5.9454 & 15.5707 & 0.1584 & 0.574 & 0.2266 & 0.8778 \tabularnewline
104 & 9.6 & 10.7577 & 5.9449 & 15.5705 & 0.3186 & 0.8416 & 0.9822 & 0.8777 \tabularnewline
105 & 14.2 & 10.7577 & 5.9448 & 15.5706 & 0.0805 & 0.6813 & 0.6366 & 0.8777 \tabularnewline
106 & 8.5 & 10.7577 & 5.9446 & 15.5708 & 0.1789 & 0.0805 & 0.7873 & 0.8777 \tabularnewline
107 & 13.5 & 10.7577 & 5.9444 & 15.5709 & 0.1321 & 0.821 & 0.8935 & 0.8777 \tabularnewline
108 & 4.9 & 10.7577 & 5.9443 & 15.571 & 0.0085 & 0.1321 & 0.7629 & 0.8777 \tabularnewline
109 & 6.4 & 10.7576 & 5.9441 & 15.5712 & 0.038 & 0.9915 & 0.9204 & 0.8777 \tabularnewline
110 & 9.6 & 10.7576 & 5.9439 & 15.5713 & 0.3187 & 0.962 & 0.3968 & 0.8777 \tabularnewline
111 & 11.6 & 10.7576 & 5.9437 & 15.5715 & 0.3658 & 0.6813 & 0.1236 & 0.8777 \tabularnewline
112 & 11.1 & 10.7576 & 5.9436 & 15.5716 & 0.4446 & 0.3658 & 0.8777 & 0.8777 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270287&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]11.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]8.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]13.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]12.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]5.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]9.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]8.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]7.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]7.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]11.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]13.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]10.7[/C][C]10.89[/C][C]6.0802[/C][C]15.6997[/C][C]0.4691[/C][C]0.8885[/C][C]0.8246[/C][C]0.8885[/C][/ROW]
[ROW][C]102[/C][C]10.3[/C][C]10.7517[/C][C]5.9393[/C][C]15.564[/C][C]0.427[/C][C]0.5084[/C][C]0.1593[/C][C]0.8773[/C][/ROW]
[ROW][C]103[/C][C]8.3[/C][C]10.758[/C][C]5.9454[/C][C]15.5707[/C][C]0.1584[/C][C]0.574[/C][C]0.2266[/C][C]0.8778[/C][/ROW]
[ROW][C]104[/C][C]9.6[/C][C]10.7577[/C][C]5.9449[/C][C]15.5705[/C][C]0.3186[/C][C]0.8416[/C][C]0.9822[/C][C]0.8777[/C][/ROW]
[ROW][C]105[/C][C]14.2[/C][C]10.7577[/C][C]5.9448[/C][C]15.5706[/C][C]0.0805[/C][C]0.6813[/C][C]0.6366[/C][C]0.8777[/C][/ROW]
[ROW][C]106[/C][C]8.5[/C][C]10.7577[/C][C]5.9446[/C][C]15.5708[/C][C]0.1789[/C][C]0.0805[/C][C]0.7873[/C][C]0.8777[/C][/ROW]
[ROW][C]107[/C][C]13.5[/C][C]10.7577[/C][C]5.9444[/C][C]15.5709[/C][C]0.1321[/C][C]0.821[/C][C]0.8935[/C][C]0.8777[/C][/ROW]
[ROW][C]108[/C][C]4.9[/C][C]10.7577[/C][C]5.9443[/C][C]15.571[/C][C]0.0085[/C][C]0.1321[/C][C]0.7629[/C][C]0.8777[/C][/ROW]
[ROW][C]109[/C][C]6.4[/C][C]10.7576[/C][C]5.9441[/C][C]15.5712[/C][C]0.038[/C][C]0.9915[/C][C]0.9204[/C][C]0.8777[/C][/ROW]
[ROW][C]110[/C][C]9.6[/C][C]10.7576[/C][C]5.9439[/C][C]15.5713[/C][C]0.3187[/C][C]0.962[/C][C]0.3968[/C][C]0.8777[/C][/ROW]
[ROW][C]111[/C][C]11.6[/C][C]10.7576[/C][C]5.9437[/C][C]15.5715[/C][C]0.3658[/C][C]0.6813[/C][C]0.1236[/C][C]0.8777[/C][/ROW]
[ROW][C]112[/C][C]11.1[/C][C]10.7576[/C][C]5.9436[/C][C]15.5716[/C][C]0.4446[/C][C]0.3658[/C][C]0.8777[/C][C]0.8777[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=270287&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270287&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])
8811.4-------
898.6-------
9013.2-------
9112.6-------
925.6-------
939.9-------
948.8-------
957.7-------
969-------
977.3-------
9811.4-------
9913.6-------
1007.9-------
10110.710.896.080215.69970.46910.88850.82460.8885
10210.310.75175.939315.5640.4270.50840.15930.8773
1038.310.7585.945415.57070.15840.5740.22660.8778
1049.610.75775.944915.57050.31860.84160.98220.8777
10514.210.75775.944815.57060.08050.68130.63660.8777
1068.510.75775.944615.57080.17890.08050.78730.8777
10713.510.75775.944415.57090.13210.8210.89350.8777
1084.910.75775.944315.5710.00850.13210.76290.8777
1096.410.75765.944115.57120.0380.99150.92040.8777
1109.610.75765.943915.57130.31870.9620.39680.8777
11111.610.75765.943715.57150.36580.68130.12360.8777
11211.110.75765.943615.57160.44460.36580.87770.8777







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1010.2253-0.01780.01780.01760.036100-0.060.06
1020.2284-0.04380.03080.03030.2040.120.3465-0.14280.1014
1030.2282-0.29610.11930.10626.04192.0941.4471-0.7770.3266
1040.2283-0.12060.11960.1081.34031.90561.3804-0.36590.3364
1050.22830.24240.14420.141611.84943.89431.97341.08810.4868
1060.2283-0.26560.16440.15715.09724.09482.0236-0.71360.5246
1070.22830.20310.16990.16697.52044.58422.14110.86680.5735
1080.2283-1.19540.29810.239634.31218.30022.881-1.85160.7332
1090.2283-0.68090.34060.269418.9899.48783.0802-1.37740.8048
1100.2283-0.12060.31860.25391.34018.6732.945-0.36590.7609
1110.22830.07260.29630.23760.70967.94912.81940.26630.7159
1120.22830.03080.27420.22040.11737.29642.70120.10820.6653

\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.2253 & -0.0178 & 0.0178 & 0.0176 & 0.0361 & 0 & 0 & -0.06 & 0.06 \tabularnewline
102 & 0.2284 & -0.0438 & 0.0308 & 0.0303 & 0.204 & 0.12 & 0.3465 & -0.1428 & 0.1014 \tabularnewline
103 & 0.2282 & -0.2961 & 0.1193 & 0.1062 & 6.0419 & 2.094 & 1.4471 & -0.777 & 0.3266 \tabularnewline
104 & 0.2283 & -0.1206 & 0.1196 & 0.108 & 1.3403 & 1.9056 & 1.3804 & -0.3659 & 0.3364 \tabularnewline
105 & 0.2283 & 0.2424 & 0.1442 & 0.1416 & 11.8494 & 3.8943 & 1.9734 & 1.0881 & 0.4868 \tabularnewline
106 & 0.2283 & -0.2656 & 0.1644 & 0.1571 & 5.0972 & 4.0948 & 2.0236 & -0.7136 & 0.5246 \tabularnewline
107 & 0.2283 & 0.2031 & 0.1699 & 0.1669 & 7.5204 & 4.5842 & 2.1411 & 0.8668 & 0.5735 \tabularnewline
108 & 0.2283 & -1.1954 & 0.2981 & 0.2396 & 34.3121 & 8.3002 & 2.881 & -1.8516 & 0.7332 \tabularnewline
109 & 0.2283 & -0.6809 & 0.3406 & 0.2694 & 18.989 & 9.4878 & 3.0802 & -1.3774 & 0.8048 \tabularnewline
110 & 0.2283 & -0.1206 & 0.3186 & 0.2539 & 1.3401 & 8.673 & 2.945 & -0.3659 & 0.7609 \tabularnewline
111 & 0.2283 & 0.0726 & 0.2963 & 0.2376 & 0.7096 & 7.9491 & 2.8194 & 0.2663 & 0.7159 \tabularnewline
112 & 0.2283 & 0.0308 & 0.2742 & 0.2204 & 0.1173 & 7.2964 & 2.7012 & 0.1082 & 0.6653 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270287&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.2253[/C][C]-0.0178[/C][C]0.0178[/C][C]0.0176[/C][C]0.0361[/C][C]0[/C][C]0[/C][C]-0.06[/C][C]0.06[/C][/ROW]
[ROW][C]102[/C][C]0.2284[/C][C]-0.0438[/C][C]0.0308[/C][C]0.0303[/C][C]0.204[/C][C]0.12[/C][C]0.3465[/C][C]-0.1428[/C][C]0.1014[/C][/ROW]
[ROW][C]103[/C][C]0.2282[/C][C]-0.2961[/C][C]0.1193[/C][C]0.1062[/C][C]6.0419[/C][C]2.094[/C][C]1.4471[/C][C]-0.777[/C][C]0.3266[/C][/ROW]
[ROW][C]104[/C][C]0.2283[/C][C]-0.1206[/C][C]0.1196[/C][C]0.108[/C][C]1.3403[/C][C]1.9056[/C][C]1.3804[/C][C]-0.3659[/C][C]0.3364[/C][/ROW]
[ROW][C]105[/C][C]0.2283[/C][C]0.2424[/C][C]0.1442[/C][C]0.1416[/C][C]11.8494[/C][C]3.8943[/C][C]1.9734[/C][C]1.0881[/C][C]0.4868[/C][/ROW]
[ROW][C]106[/C][C]0.2283[/C][C]-0.2656[/C][C]0.1644[/C][C]0.1571[/C][C]5.0972[/C][C]4.0948[/C][C]2.0236[/C][C]-0.7136[/C][C]0.5246[/C][/ROW]
[ROW][C]107[/C][C]0.2283[/C][C]0.2031[/C][C]0.1699[/C][C]0.1669[/C][C]7.5204[/C][C]4.5842[/C][C]2.1411[/C][C]0.8668[/C][C]0.5735[/C][/ROW]
[ROW][C]108[/C][C]0.2283[/C][C]-1.1954[/C][C]0.2981[/C][C]0.2396[/C][C]34.3121[/C][C]8.3002[/C][C]2.881[/C][C]-1.8516[/C][C]0.7332[/C][/ROW]
[ROW][C]109[/C][C]0.2283[/C][C]-0.6809[/C][C]0.3406[/C][C]0.2694[/C][C]18.989[/C][C]9.4878[/C][C]3.0802[/C][C]-1.3774[/C][C]0.8048[/C][/ROW]
[ROW][C]110[/C][C]0.2283[/C][C]-0.1206[/C][C]0.3186[/C][C]0.2539[/C][C]1.3401[/C][C]8.673[/C][C]2.945[/C][C]-0.3659[/C][C]0.7609[/C][/ROW]
[ROW][C]111[/C][C]0.2283[/C][C]0.0726[/C][C]0.2963[/C][C]0.2376[/C][C]0.7096[/C][C]7.9491[/C][C]2.8194[/C][C]0.2663[/C][C]0.7159[/C][/ROW]
[ROW][C]112[/C][C]0.2283[/C][C]0.0308[/C][C]0.2742[/C][C]0.2204[/C][C]0.1173[/C][C]7.2964[/C][C]2.7012[/C][C]0.1082[/C][C]0.6653[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=270287&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270287&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.2253-0.01780.01780.01760.036100-0.060.06
1020.2284-0.04380.03080.03030.2040.120.3465-0.14280.1014
1030.2282-0.29610.11930.10626.04192.0941.4471-0.7770.3266
1040.2283-0.12060.11960.1081.34031.90561.3804-0.36590.3364
1050.22830.24240.14420.141611.84943.89431.97341.08810.4868
1060.2283-0.26560.16440.15715.09724.09482.0236-0.71360.5246
1070.22830.20310.16990.16697.52044.58422.14110.86680.5735
1080.2283-1.19540.29810.239634.31218.30022.881-1.85160.7332
1090.2283-0.68090.34060.269418.9899.48783.0802-1.37740.8048
1100.2283-0.12060.31860.25391.34018.6732.945-0.36590.7609
1110.22830.07260.29630.23760.70967.94912.81940.26630.7159
1120.22830.03080.27420.22040.11737.29642.70120.10820.6653



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