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 computationThu, 03 Sep 2015 08:49:51 +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/2015/Sep/03/t1441266656m2cy2iy2qddr3va.htm/, Retrieved Thu, 16 May 2024 22:58:44 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=280561, Retrieved Thu, 16 May 2024 22:58:44 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact51
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Two-Way ANOVA] [] [2015-09-03 07:30:21] [32dcd80bca5f0a9a5e75a88e73bba40e]
- RMPD    [ARIMA Forecasting] [] [2015-09-03 07:49:51] [600a571328e0e71e2b27d9244a6c7c71] [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 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=280561&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=280561&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=280561&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[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-------
7330-3.95023.95020.06830.07510.10740.0751
7430-3.95023.95020.06830.06830.10740.0751
752.90-3.95023.95020.07510.06830.10740.0751
762.60-3.95023.95020.09850.07510.11690.0751
772.80-3.95023.95020.08240.09850.14870.0751
782.90-3.95023.95020.07510.08240.14870.0751
793.10-3.95023.95020.0620.07510.12690.0751
802.80-3.95023.95020.08240.0620.12690.0751
812.40-3.95023.95020.11690.08240.12690.0751
821.60-3.95023.95020.21360.11690.07510.0751
831.50-3.95023.95020.22840.21360.08240.0751
841.70-3.95023.95020.19950.22840.07510.0751

\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 & 0 & -3.9502 & 3.9502 & 0.0683 & 0.0751 & 0.1074 & 0.0751 \tabularnewline
74 & 3 & 0 & -3.9502 & 3.9502 & 0.0683 & 0.0683 & 0.1074 & 0.0751 \tabularnewline
75 & 2.9 & 0 & -3.9502 & 3.9502 & 0.0751 & 0.0683 & 0.1074 & 0.0751 \tabularnewline
76 & 2.6 & 0 & -3.9502 & 3.9502 & 0.0985 & 0.0751 & 0.1169 & 0.0751 \tabularnewline
77 & 2.8 & 0 & -3.9502 & 3.9502 & 0.0824 & 0.0985 & 0.1487 & 0.0751 \tabularnewline
78 & 2.9 & 0 & -3.9502 & 3.9502 & 0.0751 & 0.0824 & 0.1487 & 0.0751 \tabularnewline
79 & 3.1 & 0 & -3.9502 & 3.9502 & 0.062 & 0.0751 & 0.1269 & 0.0751 \tabularnewline
80 & 2.8 & 0 & -3.9502 & 3.9502 & 0.0824 & 0.062 & 0.1269 & 0.0751 \tabularnewline
81 & 2.4 & 0 & -3.9502 & 3.9502 & 0.1169 & 0.0824 & 0.1269 & 0.0751 \tabularnewline
82 & 1.6 & 0 & -3.9502 & 3.9502 & 0.2136 & 0.1169 & 0.0751 & 0.0751 \tabularnewline
83 & 1.5 & 0 & -3.9502 & 3.9502 & 0.2284 & 0.2136 & 0.0824 & 0.0751 \tabularnewline
84 & 1.7 & 0 & -3.9502 & 3.9502 & 0.1995 & 0.2284 & 0.0751 & 0.0751 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=280561&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]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.0683[/C][C]0.0751[/C][C]0.1074[/C][C]0.0751[/C][/ROW]
[ROW][C]74[/C][C]3[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.0683[/C][C]0.0683[/C][C]0.1074[/C][C]0.0751[/C][/ROW]
[ROW][C]75[/C][C]2.9[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.0751[/C][C]0.0683[/C][C]0.1074[/C][C]0.0751[/C][/ROW]
[ROW][C]76[/C][C]2.6[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.0985[/C][C]0.0751[/C][C]0.1169[/C][C]0.0751[/C][/ROW]
[ROW][C]77[/C][C]2.8[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.0824[/C][C]0.0985[/C][C]0.1487[/C][C]0.0751[/C][/ROW]
[ROW][C]78[/C][C]2.9[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.0751[/C][C]0.0824[/C][C]0.1487[/C][C]0.0751[/C][/ROW]
[ROW][C]79[/C][C]3.1[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.062[/C][C]0.0751[/C][C]0.1269[/C][C]0.0751[/C][/ROW]
[ROW][C]80[/C][C]2.8[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.0824[/C][C]0.062[/C][C]0.1269[/C][C]0.0751[/C][/ROW]
[ROW][C]81[/C][C]2.4[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.1169[/C][C]0.0824[/C][C]0.1269[/C][C]0.0751[/C][/ROW]
[ROW][C]82[/C][C]1.6[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.2136[/C][C]0.1169[/C][C]0.0751[/C][C]0.0751[/C][/ROW]
[ROW][C]83[/C][C]1.5[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.2284[/C][C]0.2136[/C][C]0.0824[/C][C]0.0751[/C][/ROW]
[ROW][C]84[/C][C]1.7[/C][C]0[/C][C]-3.9502[/C][C]3.9502[/C][C]0.1995[/C][C]0.2284[/C][C]0.0751[/C][C]0.0751[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=280561&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=280561&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-------
7330-3.95023.95020.06830.07510.10740.0751
7430-3.95023.95020.06830.06830.10740.0751
752.90-3.95023.95020.07510.06830.10740.0751
762.60-3.95023.95020.09850.07510.11690.0751
772.80-3.95023.95020.08240.09850.14870.0751
782.90-3.95023.95020.07510.08240.14870.0751
793.10-3.95023.95020.0620.07510.12690.0751
802.80-3.95023.95020.08240.0620.12690.0751
812.40-3.95023.95020.11690.08240.12690.0751
821.60-3.95023.95020.21360.11690.07510.0751
831.50-3.95023.95020.22840.21360.08240.0751
841.70-3.95023.95020.19950.22840.07510.0751







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
73Inf11290012.222212.2222
74Inf11299312.222212.2222
75Inf1128.418.80332.96711.814812.0864
76Inf1126.768.29252.879710.592611.713
77Inf1127.848.2022.863911.407411.6519
78Inf1128.418.23672.8711.814811.679
79Inf1129.618.43292.903912.629611.8148
80Inf1127.848.35882.891211.407411.7639
81Inf1125.768.072.84089.777811.5432
82Inf1122.567.5192.74216.518511.0407
83Inf1122.257.042.65336.111110.5926
84Inf1122.896.69422.58736.925910.287

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
73 & Inf & 1 & 1 & 2 & 9 & 0 & 0 & 12.2222 & 12.2222 \tabularnewline
74 & Inf & 1 & 1 & 2 & 9 & 9 & 3 & 12.2222 & 12.2222 \tabularnewline
75 & Inf & 1 & 1 & 2 & 8.41 & 8.8033 & 2.967 & 11.8148 & 12.0864 \tabularnewline
76 & Inf & 1 & 1 & 2 & 6.76 & 8.2925 & 2.8797 & 10.5926 & 11.713 \tabularnewline
77 & Inf & 1 & 1 & 2 & 7.84 & 8.202 & 2.8639 & 11.4074 & 11.6519 \tabularnewline
78 & Inf & 1 & 1 & 2 & 8.41 & 8.2367 & 2.87 & 11.8148 & 11.679 \tabularnewline
79 & Inf & 1 & 1 & 2 & 9.61 & 8.4329 & 2.9039 & 12.6296 & 11.8148 \tabularnewline
80 & Inf & 1 & 1 & 2 & 7.84 & 8.3588 & 2.8912 & 11.4074 & 11.7639 \tabularnewline
81 & Inf & 1 & 1 & 2 & 5.76 & 8.07 & 2.8408 & 9.7778 & 11.5432 \tabularnewline
82 & Inf & 1 & 1 & 2 & 2.56 & 7.519 & 2.7421 & 6.5185 & 11.0407 \tabularnewline
83 & Inf & 1 & 1 & 2 & 2.25 & 7.04 & 2.6533 & 6.1111 & 10.5926 \tabularnewline
84 & Inf & 1 & 1 & 2 & 2.89 & 6.6942 & 2.5873 & 6.9259 & 10.287 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=280561&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]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]9[/C][C]0[/C][C]0[/C][C]12.2222[/C][C]12.2222[/C][/ROW]
[ROW][C]74[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]9[/C][C]9[/C][C]3[/C][C]12.2222[/C][C]12.2222[/C][/ROW]
[ROW][C]75[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]8.41[/C][C]8.8033[/C][C]2.967[/C][C]11.8148[/C][C]12.0864[/C][/ROW]
[ROW][C]76[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]6.76[/C][C]8.2925[/C][C]2.8797[/C][C]10.5926[/C][C]11.713[/C][/ROW]
[ROW][C]77[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]7.84[/C][C]8.202[/C][C]2.8639[/C][C]11.4074[/C][C]11.6519[/C][/ROW]
[ROW][C]78[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]8.41[/C][C]8.2367[/C][C]2.87[/C][C]11.8148[/C][C]11.679[/C][/ROW]
[ROW][C]79[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]9.61[/C][C]8.4329[/C][C]2.9039[/C][C]12.6296[/C][C]11.8148[/C][/ROW]
[ROW][C]80[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]7.84[/C][C]8.3588[/C][C]2.8912[/C][C]11.4074[/C][C]11.7639[/C][/ROW]
[ROW][C]81[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]5.76[/C][C]8.07[/C][C]2.8408[/C][C]9.7778[/C][C]11.5432[/C][/ROW]
[ROW][C]82[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]2.56[/C][C]7.519[/C][C]2.7421[/C][C]6.5185[/C][C]11.0407[/C][/ROW]
[ROW][C]83[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]2.25[/C][C]7.04[/C][C]2.6533[/C][C]6.1111[/C][C]10.5926[/C][/ROW]
[ROW][C]84[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]2.89[/C][C]6.6942[/C][C]2.5873[/C][C]6.9259[/C][C]10.287[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=280561&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=280561&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
73Inf11290012.222212.2222
74Inf11299312.222212.2222
75Inf1128.418.80332.96711.814812.0864
76Inf1126.768.29252.879710.592611.713
77Inf1127.848.2022.863911.407411.6519
78Inf1128.418.23672.8711.814811.679
79Inf1129.618.43292.903912.629611.8148
80Inf1127.848.35882.891211.407411.7639
81Inf1125.768.072.84089.777811.5432
82Inf1122.567.5192.74216.518511.0407
83Inf1122.257.042.65336.111110.5926
84Inf1122.896.69422.58736.925910.287



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