Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 11 Dec 2007 10:02:55 -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/11/t1197391704hoo7vjhpxx10jcv.htm/, Retrieved Mon, 29 Apr 2024 07:18:37 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3134, Retrieved Mon, 29 Apr 2024 07:18:37 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact207
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forcasting ...] [2007-12-11 17:02:55] [a98121933c09d0d44a9f89053acd1df1] [Current]
Feedback Forum

Post a new message
Dataseries X:
102.7
103.2
105.6
103.9
107.2
100.7
92.1
90.3
93.4
98.5
100.8
102.3
104.7
101.1
101.4
99.5
98.4
96.3
100.7
101.2
100.3
97.8
97.4
98.6
99.7
99
98.1
97
98.5
103.8
114.4
124.5
134.2
131.8
125.6
119.9
114.9
115.5
112.5
111.4
115.3
110.8
103.7
111.1
113
111.2
117.6
121.7
127.3
129.8
137.1
141.4
137.4
130.7
117.2
110.8
111.4
108.2
108.8
110.2
109.5
109.5
116
111.2
112.1
114
119.1
114.1
115.1
115.4
110.8
116
119.2
126.5
127.8
131.3
140.3
137.3
143
134.5
139.9
159.3
170.4
175
175.8
180.9
180.3
169.6
172.3
184.8
177.7
184.6
211.4




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3134&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3134&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3134&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 time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







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[81])
69115.1-------
70115.4-------
71110.8-------
72116-------
73119.2-------
74126.5-------
75127.8-------
76131.3-------
77140.3-------
78137.3-------
79143-------
80134.5-------
81139.9-------
82159.3142.8308134.4384151.22321e-040.753210.7532
83170.4142.4135129.0997155.727300.006510.6443
84175142.2069125.3522159.06161e-045e-040.99880.6058
85175.8142.5894122.8181162.36085e-047e-040.98980.6051
86180.9142.9408120.6309165.25074e-040.00190.92570.6053
87180.3140.8819116.2942165.46978e-047e-040.85150.5312
88169.6142.617115.9453169.28880.02370.00280.79720.5791
89172.3142.7565114.1522171.36080.02150.03290.56680.5776
90184.8141.992111.5777172.40630.00290.02540.61880.5536
91177.7140.6018108.4793172.72440.01180.00350.44180.5171
92184.6141.8246108.0802175.56890.00650.01860.66470.5445
93211.4141.7581106.4664177.04991e-040.00870.54110.5411

