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 computationSun, 20 Jan 2019 16:57:05 +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/2019/Jan/20/t1547999868x27gi2qg6yx3clp.htm/, Retrieved Fri, 03 May 2024 14:38:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=316517, Retrieved Fri, 03 May 2024 14:38:08 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact33
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2019-01-20 15:57:05] [33bc36b27464b9cd562928773ee2a05e] [Current]
Feedback Forum

Post a new message
Dataseries X:
1.4
1.5
1.8
1.8
1.8
1.7
1.5
1.1
1.3
1.6
1.9
1.9
2
2.2
2.2
2
2.3
2.6
3.2
3.2
3.1
2.8
2.3
1.9
1.9
2
2
1.8
1.6
1.4
0.2
0.3
0.4
0.7
1
1.1
0.8
0.8
1
1.1
1
0.8
1.6
1.5
1.6
1.6
1.6
1.9
2
1.9
2
2.1
2.3
2.3
2.6
2.6
2.7
2.6
2.6
2.4
2.5
2.5
2.5
2.4
2.1
2.1
2.3
2.3
2.3
2.9
2.8
2.9
3
3
2.9
2.6
2.8
2.9
3.1
2.8
2.4
1.6
1.5
1.7




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316517&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[72])
602.4-------
612.5-------
622.5-------
632.5-------
642.4-------
652.1-------
662.1-------
672.3-------
682.3-------
692.3-------
702.9-------
712.8-------
722.9-------
7331.76670.19343.33990.06220.0790.18050.079
7431.81670.24343.38990.07020.07020.19730.0886
752.91.91670.34343.48990.11030.08860.23370.1103
762.61.86670.29343.43990.18050.0990.25320.099
772.81.850.27683.42320.11830.17510.37770.0954
782.91.81670.24343.38990.08860.11030.3620.0886
793.11.90.32683.47320.06750.10640.30910.1064
802.81.83330.26013.40660.11420.05730.28050.0919
812.41.90.32683.47320.26670.13110.30910.1064
821.62.03330.46013.60660.29460.32390.14010.1401
831.52.03330.46013.60660.25320.70540.16980.1401
841.72.01670.44343.58990.34660.74010.13560.1356

