Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 07 Dec 2007 07:36:49 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2007/Dec/07/t1197037810xr5mpibudhpv0am.htm/, Retrieved Mon, 29 Apr 2024 05:21:53 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2853, Retrieved Mon, 29 Apr 2024 05:21:53 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsVraag 3, WS 9
Estimated Impact182
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [WS 9] [2007-12-07 14:36:49] [ce556af355e2eff84137e549c6ea8397] [Current]
Feedback Forum

Post a new message
Dataseries X:
97.3
101
113.2
101
105.7
113.9
86.4
96.5
103.3
114.9
105.8
94.2
98.4
99.4
108.8
112.6
104.4
112.2
81.1
97.1
112.6
113.8
107.8
103.2
103.3
101.2
107.7
110.4
101.9
115.9
89.9
88.6
117.2
123.9
100
103.6
94.1
98.7
119.5
112.7
104.4
124.7
89.1
97
121.6
118.8
114
111.5
97.2
102.5
113.4
109.8
104.9
126.1
80
96.8
117.2
112.3
117.3
111.1
102.2
104.3
122.9
107.6
121.3
131.5
89
104.4
128.9
135.9
133.3
121.3
120.5
120.4
137.9
126.1
133.2
146.6
103.4
117.2




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational 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 & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2853&T=0

[TABLE]
[ROW][C]Summary of compuational 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]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2853&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2853&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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[68])
5696.8-------
57117.2-------
58112.3-------
59117.3-------
60111.1-------
61102.2-------
62104.3-------
63122.9-------
64107.6-------
65121.3-------
66131.5-------
6789-------
68104.4-------
69128.9123.5193113.2589133.77970.1520.99990.88630.9999
70135.9120.8758110.6147131.13680.00210.06270.94930.9992
71133.3117.1674106.7646127.57030.00122e-040.490.9919
72121.3112.0969100.4846123.70910.06022e-040.56680.9031
73120.5100.807389.1938112.42084e-043e-040.40710.2721
74120.4105.505793.7647117.24670.00650.00620.57980.5732
75137.9120.5618108.5314132.59220.00240.51050.35160.9958
76126.1111.565499.53123.60070.00900.74080.8784
77133.2113.0449100.9387125.1516e-040.01730.09070.9192
78146.6129.0123116.8287141.19590.00230.25030.34451
79103.487.171974.982599.36130.004500.38440.0028
80117.2100.967488.7457113.1890.00460.34820.2910.291

