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 computationWed, 29 Dec 2010 18:35:13 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/29/t1293647616nspsyl3d2aks4re.htm/, Retrieved Fri, 03 May 2024 15:01:02 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=117024, Retrieved Fri, 03 May 2024 15:01:02 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords3.5 - Forecasting ARIMA model
Estimated Impact111
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2010-12-27 13:19:43] [8e0d27d3447b6ae48398467ddbde7cca]
- R       [ARIMA Forecasting] [paper blog 11] [2010-12-29 18:35:13] [e88a7df0ec81b188ca860df63016b196] [Current]
Feedback Forum

Post a new message
Dataseries X:
8.3
8.2
8.1
8
8.1
8.1
8
7.8
7.7
7.7
7.7
7.6
7.5
7.3
7.2
7.1
7.2
7.2
7.2
6.9
6.8
6.8
6.8
6.9
7
7.2
7.2
7.2
7
7
7.2
7.4
7.8
8
7.8
7.8
7.9
7.9
8
8
8
8
8.2
8.4
8.6
8.6
8.5
8.5
8.4
8.4
8.4
8.5
8.6
8.6
8.6
8.6
8.6
8.5
8.4
8.4
8.3
8.3
8.3
8.6
8.8
8.8
8.5
8.1
7.9
8
8.4
8.5
8.5
8.4
8.3
8.3
8.2
8.1
8.1
8.2
8.2
8.2
8.1
8.1
8
7.8
7.7
7.7
7.7
7.7
7.7
7.5
7.4
7.3
7.4
7.4
7.3
7.3
7.1
7
6.5
6.3
6.3
6.5
6.6
6.5
6.3
6.3
6.3
6.5
6.7
6.7
6.7
6.8
6.7
6.8
6.8
7
7
7.2
7.4
7.6
7.8
7.9
8.1
8.3
8.5
8.7
8.8
8.9
9
9
9.1
9.1
9.1
9.2
9.4
9.4
9.3
9.4
9.4
9.5
9.5
9.4
9.4
9.4
9.3
9.3
9.3
9.3
9.3
9.2
9.1
9.1
9.1
9.1
9.2
9.2
9.2
9.3
9.4
9.4
9.5
9.6
9.7
9.7
9.8
9.9
9.9
9.9
9.8
9.8
9.7
9.7
9.6
9.6
9.6
9.6
9.6
9.7
9.7
9.7
9.7
9.8
9.8
9.8
9.8
9.9
9.9
9.8
9.7
9.6
9.6
9.5
9.3
9.2
9
8.9
8.7
8.5
8.4
8.2
8.1
7.9
7.8
7.6
7.5
7.4
7.2
7.2
7.1
7
7
6.9
6.8
6.7
6.7
6.6
6.6
6.5
6.5
6.4
6.4
6.4
6.4
6.3
6.4
6.4
6.4
6.4
6.4
6.4
6.4
6.5
6.5
6.6
6.6
6.6
6.7
6.7
6.8




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Herman Ole Andreas Wold' @ www.yougetit.org

\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 & 4 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ www.yougetit.org \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117024&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]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ www.yougetit.org[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117024&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117024&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 time4 seconds
R Server'Herman Ole Andreas Wold' @ www.yougetit.org







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[229])
2176.7-------
2186.6-------
2196.6-------
2206.5-------
2216.5-------
2226.4-------
2236.4-------
2246.4-------
2256.4-------
2266.3-------
2276.4-------
2286.4-------
2296.4-------
2306.46.36886.17536.56220.37580.37580.00960.3758
2316.46.36686.02256.71110.4250.4250.09210.425
2326.46.32435.83596.81270.38070.38070.24040.3807
2336.46.34765.7556.94030.43130.43130.30720.4313
2346.56.32695.64317.01080.30990.41710.41710.4171
2356.56.33915.56537.11290.34180.34180.43870.4387
2366.66.32225.44597.19840.26710.34540.43090.4309
2376.66.2925.30127.28270.27110.27110.41540.4154
2386.66.29365.18027.40710.29480.29480.49550.4257
2396.76.28855.04977.52730.25750.31110.430.43
2406.76.28844.92297.65390.27730.27730.43640.4364
2416.86.25834.76417.75260.23870.28120.42630.4263