\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[72]) \tabularnewline
60 & 2.4 & - & - & - & - & - & - & - \tabularnewline
61 & 2.5 & - & - & - & - & - & - & - \tabularnewline
62 & 2.5 & - & - & - & - & - & - & - \tabularnewline
63 & 2.5 & - & - & - & - & - & - & - \tabularnewline
64 & 2.4 & - & - & - & - & - & - & - \tabularnewline
65 & 2.1 & - & - & - & - & - & - & - \tabularnewline
66 & 2.1 & - & - & - & - & - & - & - \tabularnewline
67 & 2.3 & - & - & - & - & - & - & - \tabularnewline
68 & 2.3 & - & - & - & - & - & - & - \tabularnewline
69 & 2.3 & - & - & - & - & - & - & - \tabularnewline
70 & 2.9 & - & - & - & - & - & - & - \tabularnewline
71 & 2.8 & - & - & - & - & - & - & - \tabularnewline
72 & 2.9 & - & - & - & - & - & - & - \tabularnewline
73 & 3 & 1.7667 & 0.1934 & 3.3399 & 0.0622 & 0.079 & 0.1805 & 0.079 \tabularnewline
74 & 3 & 1.8167 & 0.2434 & 3.3899 & 0.0702 & 0.0702 & 0.1973 & 0.0886 \tabularnewline
75 & 2.9 & 1.9167 & 0.3434 & 3.4899 & 0.1103 & 0.0886 & 0.2337 & 0.1103 \tabularnewline
76 & 2.6 & 1.8667 & 0.2934 & 3.4399 & 0.1805 & 0.099 & 0.2532 & 0.099 \tabularnewline
77 & 2.8 & 1.85 & 0.2768 & 3.4232 & 0.1183 & 0.1751 & 0.3777 & 0.0954 \tabularnewline
78 & 2.9 & 1.8167 & 0.2434 & 3.3899 & 0.0886 & 0.1103 & 0.362 & 0.0886 \tabularnewline
79 & 3.1 & 1.9 & 0.3268 & 3.4732 & 0.0675 & 0.1064 & 0.3091 & 0.1064 \tabularnewline
80 & 2.8 & 1.8333 & 0.2601 & 3.4066 & 0.1142 & 0.0573 & 0.2805 & 0.0919 \tabularnewline
81 & 2.4 & 1.9 & 0.3268 & 3.4732 & 0.2667 & 0.1311 & 0.3091 & 0.1064 \tabularnewline
82 & 1.6 & 2.0333 & 0.4601 & 3.6066 & 0.2946 & 0.3239 & 0.1401 & 0.1401 \tabularnewline
83 & 1.5 & 2.0333 & 0.4601 & 3.6066 & 0.2532 & 0.7054 & 0.1698 & 0.1401 \tabularnewline
84 & 1.7 & 2.0167 & 0.4434 & 3.5899 & 0.3466 & 0.7401 & 0.1356 & 0.1356 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316517&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[72])[/C][/ROW]
[ROW][C]60[/C][C]2.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]2.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]2.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]2.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]2.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]2.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]2.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]2.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]2.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]2.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]2.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]2.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]2.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]3[/C][C]1.7667[/C][C]0.1934[/C][C]3.3399[/C][C]0.0622[/C][C]0.079[/C][C]0.1805[/C][C]0.079[/C][/ROW]
[ROW][C]74[/C][C]3[/C][C]1.8167[/C][C]0.2434[/C][C]3.3899[/C][C]0.0702[/C][C]0.0702[/C][C]0.1973[/C][C]0.0886[/C][/ROW]
[ROW][C]75[/C][C]2.9[/C][C]1.9167[/C][C]0.3434[/C][C]3.4899[/C][C]0.1103[/C][C]0.0886[/C][C]0.2337[/C][C]0.1103[/C][/ROW]
[ROW][C]76[/C][C]2.6[/C][C]1.8667[/C][C]0.2934[/C][C]3.4399[/C][C]0.1805[/C][C]0.099[/C][C]0.2532[/C][C]0.099[/C][/ROW]
[ROW][C]77[/C][C]2.8[/C][C]1.85[/C][C]0.2768[/C][C]3.4232[/C][C]0.1183[/C][C]0.1751[/C][C]0.3777[/C][C]0.0954[/C][/ROW]
[ROW][C]78[/C][C]2.9[/C][C]1.8167[/C][C]0.2434[/C][C]3.3899[/C][C]0.0886[/C][C]0.1103[/C][C]0.362[/C][C]0.0886[/C][/ROW]
[ROW][C]79[/C][C]3.1[/C][C]1.9[/C][C]0.3268[/C][C]3.4732[/C][C]0.0675[/C][C]0.1064[/C][C]0.3091[/C][C]0.1064[/C][/ROW]
[ROW][C]80[/C][C]2.8[/C][C]1.8333[/C][C]0.2601[/C][C]3.4066[/C][C]0.1142[/C][C]0.0573[/C][C]0.2805[/C][C]0.0919[/C][/ROW]
[ROW][C]81[/C][C]2.4[/C][C]1.9[/C][C]0.3268[/C][C]3.4732[/C][C]0.2667[/C][C]0.1311[/C][C]0.3091[/C][C]0.1064[/C][/ROW]
[ROW][C]82[/C][C]1.6[/C][C]2.0333[/C][C]0.4601[/C][C]3.6066[/C][C]0.2946[/C][C]0.3239[/C][C]0.1401[/C][C]0.1401[/C][/ROW]
[ROW][C]83[/C][C]1.5[/C][C]2.0333[/C][C]0.4601[/C][C]3.6066[/C][C]0.2532[/C][C]0.7054[/C][C]0.1698[/C][C]0.1401[/C][/ROW]
[ROW][C]84[/C][C]1.7[/C][C]2.0167[/C][C]0.4434[/C][C]3.5899[/C][C]0.3466[/C][C]0.7401[/C][C]0.1356[/C][C]0.1356[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=316517&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316517&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[72])
602.4-------
612.5-------
622.5-------
632.5-------
642.4-------
652.1-------
662.1-------
672.3-------
682.3-------
692.3-------
702.9-------
712.8-------
722.9-------
7331.76670.19343.33990.06220.0790.18050.079
7431.81670.24343.38990.07020.07020.19730.0886
752.91.91670.34343.48990.11030.08860.23370.1103
762.61.86670.29343.43990.18050.0990.25320.099
772.81.850.27683.42320.11830.17510.37770.0954
782.91.81670.24343.38990.08860.11030.3620.0886
793.11.90.32683.47320.06750.10640.30910.1064
802.81.83330.26013.40660.11420.05730.28050.0919
812.41.90.32683.47320.26670.13110.30910.1064
821.62.03330.46013.60660.29460.32390.14010.1401
831.52.03330.46013.60660.25320.70540.16980.1401
841.72.01670.44343.58990.34660.74010.13560.1356







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
730.45430.41110.41110.51751.5211005.02475.0247
740.44180.39440.40280.50441.40031.46071.20864.8214.9228
750.41880.33910.38150.47240.96691.29611.13854.00624.6173
760.430.28210.35670.43640.53781.10651.05192.98774.2099
770.43390.33930.35320.43080.90251.06571.03233.87044.142
780.44180.37360.35660.43561.17361.08371.0414.41364.1872
790.42250.38710.36090.44191.441.13461.06524.88894.2875
800.43780.34520.3590.43880.93441.10961.05343.93834.2438
810.42250.20830.34220.41590.251.01411.0072.0373.9986
820.3948-0.27080.33510.39820.18780.93140.9651-1.76543.7753
830.3948-0.35560.3370.38940.28440.87260.9341-2.17283.6296
840.398-0.18630.32440.37120.10030.80830.899-1.29013.4347

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
73 & 0.4543 & 0.4111 & 0.4111 & 0.5175 & 1.5211 & 0 & 0 & 5.0247 & 5.0247 \tabularnewline
74 & 0.4418 & 0.3944 & 0.4028 & 0.5044 & 1.4003 & 1.4607 & 1.2086 & 4.821 & 4.9228 \tabularnewline
75 & 0.4188 & 0.3391 & 0.3815 & 0.4724 & 0.9669 & 1.2961 & 1.1385 & 4.0062 & 4.6173 \tabularnewline
76 & 0.43 & 0.2821 & 0.3567 & 0.4364 & 0.5378 & 1.1065 & 1.0519 & 2.9877 & 4.2099 \tabularnewline
77 & 0.4339 & 0.3393 & 0.3532 & 0.4308 & 0.9025 & 1.0657 & 1.0323 & 3.8704 & 4.142 \tabularnewline
78 & 0.4418 & 0.3736 & 0.3566 & 0.4356 & 1.1736 & 1.0837 & 1.041 & 4.4136 & 4.1872 \tabularnewline
79 & 0.4225 & 0.3871 & 0.3609 & 0.4419 & 1.44 & 1.1346 & 1.0652 & 4.8889 & 4.2875 \tabularnewline
80 & 0.4378 & 0.3452 & 0.359 & 0.4388 & 0.9344 & 1.1096 & 1.0534 & 3.9383 & 4.2438 \tabularnewline
81 & 0.4225 & 0.2083 & 0.3422 & 0.4159 & 0.25 & 1.0141 & 1.007 & 2.037 & 3.9986 \tabularnewline
82 & 0.3948 & -0.2708 & 0.3351 & 0.3982 & 0.1878 & 0.9314 & 0.9651 & -1.7654 & 3.7753 \tabularnewline
83 & 0.3948 & -0.3556 & 0.337 & 0.3894 & 0.2844 & 0.8726 & 0.9341 & -2.1728 & 3.6296 \tabularnewline
84 & 0.398 & -0.1863 & 0.3244 & 0.3712 & 0.1003 & 0.8083 & 0.899 & -1.2901 & 3.4347 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316517&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]73[/C][C]0.4543[/C][C]0.4111[/C][C]0.4111[/C][C]0.5175[/C][C]1.5211[/C][C]0[/C][C]0[/C][C]5.0247[/C][C]5.0247[/C][/ROW]
[ROW][C]74[/C][C]0.4418[/C][C]0.3944[/C][C]0.4028[/C][C]0.5044[/C][C]1.4003[/C][C]1.4607[/C][C]1.2086[/C][C]4.821[/C][C]4.9228[/C][/ROW]
[ROW][C]75[/C][C]0.4188[/C][C]0.3391[/C][C]0.3815[/C][C]0.4724[/C][C]0.9669[/C][C]1.2961[/C][C]1.1385[/C][C]4.0062[/C][C]4.6173[/C][/ROW]
[ROW][C]76[/C][C]0.43[/C][C]0.2821[/C][C]0.3567[/C][C]0.4364[/C][C]0.5378[/C][C]1.1065[/C][C]1.0519[/C][C]2.9877[/C][C]4.2099[/C][/ROW]
[ROW][C]77[/C][C]0.4339[/C][C]0.3393[/C][C]0.3532[/C][C]0.4308[/C][C]0.9025[/C][C]1.0657[/C][C]1.0323[/C][C]3.8704[/C][C]4.142[/C][/ROW]
[ROW][C]78[/C][C]0.4418[/C][C]0.3736[/C][C]0.3566[/C][C]0.4356[/C][C]1.1736[/C][C]1.0837[/C][C]1.041[/C][C]4.4136[/C][C]4.1872[/C][/ROW]
[ROW][C]79[/C][C]0.4225[/C][C]0.3871[/C][C]0.3609[/C][C]0.4419[/C][C]1.44[/C][C]1.1346[/C][C]1.0652[/C][C]4.8889[/C][C]4.2875[/C][/ROW]
[ROW][C]80[/C][C]0.4378[/C][C]0.3452[/C][C]0.359[/C][C]0.4388[/C][C]0.9344[/C][C]1.1096[/C][C]1.0534[/C][C]3.9383[/C][C]4.2438[/C][/ROW]
[ROW][C]81[/C][C]0.4225[/C][C]0.2083[/C][C]0.3422[/C][C]0.4159[/C][C]0.25[/C][C]1.0141[/C][C]1.007[/C][C]2.037[/C][C]3.9986[/C][/ROW]
[ROW][C]82[/C][C]0.3948[/C][C]-0.2708[/C][C]0.3351[/C][C]0.3982[/C][C]0.1878[/C][C]0.9314[/C][C]0.9651[/C][C]-1.7654[/C][C]3.7753[/C][/ROW]
[ROW][C]83[/C][C]0.3948[/C][C]-0.3556[/C][C]0.337[/C][C]0.3894[/C][C]0.2844[/C][C]0.8726[/C][C]0.9341[/C][C]-2.1728[/C][C]3.6296[/C][/ROW]
[ROW][C]84[/C][C]0.398[/C][C]-0.1863[/C][C]0.3244[/C][C]0.3712[/C][C]0.1003[/C][C]0.8083[/C][C]0.899[/C][C]-1.2901[/C][C]3.4347[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=316517&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316517&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
730.45430.41110.41110.51751.5211005.02475.0247
740.44180.39440.40280.50441.40031.46071.20864.8214.9228
750.41880.33910.38150.47240.96691.29611.13854.00624.6173
760.430.28210.35670.43640.53781.10651.05192.98774.2099
770.43390.33930.35320.43080.90251.06571.03233.87044.142
780.44180.37360.35660.43561.17361.08371.0414.41364.1872
790.42250.38710.36090.44191.441.13461.06524.88894.2875
800.43780.34520.3590.43880.93441.10961.05343.93834.2438
810.42250.20830.34220.41590.251.01411.0072.0373.9986
820.3948-0.27080.33510.39820.18780.93140.9651-1.76543.7753
830.3948-0.35560.3370.38940.28440.87260.9341-2.17283.6296
840.398-0.18630.32440.37120.10030.80830.899-1.29013.4347



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