\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[68]) \tabularnewline
56 & 96.8 & - & - & - & - & - & - & - \tabularnewline
57 & 117.2 & - & - & - & - & - & - & - \tabularnewline
58 & 112.3 & - & - & - & - & - & - & - \tabularnewline
59 & 117.3 & - & - & - & - & - & - & - \tabularnewline
60 & 111.1 & - & - & - & - & - & - & - \tabularnewline
61 & 102.2 & - & - & - & - & - & - & - \tabularnewline
62 & 104.3 & - & - & - & - & - & - & - \tabularnewline
63 & 122.9 & - & - & - & - & - & - & - \tabularnewline
64 & 107.6 & - & - & - & - & - & - & - \tabularnewline
65 & 121.3 & - & - & - & - & - & - & - \tabularnewline
66 & 131.5 & - & - & - & - & - & - & - \tabularnewline
67 & 89 & - & - & - & - & - & - & - \tabularnewline
68 & 104.4 & - & - & - & - & - & - & - \tabularnewline
69 & 128.9 & 123.5193 & 113.2589 & 133.7797 & 0.152 & 0.9999 & 0.8863 & 0.9999 \tabularnewline
70 & 135.9 & 120.8758 & 110.6147 & 131.1368 & 0.0021 & 0.0627 & 0.9493 & 0.9992 \tabularnewline
71 & 133.3 & 117.1674 & 106.7646 & 127.5703 & 0.0012 & 2e-04 & 0.49 & 0.9919 \tabularnewline
72 & 121.3 & 112.0969 & 100.4846 & 123.7091 & 0.0602 & 2e-04 & 0.5668 & 0.9031 \tabularnewline
73 & 120.5 & 100.8073 & 89.1938 & 112.4208 & 4e-04 & 3e-04 & 0.4071 & 0.2721 \tabularnewline
74 & 120.4 & 105.5057 & 93.7647 & 117.2467 & 0.0065 & 0.0062 & 0.5798 & 0.5732 \tabularnewline
75 & 137.9 & 120.5618 & 108.5314 & 132.5922 & 0.0024 & 0.5105 & 0.3516 & 0.9958 \tabularnewline
76 & 126.1 & 111.5654 & 99.53 & 123.6007 & 0.009 & 0 & 0.7408 & 0.8784 \tabularnewline
77 & 133.2 & 113.0449 & 100.9387 & 125.151 & 6e-04 & 0.0173 & 0.0907 & 0.9192 \tabularnewline
78 & 146.6 & 129.0123 & 116.8287 & 141.1959 & 0.0023 & 0.2503 & 0.3445 & 1 \tabularnewline
79 & 103.4 & 87.1719 & 74.9825 & 99.3613 & 0.0045 & 0 & 0.3844 & 0.0028 \tabularnewline
80 & 117.2 & 100.9674 & 88.7457 & 113.189 & 0.0046 & 0.3482 & 0.291 & 0.291 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2853&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[68])[/C][/ROW]
[ROW][C]56[/C][C]96.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]117.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]112.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]117.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]111.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]102.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]104.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]122.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]107.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]121.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]131.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]104.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]128.9[/C][C]123.5193[/C][C]113.2589[/C][C]133.7797[/C][C]0.152[/C][C]0.9999[/C][C]0.8863[/C][C]0.9999[/C][/ROW]
[ROW][C]70[/C][C]135.9[/C][C]120.8758[/C][C]110.6147[/C][C]131.1368[/C][C]0.0021[/C][C]0.0627[/C][C]0.9493[/C][C]0.9992[/C][/ROW]
[ROW][C]71[/C][C]133.3[/C][C]117.1674[/C][C]106.7646[/C][C]127.5703[/C][C]0.0012[/C][C]2e-04[/C][C]0.49[/C][C]0.9919[/C][/ROW]
[ROW][C]72[/C][C]121.3[/C][C]112.0969[/C][C]100.4846[/C][C]123.7091[/C][C]0.0602[/C][C]2e-04[/C][C]0.5668[/C][C]0.9031[/C][/ROW]
[ROW][C]73[/C][C]120.5[/C][C]100.8073[/C][C]89.1938[/C][C]112.4208[/C][C]4e-04[/C][C]3e-04[/C][C]0.4071[/C][C]0.2721[/C][/ROW]
[ROW][C]74[/C][C]120.4[/C][C]105.5057[/C][C]93.7647[/C][C]117.2467[/C][C]0.0065[/C][C]0.0062[/C][C]0.5798[/C][C]0.5732[/C][/ROW]
[ROW][C]75[/C][C]137.9[/C][C]120.5618[/C][C]108.5314[/C][C]132.5922[/C][C]0.0024[/C][C]0.5105[/C][C]0.3516[/C][C]0.9958[/C][/ROW]
[ROW][C]76[/C][C]126.1[/C][C]111.5654[/C][C]99.53[/C][C]123.6007[/C][C]0.009[/C][C]0[/C][C]0.7408[/C][C]0.8784[/C][/ROW]
[ROW][C]77[/C][C]133.2[/C][C]113.0449[/C][C]100.9387[/C][C]125.151[/C][C]6e-04[/C][C]0.0173[/C][C]0.0907[/C][C]0.9192[/C][/ROW]
[ROW][C]78[/C][C]146.6[/C][C]129.0123[/C][C]116.8287[/C][C]141.1959[/C][C]0.0023[/C][C]0.2503[/C][C]0.3445[/C][C]1[/C][/ROW]
[ROW][C]79[/C][C]103.4[/C][C]87.1719[/C][C]74.9825[/C][C]99.3613[/C][C]0.0045[/C][C]0[/C][C]0.3844[/C][C]0.0028[/C][/ROW]
[ROW][C]80[/C][C]117.2[/C][C]100.9674[/C][C]88.7457[/C][C]113.189[/C][C]0.0046[/C][C]0.3482[/C][C]0.291[/C][C]0.291[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2853&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2853&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[68])
5696.8-------
57117.2-------
58112.3-------
59117.3-------
60111.1-------
61102.2-------
62104.3-------
63122.9-------
64107.6-------
65121.3-------
66131.5-------
6789-------
68104.4-------
69128.9123.5193113.2589133.77970.1520.99990.88630.9999
70135.9120.8758110.6147131.13680.00210.06270.94930.9992
71133.3117.1674106.7646127.57030.00122e-040.490.9919
72121.3112.0969100.4846123.70910.06022e-040.56680.9031
73120.5100.807389.1938112.42084e-043e-040.40710.2721
74120.4105.505793.7647117.24670.00650.00620.57980.5732
75137.9120.5618108.5314132.59220.00240.51050.35160.9958
76126.1111.565499.53123.60070.00900.74080.8784
77133.2113.0449100.9387125.1516e-040.01730.09070.9192
78146.6129.0123116.8287141.19590.00230.25030.34451
79103.487.171974.982599.36130.004500.38440.0028
80117.2100.967488.7457113.1890.00460.34820.2910.291







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
690.04240.04360.003628.95232.41271.5533
700.04330.12430.0104225.727718.81064.3371
710.04530.13770.0115260.259421.68834.6571
720.05290.08210.006884.69777.05812.6567
730.05880.19540.0163387.802732.31695.6848
740.05680.14120.0118221.839418.48664.2996
750.05090.14380.012300.613425.05115.0051
760.0550.13030.0109211.255317.60464.1958
770.05460.17830.0149406.2333.85255.8183
780.04820.13630.0114309.327525.77735.0771
790.07130.18620.0155263.351521.9464.6847
800.06180.16080.0134263.498421.95824.686

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
69 & 0.0424 & 0.0436 & 0.0036 & 28.9523 & 2.4127 & 1.5533 \tabularnewline
70 & 0.0433 & 0.1243 & 0.0104 & 225.7277 & 18.8106 & 4.3371 \tabularnewline
71 & 0.0453 & 0.1377 & 0.0115 & 260.2594 & 21.6883 & 4.6571 \tabularnewline
72 & 0.0529 & 0.0821 & 0.0068 & 84.6977 & 7.0581 & 2.6567 \tabularnewline
73 & 0.0588 & 0.1954 & 0.0163 & 387.8027 & 32.3169 & 5.6848 \tabularnewline
74 & 0.0568 & 0.1412 & 0.0118 & 221.8394 & 18.4866 & 4.2996 \tabularnewline
75 & 0.0509 & 0.1438 & 0.012 & 300.6134 & 25.0511 & 5.0051 \tabularnewline
76 & 0.055 & 0.1303 & 0.0109 & 211.2553 & 17.6046 & 4.1958 \tabularnewline
77 & 0.0546 & 0.1783 & 0.0149 & 406.23 & 33.8525 & 5.8183 \tabularnewline
78 & 0.0482 & 0.1363 & 0.0114 & 309.3275 & 25.7773 & 5.0771 \tabularnewline
79 & 0.0713 & 0.1862 & 0.0155 & 263.3515 & 21.946 & 4.6847 \tabularnewline
80 & 0.0618 & 0.1608 & 0.0134 & 263.4984 & 21.9582 & 4.686 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2853&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]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]69[/C][C]0.0424[/C][C]0.0436[/C][C]0.0036[/C][C]28.9523[/C][C]2.4127[/C][C]1.5533[/C][/ROW]
[ROW][C]70[/C][C]0.0433[/C][C]0.1243[/C][C]0.0104[/C][C]225.7277[/C][C]18.8106[/C][C]4.3371[/C][/ROW]
[ROW][C]71[/C][C]0.0453[/C][C]0.1377[/C][C]0.0115[/C][C]260.2594[/C][C]21.6883[/C][C]4.6571[/C][/ROW]
[ROW][C]72[/C][C]0.0529[/C][C]0.0821[/C][C]0.0068[/C][C]84.6977[/C][C]7.0581[/C][C]2.6567[/C][/ROW]
[ROW][C]73[/C][C]0.0588[/C][C]0.1954[/C][C]0.0163[/C][C]387.8027[/C][C]32.3169[/C][C]5.6848[/C][/ROW]
[ROW][C]74[/C][C]0.0568[/C][C]0.1412[/C][C]0.0118[/C][C]221.8394[/C][C]18.4866[/C][C]4.2996[/C][/ROW]
[ROW][C]75[/C][C]0.0509[/C][C]0.1438[/C][C]0.012[/C][C]300.6134[/C][C]25.0511[/C][C]5.0051[/C][/ROW]
[ROW][C]76[/C][C]0.055[/C][C]0.1303[/C][C]0.0109[/C][C]211.2553[/C][C]17.6046[/C][C]4.1958[/C][/ROW]
[ROW][C]77[/C][C]0.0546[/C][C]0.1783[/C][C]0.0149[/C][C]406.23[/C][C]33.8525[/C][C]5.8183[/C][/ROW]
[ROW][C]78[/C][C]0.0482[/C][C]0.1363[/C][C]0.0114[/C][C]309.3275[/C][C]25.7773[/C][C]5.0771[/C][/ROW]
[ROW][C]79[/C][C]0.0713[/C][C]0.1862[/C][C]0.0155[/C][C]263.3515[/C][C]21.946[/C][C]4.6847[/C][/ROW]
[ROW][C]80[/C][C]0.0618[/C][C]0.1608[/C][C]0.0134[/C][C]263.4984[/C][C]21.9582[/C][C]4.686[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2853&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2853&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.PEMAPESq.EMSERMSE
690.04240.04360.003628.95232.41271.5533
700.04330.12430.0104225.727718.81064.3371
710.04530.13770.0115260.259421.68834.6571
720.05290.08210.006884.69777.05812.6567
730.05880.19540.0163387.802732.31695.6848
740.05680.14120.0118221.839418.48664.2996
750.05090.14380.012300.613425.05115.0051
760.0550.13030.0109211.255317.60464.1958
770.05460.17830.0149406.2333.85255.8183
780.04820.13630.0114309.327525.77735.0771
790.07130.18620.0155263.351521.9464.6847
800.06180.16080.0134263.498421.95824.686



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; 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
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)
}
(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.mape <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i]
perf.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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',7,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,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')