Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 06 Dec 2007 04:25:39 -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/06/t11969395823j84a5t8ee4e9g4.htm/, Retrieved Fri, 03 May 2024 11:22:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2568, Retrieved Fri, 03 May 2024 11:22:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact215
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Extrapolation for...] [2007-12-06 11:25:39] [640491d00f3c9cca22cbf779aa38ac16] [Current]
Feedback Forum

Post a new message
Dataseries X:
100.70
97.90
96.50
96.60
96.60
95.50
91.80
89.30
87.00
85.90
88.00
87.90
89.20
90.90
91.60
90.20
89.10
87.50
86.30
86.00
84.40
86.10
91.00
92.70
88.00
84.30
82.20
80.80
79.40
80.20
82.20
82.20
81.20
82.10
88.10
88.50
92.10
98.60
100.90
100.60
101.10
102.10
103.60
102.80
108.30
104.00
106.10
106.30
109.00
111.00
113.70
112.70
110.30
114.50
119.30
121.80
125.40
129.70
129.40
134.50
141.20
141.40
152.20
167.70
173.30
168.70
172.60
169.80
172.00
179.40
174.60
172.50
172.60
176.30
178.90
179.60
179.90
180.30
180.90
177.70




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2568&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 time2 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[68])
56121.8-------
57125.4-------
58129.7-------
59129.4-------
60134.5-------
61141.2-------
62141.4-------
63152.2-------
64167.7-------
65173.3-------
66168.7-------
67172.6-------
68169.8-------
69172172.3234164.7028179.9440.46690.741810.7418
70179.4171.9893159.3977184.58090.12430.499310.6334
71174.6172.2864156.2542188.31850.38860.192210.6194
72172.5174.5209155.7177193.3240.41660.496710.6887
73172.6178.7883157.6182199.95840.28330.71980.99970.7973
74176.3179.3164156.0589202.57380.39970.71430.99930.7887
75178.9185.7466160.6108210.88240.29670.76930.99550.8932
76179.6192.8914166.0418219.74110.1660.84650.9670.9541
77179.9194.1795165.75222.6090.16240.84260.9250.9536
78180.3193.2537163.3567223.15080.19790.80930.94630.9379
79180.9197.08165.8113228.34870.15520.85360.93750.9564
80177.7196.3016163.7444228.85870.13140.82310.94470.9447