\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[229]) \tabularnewline
217 & 6.7 & - & - & - & - & - & - & - \tabularnewline
218 & 6.6 & - & - & - & - & - & - & - \tabularnewline
219 & 6.6 & - & - & - & - & - & - & - \tabularnewline
220 & 6.5 & - & - & - & - & - & - & - \tabularnewline
221 & 6.5 & - & - & - & - & - & - & - \tabularnewline
222 & 6.4 & - & - & - & - & - & - & - \tabularnewline
223 & 6.4 & - & - & - & - & - & - & - \tabularnewline
224 & 6.4 & - & - & - & - & - & - & - \tabularnewline
225 & 6.4 & - & - & - & - & - & - & - \tabularnewline
226 & 6.3 & - & - & - & - & - & - & - \tabularnewline
227 & 6.4 & - & - & - & - & - & - & - \tabularnewline
228 & 6.4 & - & - & - & - & - & - & - \tabularnewline
229 & 6.4 & - & - & - & - & - & - & - \tabularnewline
230 & 6.4 & 6.3688 & 6.1753 & 6.5622 & 0.3758 & 0.3758 & 0.0096 & 0.3758 \tabularnewline
231 & 6.4 & 6.3668 & 6.0225 & 6.7111 & 0.425 & 0.425 & 0.0921 & 0.425 \tabularnewline
232 & 6.4 & 6.3243 & 5.8359 & 6.8127 & 0.3807 & 0.3807 & 0.2404 & 0.3807 \tabularnewline
233 & 6.4 & 6.3476 & 5.755 & 6.9403 & 0.4313 & 0.4313 & 0.3072 & 0.4313 \tabularnewline
234 & 6.5 & 6.3269 & 5.6431 & 7.0108 & 0.3099 & 0.4171 & 0.4171 & 0.4171 \tabularnewline
235 & 6.5 & 6.3391 & 5.5653 & 7.1129 & 0.3418 & 0.3418 & 0.4387 & 0.4387 \tabularnewline
236 & 6.6 & 6.3222 & 5.4459 & 7.1984 & 0.2671 & 0.3454 & 0.4309 & 0.4309 \tabularnewline
237 & 6.6 & 6.292 & 5.3012 & 7.2827 & 0.2711 & 0.2711 & 0.4154 & 0.4154 \tabularnewline
238 & 6.6 & 6.2936 & 5.1802 & 7.4071 & 0.2948 & 0.2948 & 0.4955 & 0.4257 \tabularnewline
239 & 6.7 & 6.2885 & 5.0497 & 7.5273 & 0.2575 & 0.3111 & 0.43 & 0.43 \tabularnewline
240 & 6.7 & 6.2884 & 4.9229 & 7.6539 & 0.2773 & 0.2773 & 0.4364 & 0.4364 \tabularnewline
241 & 6.8 & 6.2583 & 4.7641 & 7.7526 & 0.2387 & 0.2812 & 0.4263 & 0.4263 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117024&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[229])[/C][/ROW]
[ROW][C]217[/C][C]6.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]218[/C][C]6.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]219[/C][C]6.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]220[/C][C]6.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]221[/C][C]6.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]222[/C][C]6.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]223[/C][C]6.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]224[/C][C]6.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]225[/C][C]6.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]226[/C][C]6.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]227[/C][C]6.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]228[/C][C]6.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]229[/C][C]6.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]230[/C][C]6.4[/C][C]6.3688[/C][C]6.1753[/C][C]6.5622[/C][C]0.3758[/C][C]0.3758[/C][C]0.0096[/C][C]0.3758[/C][/ROW]
[ROW][C]231[/C][C]6.4[/C][C]6.3668[/C][C]6.0225[/C][C]6.7111[/C][C]0.425[/C][C]0.425[/C][C]0.0921[/C][C]0.425[/C][/ROW]
[ROW][C]232[/C][C]6.4[/C][C]6.3243[/C][C]5.8359[/C][C]6.8127[/C][C]0.3807[/C][C]0.3807[/C][C]0.2404[/C][C]0.3807[/C][/ROW]
[ROW][C]233[/C][C]6.4[/C][C]6.3476[/C][C]5.755[/C][C]6.9403[/C][C]0.4313[/C][C]0.4313[/C][C]0.3072[/C][C]0.4313[/C][/ROW]
[ROW][C]234[/C][C]6.5[/C][C]6.3269[/C][C]5.6431[/C][C]7.0108[/C][C]0.3099[/C][C]0.4171[/C][C]0.4171[/C][C]0.4171[/C][/ROW]
[ROW][C]235[/C][C]6.5[/C][C]6.3391[/C][C]5.5653[/C][C]7.1129[/C][C]0.3418[/C][C]0.3418[/C][C]0.4387[/C][C]0.4387[/C][/ROW]
[ROW][C]236[/C][C]6.6[/C][C]6.3222[/C][C]5.4459[/C][C]7.1984[/C][C]0.2671[/C][C]0.3454[/C][C]0.4309[/C][C]0.4309[/C][/ROW]
[ROW][C]237[/C][C]6.6[/C][C]6.292[/C][C]5.3012[/C][C]7.2827[/C][C]0.2711[/C][C]0.2711[/C][C]0.4154[/C][C]0.4154[/C][/ROW]
[ROW][C]238[/C][C]6.6[/C][C]6.2936[/C][C]5.1802[/C][C]7.4071[/C][C]0.2948[/C][C]0.2948[/C][C]0.4955[/C][C]0.4257[/C][/ROW]
[ROW][C]239[/C][C]6.7[/C][C]6.2885[/C][C]5.0497[/C][C]7.5273[/C][C]0.2575[/C][C]0.3111[/C][C]0.43[/C][C]0.43[/C][/ROW]
[ROW][C]240[/C][C]6.7[/C][C]6.2884[/C][C]4.9229[/C][C]7.6539[/C][C]0.2773[/C][C]0.2773[/C][C]0.4364[/C][C]0.4364[/C][/ROW]
[ROW][C]241[/C][C]6.8[/C][C]6.2583[/C][C]4.7641[/C][C]7.7526[/C][C]0.2387[/C][C]0.2812[/C][C]0.4263[/C][C]0.4263[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117024&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117024&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[229])
2176.7-------
2186.6-------
2196.6-------
2206.5-------
2216.5-------
2226.4-------
2236.4-------
2246.4-------
2256.4-------
2266.3-------
2276.4-------
2286.4-------
2296.4-------
2306.46.36886.17536.56220.37580.37580.00960.3758
2316.46.36686.02256.71110.4250.4250.09210.425
2326.46.32435.83596.81270.38070.38070.24040.3807
2336.46.34765.7556.94030.43130.43130.30720.4313
2346.56.32695.64317.01080.30990.41710.41710.4171
2356.56.33915.56537.11290.34180.34180.43870.4387
2366.66.32225.44597.19840.26710.34540.43090.4309
2376.66.2925.30127.28270.27110.27110.41540.4154
2386.66.29365.18027.40710.29480.29480.49550.4257
2396.76.28855.04977.52730.25750.31110.430.43
2406.76.28844.92297.65390.27730.27730.43640.4364
2416.86.25834.76417.75260.23870.28120.42630.4263







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
2300.01550.004900.00100
2310.02760.00520.00510.00110.0010.0323
2320.03940.0120.00740.00570.00260.051
2330.04760.00820.00760.00270.00260.0514
2340.05510.02740.01150.02990.00810.09
2350.06230.02540.01380.02590.01110.1052
2360.07070.04390.01810.07720.02050.1432
2370.08030.0490.0220.09490.02980.1727
2380.09030.04870.0250.09390.03690.1922
2390.10050.06540.0290.16930.05020.224
2400.11080.06550.03230.16940.0610.247
2410.12180.08650.03680.29340.08040.2835

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
230 & 0.0155 & 0.0049 & 0 & 0.001 & 0 & 0 \tabularnewline
231 & 0.0276 & 0.0052 & 0.0051 & 0.0011 & 0.001 & 0.0323 \tabularnewline
232 & 0.0394 & 0.012 & 0.0074 & 0.0057 & 0.0026 & 0.051 \tabularnewline
233 & 0.0476 & 0.0082 & 0.0076 & 0.0027 & 0.0026 & 0.0514 \tabularnewline
234 & 0.0551 & 0.0274 & 0.0115 & 0.0299 & 0.0081 & 0.09 \tabularnewline
235 & 0.0623 & 0.0254 & 0.0138 & 0.0259 & 0.0111 & 0.1052 \tabularnewline
236 & 0.0707 & 0.0439 & 0.0181 & 0.0772 & 0.0205 & 0.1432 \tabularnewline
237 & 0.0803 & 0.049 & 0.022 & 0.0949 & 0.0298 & 0.1727 \tabularnewline
238 & 0.0903 & 0.0487 & 0.025 & 0.0939 & 0.0369 & 0.1922 \tabularnewline
239 & 0.1005 & 0.0654 & 0.029 & 0.1693 & 0.0502 & 0.224 \tabularnewline
240 & 0.1108 & 0.0655 & 0.0323 & 0.1694 & 0.061 & 0.247 \tabularnewline
241 & 0.1218 & 0.0865 & 0.0368 & 0.2934 & 0.0804 & 0.2835 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117024&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]230[/C][C]0.0155[/C][C]0.0049[/C][C]0[/C][C]0.001[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]231[/C][C]0.0276[/C][C]0.0052[/C][C]0.0051[/C][C]0.0011[/C][C]0.001[/C][C]0.0323[/C][/ROW]
[ROW][C]232[/C][C]0.0394[/C][C]0.012[/C][C]0.0074[/C][C]0.0057[/C][C]0.0026[/C][C]0.051[/C][/ROW]
[ROW][C]233[/C][C]0.0476[/C][C]0.0082[/C][C]0.0076[/C][C]0.0027[/C][C]0.0026[/C][C]0.0514[/C][/ROW]
[ROW][C]234[/C][C]0.0551[/C][C]0.0274[/C][C]0.0115[/C][C]0.0299[/C][C]0.0081[/C][C]0.09[/C][/ROW]
[ROW][C]235[/C][C]0.0623[/C][C]0.0254[/C][C]0.0138[/C][C]0.0259[/C][C]0.0111[/C][C]0.1052[/C][/ROW]
[ROW][C]236[/C][C]0.0707[/C][C]0.0439[/C][C]0.0181[/C][C]0.0772[/C][C]0.0205[/C][C]0.1432[/C][/ROW]
[ROW][C]237[/C][C]0.0803[/C][C]0.049[/C][C]0.022[/C][C]0.0949[/C][C]0.0298[/C][C]0.1727[/C][/ROW]
[ROW][C]238[/C][C]0.0903[/C][C]0.0487[/C][C]0.025[/C][C]0.0939[/C][C]0.0369[/C][C]0.1922[/C][/ROW]
[ROW][C]239[/C][C]0.1005[/C][C]0.0654[/C][C]0.029[/C][C]0.1693[/C][C]0.0502[/C][C]0.224[/C][/ROW]
[ROW][C]240[/C][C]0.1108[/C][C]0.0655[/C][C]0.0323[/C][C]0.1694[/C][C]0.061[/C][C]0.247[/C][/ROW]
[ROW][C]241[/C][C]0.1218[/C][C]0.0865[/C][C]0.0368[/C][C]0.2934[/C][C]0.0804[/C][C]0.2835[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117024&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117024&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
2300.01550.004900.00100
2310.02760.00520.00510.00110.0010.0323
2320.03940.0120.00740.00570.00260.051
2330.04760.00820.00760.00270.00260.0514
2340.05510.02740.01150.02990.00810.09
2350.06230.02540.01380.02590.01110.1052
2360.07070.04390.01810.07720.02050.1432
2370.08030.0490.0220.09490.02980.1727
2380.09030.04870.0250.09390.03690.1922
2390.10050.06540.0290.16930.05020.224
2400.11080.06550.03230.16940.0610.247
2410.12180.08650.03680.29340.08040.2835



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 2 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 2 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; 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
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.mape <- array(0, dim=fx)
perf.mape1 <- 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)
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.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.mse[1] = abs(perf.se[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.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[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',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.mape1[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.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')