\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[81]) \tabularnewline
69 & 115.1 & - & - & - & - & - & - & - \tabularnewline
70 & 115.4 & - & - & - & - & - & - & - \tabularnewline
71 & 110.8 & - & - & - & - & - & - & - \tabularnewline
72 & 116 & - & - & - & - & - & - & - \tabularnewline
73 & 119.2 & - & - & - & - & - & - & - \tabularnewline
74 & 126.5 & - & - & - & - & - & - & - \tabularnewline
75 & 127.8 & - & - & - & - & - & - & - \tabularnewline
76 & 131.3 & - & - & - & - & - & - & - \tabularnewline
77 & 140.3 & - & - & - & - & - & - & - \tabularnewline
78 & 137.3 & - & - & - & - & - & - & - \tabularnewline
79 & 143 & - & - & - & - & - & - & - \tabularnewline
80 & 134.5 & - & - & - & - & - & - & - \tabularnewline
81 & 139.9 & - & - & - & - & - & - & - \tabularnewline
82 & 159.3 & 142.8308 & 134.4384 & 151.2232 & 1e-04 & 0.7532 & 1 & 0.7532 \tabularnewline
83 & 170.4 & 142.4135 & 129.0997 & 155.7273 & 0 & 0.0065 & 1 & 0.6443 \tabularnewline
84 & 175 & 142.2069 & 125.3522 & 159.0616 & 1e-04 & 5e-04 & 0.9988 & 0.6058 \tabularnewline
85 & 175.8 & 142.5894 & 122.8181 & 162.3608 & 5e-04 & 7e-04 & 0.9898 & 0.6051 \tabularnewline
86 & 180.9 & 142.9408 & 120.6309 & 165.2507 & 4e-04 & 0.0019 & 0.9257 & 0.6053 \tabularnewline
87 & 180.3 & 140.8819 & 116.2942 & 165.4697 & 8e-04 & 7e-04 & 0.8515 & 0.5312 \tabularnewline
88 & 169.6 & 142.617 & 115.9453 & 169.2888 & 0.0237 & 0.0028 & 0.7972 & 0.5791 \tabularnewline
89 & 172.3 & 142.7565 & 114.1522 & 171.3608 & 0.0215 & 0.0329 & 0.5668 & 0.5776 \tabularnewline
90 & 184.8 & 141.992 & 111.5777 & 172.4063 & 0.0029 & 0.0254 & 0.6188 & 0.5536 \tabularnewline
91 & 177.7 & 140.6018 & 108.4793 & 172.7244 & 0.0118 & 0.0035 & 0.4418 & 0.5171 \tabularnewline
92 & 184.6 & 141.8246 & 108.0802 & 175.5689 & 0.0065 & 0.0186 & 0.6647 & 0.5445 \tabularnewline
93 & 211.4 & 141.7581 & 106.4664 & 177.0499 & 1e-04 & 0.0087 & 0.5411 & 0.5411 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3134&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[81])[/C][/ROW]
[ROW][C]69[/C][C]115.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]115.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]110.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]116[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]119.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]126.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]127.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]131.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]140.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]137.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]143[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]134.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]139.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]159.3[/C][C]142.8308[/C][C]134.4384[/C][C]151.2232[/C][C]1e-04[/C][C]0.7532[/C][C]1[/C][C]0.7532[/C][/ROW]
[ROW][C]83[/C][C]170.4[/C][C]142.4135[/C][C]129.0997[/C][C]155.7273[/C][C]0[/C][C]0.0065[/C][C]1[/C][C]0.6443[/C][/ROW]
[ROW][C]84[/C][C]175[/C][C]142.2069[/C][C]125.3522[/C][C]159.0616[/C][C]1e-04[/C][C]5e-04[/C][C]0.9988[/C][C]0.6058[/C][/ROW]
[ROW][C]85[/C][C]175.8[/C][C]142.5894[/C][C]122.8181[/C][C]162.3608[/C][C]5e-04[/C][C]7e-04[/C][C]0.9898[/C][C]0.6051[/C][/ROW]
[ROW][C]86[/C][C]180.9[/C][C]142.9408[/C][C]120.6309[/C][C]165.2507[/C][C]4e-04[/C][C]0.0019[/C][C]0.9257[/C][C]0.6053[/C][/ROW]
[ROW][C]87[/C][C]180.3[/C][C]140.8819[/C][C]116.2942[/C][C]165.4697[/C][C]8e-04[/C][C]7e-04[/C][C]0.8515[/C][C]0.5312[/C][/ROW]
[ROW][C]88[/C][C]169.6[/C][C]142.617[/C][C]115.9453[/C][C]169.2888[/C][C]0.0237[/C][C]0.0028[/C][C]0.7972[/C][C]0.5791[/C][/ROW]
[ROW][C]89[/C][C]172.3[/C][C]142.7565[/C][C]114.1522[/C][C]171.3608[/C][C]0.0215[/C][C]0.0329[/C][C]0.5668[/C][C]0.5776[/C][/ROW]
[ROW][C]90[/C][C]184.8[/C][C]141.992[/C][C]111.5777[/C][C]172.4063[/C][C]0.0029[/C][C]0.0254[/C][C]0.6188[/C][C]0.5536[/C][/ROW]
[ROW][C]91[/C][C]177.7[/C][C]140.6018[/C][C]108.4793[/C][C]172.7244[/C][C]0.0118[/C][C]0.0035[/C][C]0.4418[/C][C]0.5171[/C][/ROW]
[ROW][C]92[/C][C]184.6[/C][C]141.8246[/C][C]108.0802[/C][C]175.5689[/C][C]0.0065[/C][C]0.0186[/C][C]0.6647[/C][C]0.5445[/C][/ROW]
[ROW][C]93[/C][C]211.4[/C][C]141.7581[/C][C]106.4664[/C][C]177.0499[/C][C]1e-04[/C][C]0.0087[/C][C]0.5411[/C][C]0.5411[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3134&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3134&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[81])
69115.1-------
70115.4-------
71110.8-------
72116-------
73119.2-------
74126.5-------
75127.8-------
76131.3-------
77140.3-------
78137.3-------
79143-------
80134.5-------
81139.9-------
82159.3142.8308134.4384151.22321e-040.753210.7532
83170.4142.4135129.0997155.727300.006510.6443
84175142.2069125.3522159.06161e-045e-040.99880.6058
85175.8142.5894122.8181162.36085e-047e-040.98980.6051
86180.9142.9408120.6309165.25074e-040.00190.92570.6053
87180.3140.8819116.2942165.46978e-047e-040.85150.5312
88169.6142.617115.9453169.28880.02370.00280.79720.5791
89172.3142.7565114.1522171.36080.02150.03290.56680.5776
90184.8141.992111.5777172.40630.00290.02540.61880.5536
91177.7140.6018108.4793172.72440.01180.00350.44180.5171
92184.6141.8246108.0802175.56890.00650.01860.66470.5445
93211.4141.7581106.4664177.04991e-040.00870.54110.5411







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
820.030.11530.0096271.23522.60294.7543
830.04770.19650.0164783.242665.27028.079
840.06050.23060.01921075.386689.61569.4665
850.07070.23290.01941102.942991.91199.5871
860.07960.26560.02211440.8996120.07510.9579
870.0890.27980.02331553.7841129.48211.379
880.09540.18920.0158728.080660.67347.7893
890.10220.2070.0172872.81772.73478.5285
900.10930.30150.02511832.5255152.710512.3576
910.11660.26390.0221376.2733114.689410.7093
920.12140.30160.02511829.7373152.478112.3482
930.1270.49130.04094849.9897404.165820.1039

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
82 & 0.03 & 0.1153 & 0.0096 & 271.235 & 22.6029 & 4.7543 \tabularnewline
83 & 0.0477 & 0.1965 & 0.0164 & 783.2426 & 65.2702 & 8.079 \tabularnewline
84 & 0.0605 & 0.2306 & 0.0192 & 1075.3866 & 89.6156 & 9.4665 \tabularnewline
85 & 0.0707 & 0.2329 & 0.0194 & 1102.9429 & 91.9119 & 9.5871 \tabularnewline
86 & 0.0796 & 0.2656 & 0.0221 & 1440.8996 & 120.075 & 10.9579 \tabularnewline
87 & 0.089 & 0.2798 & 0.0233 & 1553.7841 & 129.482 & 11.379 \tabularnewline
88 & 0.0954 & 0.1892 & 0.0158 & 728.0806 & 60.6734 & 7.7893 \tabularnewline
89 & 0.1022 & 0.207 & 0.0172 & 872.817 & 72.7347 & 8.5285 \tabularnewline
90 & 0.1093 & 0.3015 & 0.0251 & 1832.5255 & 152.7105 & 12.3576 \tabularnewline
91 & 0.1166 & 0.2639 & 0.022 & 1376.2733 & 114.6894 & 10.7093 \tabularnewline
92 & 0.1214 & 0.3016 & 0.0251 & 1829.7373 & 152.4781 & 12.3482 \tabularnewline
93 & 0.127 & 0.4913 & 0.0409 & 4849.9897 & 404.1658 & 20.1039 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3134&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]82[/C][C]0.03[/C][C]0.1153[/C][C]0.0096[/C][C]271.235[/C][C]22.6029[/C][C]4.7543[/C][/ROW]
[ROW][C]83[/C][C]0.0477[/C][C]0.1965[/C][C]0.0164[/C][C]783.2426[/C][C]65.2702[/C][C]8.079[/C][/ROW]
[ROW][C]84[/C][C]0.0605[/C][C]0.2306[/C][C]0.0192[/C][C]1075.3866[/C][C]89.6156[/C][C]9.4665[/C][/ROW]
[ROW][C]85[/C][C]0.0707[/C][C]0.2329[/C][C]0.0194[/C][C]1102.9429[/C][C]91.9119[/C][C]9.5871[/C][/ROW]
[ROW][C]86[/C][C]0.0796[/C][C]0.2656[/C][C]0.0221[/C][C]1440.8996[/C][C]120.075[/C][C]10.9579[/C][/ROW]
[ROW][C]87[/C][C]0.089[/C][C]0.2798[/C][C]0.0233[/C][C]1553.7841[/C][C]129.482[/C][C]11.379[/C][/ROW]
[ROW][C]88[/C][C]0.0954[/C][C]0.1892[/C][C]0.0158[/C][C]728.0806[/C][C]60.6734[/C][C]7.7893[/C][/ROW]
[ROW][C]89[/C][C]0.1022[/C][C]0.207[/C][C]0.0172[/C][C]872.817[/C][C]72.7347[/C][C]8.5285[/C][/ROW]
[ROW][C]90[/C][C]0.1093[/C][C]0.3015[/C][C]0.0251[/C][C]1832.5255[/C][C]152.7105[/C][C]12.3576[/C][/ROW]
[ROW][C]91[/C][C]0.1166[/C][C]0.2639[/C][C]0.022[/C][C]1376.2733[/C][C]114.6894[/C][C]10.7093[/C][/ROW]
[ROW][C]92[/C][C]0.1214[/C][C]0.3016[/C][C]0.0251[/C][C]1829.7373[/C][C]152.4781[/C][C]12.3482[/C][/ROW]
[ROW][C]93[/C][C]0.127[/C][C]0.4913[/C][C]0.0409[/C][C]4849.9897[/C][C]404.1658[/C][C]20.1039[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3134&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3134&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
820.030.11530.0096271.23522.60294.7543
830.04770.19650.0164783.242665.27028.079
840.06050.23060.01921075.386689.61569.4665
850.07070.23290.01941102.942991.91199.5871
860.07960.26560.02211440.8996120.07510.9579
870.0890.27980.02331553.7841129.48211.379
880.09540.18920.0158728.080660.67347.7893
890.10220.2070.0172872.81772.73478.5285
900.10930.30150.02511832.5255152.710512.3576
910.11660.26390.0221376.2733114.689410.7093
920.12140.30160.02511829.7373152.478112.3482
930.1270.49130.04094849.9897404.165820.1039



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