\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 & 121.8 & - & - & - & - & - & - & - \tabularnewline
57 & 125.4 & - & - & - & - & - & - & - \tabularnewline
58 & 129.7 & - & - & - & - & - & - & - \tabularnewline
59 & 129.4 & - & - & - & - & - & - & - \tabularnewline
60 & 134.5 & - & - & - & - & - & - & - \tabularnewline
61 & 141.2 & - & - & - & - & - & - & - \tabularnewline
62 & 141.4 & - & - & - & - & - & - & - \tabularnewline
63 & 152.2 & - & - & - & - & - & - & - \tabularnewline
64 & 167.7 & - & - & - & - & - & - & - \tabularnewline
65 & 173.3 & - & - & - & - & - & - & - \tabularnewline
66 & 168.7 & - & - & - & - & - & - & - \tabularnewline
67 & 172.6 & - & - & - & - & - & - & - \tabularnewline
68 & 169.8 & - & - & - & - & - & - & - \tabularnewline
69 & 172 & 172.3234 & 164.7028 & 179.944 & 0.4669 & 0.7418 & 1 & 0.7418 \tabularnewline
70 & 179.4 & 171.9893 & 159.3977 & 184.5809 & 0.1243 & 0.4993 & 1 & 0.6334 \tabularnewline
71 & 174.6 & 172.2864 & 156.2542 & 188.3185 & 0.3886 & 0.1922 & 1 & 0.6194 \tabularnewline
72 & 172.5 & 174.5209 & 155.7177 & 193.324 & 0.4166 & 0.4967 & 1 & 0.6887 \tabularnewline
73 & 172.6 & 178.7883 & 157.6182 & 199.9584 & 0.2833 & 0.7198 & 0.9997 & 0.7973 \tabularnewline
74 & 176.3 & 179.3164 & 156.0589 & 202.5738 & 0.3997 & 0.7143 & 0.9993 & 0.7887 \tabularnewline
75 & 178.9 & 185.7466 & 160.6108 & 210.8824 & 0.2967 & 0.7693 & 0.9955 & 0.8932 \tabularnewline
76 & 179.6 & 192.8914 & 166.0418 & 219.7411 & 0.166 & 0.8465 & 0.967 & 0.9541 \tabularnewline
77 & 179.9 & 194.1795 & 165.75 & 222.609 & 0.1624 & 0.8426 & 0.925 & 0.9536 \tabularnewline
78 & 180.3 & 193.2537 & 163.3567 & 223.1508 & 0.1979 & 0.8093 & 0.9463 & 0.9379 \tabularnewline
79 & 180.9 & 197.08 & 165.8113 & 228.3487 & 0.1552 & 0.8536 & 0.9375 & 0.9564 \tabularnewline
80 & 177.7 & 196.3016 & 163.7444 & 228.8587 & 0.1314 & 0.8231 & 0.9447 & 0.9447 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2568&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]121.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]125.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]129.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]129.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]134.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]141.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]141.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]152.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]167.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]173.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]168.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]172.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]169.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]172[/C][C]172.3234[/C][C]164.7028[/C][C]179.944[/C][C]0.4669[/C][C]0.7418[/C][C]1[/C][C]0.7418[/C][/ROW]
[ROW][C]70[/C][C]179.4[/C][C]171.9893[/C][C]159.3977[/C][C]184.5809[/C][C]0.1243[/C][C]0.4993[/C][C]1[/C][C]0.6334[/C][/ROW]
[ROW][C]71[/C][C]174.6[/C][C]172.2864[/C][C]156.2542[/C][C]188.3185[/C][C]0.3886[/C][C]0.1922[/C][C]1[/C][C]0.6194[/C][/ROW]
[ROW][C]72[/C][C]172.5[/C][C]174.5209[/C][C]155.7177[/C][C]193.324[/C][C]0.4166[/C][C]0.4967[/C][C]1[/C][C]0.6887[/C][/ROW]
[ROW][C]73[/C][C]172.6[/C][C]178.7883[/C][C]157.6182[/C][C]199.9584[/C][C]0.2833[/C][C]0.7198[/C][C]0.9997[/C][C]0.7973[/C][/ROW]
[ROW][C]74[/C][C]176.3[/C][C]179.3164[/C][C]156.0589[/C][C]202.5738[/C][C]0.3997[/C][C]0.7143[/C][C]0.9993[/C][C]0.7887[/C][/ROW]
[ROW][C]75[/C][C]178.9[/C][C]185.7466[/C][C]160.6108[/C][C]210.8824[/C][C]0.2967[/C][C]0.7693[/C][C]0.9955[/C][C]0.8932[/C][/ROW]
[ROW][C]76[/C][C]179.6[/C][C]192.8914[/C][C]166.0418[/C][C]219.7411[/C][C]0.166[/C][C]0.8465[/C][C]0.967[/C][C]0.9541[/C][/ROW]
[ROW][C]77[/C][C]179.9[/C][C]194.1795[/C][C]165.75[/C][C]222.609[/C][C]0.1624[/C][C]0.8426[/C][C]0.925[/C][C]0.9536[/C][/ROW]
[ROW][C]78[/C][C]180.3[/C][C]193.2537[/C][C]163.3567[/C][C]223.1508[/C][C]0.1979[/C][C]0.8093[/C][C]0.9463[/C][C]0.9379[/C][/ROW]
[ROW][C]79[/C][C]180.9[/C][C]197.08[/C][C]165.8113[/C][C]228.3487[/C][C]0.1552[/C][C]0.8536[/C][C]0.9375[/C][C]0.9564[/C][/ROW]
[ROW][C]80[/C][C]177.7[/C][C]196.3016[/C][C]163.7444[/C][C]228.8587[/C][C]0.1314[/C][C]0.8231[/C][C]0.9447[/C][C]0.9447[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2568&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2568&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])
56121.8-------
57125.4-------
58129.7-------
59129.4-------
60134.5-------
61141.2-------
62141.4-------
63152.2-------
64167.7-------
65173.3-------
66168.7-------
67172.6-------
68169.8-------
69172172.3234164.7028179.9440.46690.741810.7418
70179.4171.9893159.3977184.58090.12430.499310.6334
71174.6172.2864156.2542188.31850.38860.192210.6194
72172.5174.5209155.7177193.3240.41660.496710.6887
73172.6178.7883157.6182199.95840.28330.71980.99970.7973
74176.3179.3164156.0589202.57380.39970.71430.99930.7887
75178.9185.7466160.6108210.88240.29670.76930.99550.8932
76179.6192.8914166.0418219.74110.1660.84650.9670.9541
77179.9194.1795165.75222.6090.16240.84260.9250.9536
78180.3193.2537163.3567223.15080.19790.80930.94630.9379
79180.9197.08165.8113228.34870.15520.85360.93750.9564
80177.7196.3016163.7444228.85870.13140.82310.94470.9447







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
690.0226-0.00192e-040.10460.00870.0934
700.03740.04310.003654.91844.57652.1393
710.04750.01340.00115.35290.44610.6679
720.055-0.01160.0014.08390.34030.5834
730.0604-0.03460.002938.29473.19121.7864
740.0662-0.01680.00149.09850.75820.8707
750.069-0.03690.003146.87553.90631.9764
760.071-0.06890.0057176.662214.72193.8369
770.0747-0.07350.0061203.903916.9924.1221
780.0789-0.0670.0056167.799213.98333.7394
790.0809-0.08210.0068261.792821.81614.6708
800.0846-0.09480.0079346.018328.83495.3698

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
69 & 0.0226 & -0.0019 & 2e-04 & 0.1046 & 0.0087 & 0.0934 \tabularnewline
70 & 0.0374 & 0.0431 & 0.0036 & 54.9184 & 4.5765 & 2.1393 \tabularnewline
71 & 0.0475 & 0.0134 & 0.0011 & 5.3529 & 0.4461 & 0.6679 \tabularnewline
72 & 0.055 & -0.0116 & 0.001 & 4.0839 & 0.3403 & 0.5834 \tabularnewline
73 & 0.0604 & -0.0346 & 0.0029 & 38.2947 & 3.1912 & 1.7864 \tabularnewline
74 & 0.0662 & -0.0168 & 0.0014 & 9.0985 & 0.7582 & 0.8707 \tabularnewline
75 & 0.069 & -0.0369 & 0.0031 & 46.8755 & 3.9063 & 1.9764 \tabularnewline
76 & 0.071 & -0.0689 & 0.0057 & 176.6622 & 14.7219 & 3.8369 \tabularnewline
77 & 0.0747 & -0.0735 & 0.0061 & 203.9039 & 16.992 & 4.1221 \tabularnewline
78 & 0.0789 & -0.067 & 0.0056 & 167.7992 & 13.9833 & 3.7394 \tabularnewline
79 & 0.0809 & -0.0821 & 0.0068 & 261.7928 & 21.8161 & 4.6708 \tabularnewline
80 & 0.0846 & -0.0948 & 0.0079 & 346.0183 & 28.8349 & 5.3698 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2568&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.0226[/C][C]-0.0019[/C][C]2e-04[/C][C]0.1046[/C][C]0.0087[/C][C]0.0934[/C][/ROW]
[ROW][C]70[/C][C]0.0374[/C][C]0.0431[/C][C]0.0036[/C][C]54.9184[/C][C]4.5765[/C][C]2.1393[/C][/ROW]
[ROW][C]71[/C][C]0.0475[/C][C]0.0134[/C][C]0.0011[/C][C]5.3529[/C][C]0.4461[/C][C]0.6679[/C][/ROW]
[ROW][C]72[/C][C]0.055[/C][C]-0.0116[/C][C]0.001[/C][C]4.0839[/C][C]0.3403[/C][C]0.5834[/C][/ROW]
[ROW][C]73[/C][C]0.0604[/C][C]-0.0346[/C][C]0.0029[/C][C]38.2947[/C][C]3.1912[/C][C]1.7864[/C][/ROW]
[ROW][C]74[/C][C]0.0662[/C][C]-0.0168[/C][C]0.0014[/C][C]9.0985[/C][C]0.7582[/C][C]0.8707[/C][/ROW]
[ROW][C]75[/C][C]0.069[/C][C]-0.0369[/C][C]0.0031[/C][C]46.8755[/C][C]3.9063[/C][C]1.9764[/C][/ROW]
[ROW][C]76[/C][C]0.071[/C][C]-0.0689[/C][C]0.0057[/C][C]176.6622[/C][C]14.7219[/C][C]3.8369[/C][/ROW]
[ROW][C]77[/C][C]0.0747[/C][C]-0.0735[/C][C]0.0061[/C][C]203.9039[/C][C]16.992[/C][C]4.1221[/C][/ROW]
[ROW][C]78[/C][C]0.0789[/C][C]-0.067[/C][C]0.0056[/C][C]167.7992[/C][C]13.9833[/C][C]3.7394[/C][/ROW]
[ROW][C]79[/C][C]0.0809[/C][C]-0.0821[/C][C]0.0068[/C][C]261.7928[/C][C]21.8161[/C][C]4.6708[/C][/ROW]
[ROW][C]80[/C][C]0.0846[/C][C]-0.0948[/C][C]0.0079[/C][C]346.0183[/C][C]28.8349[/C][C]5.3698[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2568&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2568&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.0226-0.00192e-040.10460.00870.0934
700.03740.04310.003654.91844.57652.1393
710.04750.01340.00115.35290.44610.6679
720.055-0.01160.0014.08390.34030.5834
730.0604-0.03460.002938.29473.19121.7864
740.0662-0.01680.00149.09850.75820.8707
750.069-0.03690.003146.87553.90631.9764
760.071-0.06890.0057176.662214.72193.8369
770.0747-0.07350.0061203.903916.9924.1221
780.0789-0.0670.0056167.799213.98333.7394
790.0809-0.08210.0068261.792821.81614.6708
800.0846-0.09480.0079346.018328.83495.3698



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