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 computationMon, 21 Dec 2009 14:37:13 -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/2009/Dec/21/t12614314679zp20dewcp96t4u.htm/, Retrieved Sun, 05 May 2024 09:07:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70401, Retrieved Sun, 05 May 2024 09:07:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact95
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Data Series] [Bivariate dataset] [2008-01-05 23:51:08] [74be16979710d4c4e7c6647856088456]
F RMPD  [Univariate Explorative Data Analysis] [Colombia Coffee] [2008-01-07 14:21:11] [74be16979710d4c4e7c6647856088456]
F RMPD    [Univariate Data Series] [] [2009-10-14 08:30:28] [74be16979710d4c4e7c6647856088456]
- RMPD        [ARIMA Forecasting] [Paper] [2009-12-21 21:37:13] [e339dd08bcbfc073ac7494f09a949034] [Current]
Feedback Forum

Post a new message
Dataseries X:
17,7
17,1
16,4
16
15,6
14,9
13,7
12,8
11,9
11,6
13,9
16,5
16,8
16,4
15,6
15,1
14,7
14,1
13,2
12,3
11,6
11,2
13,3
15,8
16,3
16,1
15,6
15,2
15
14,4
13,5
12,8
12,3
12,2
14,5
17,2
18
18,1
18
18,3
18,7
18,6
18,3
17,9
17,4
17,4
20,1
23,2
24,2
24,2
23,9
23,8
23,8
23,3
22,4
21,5
20,5
19,9
22
24,9
25,7
25,3
24,4
23,8
23,5
23
22,2
21,4
20,3
19,5
21,7
24,7
25,3
24,9
24,1
23,4
23,1
22,4
21,3
20,3
19,3
18,7
21
24
24,8
24,2
23,3
22,7
22,3
21,8
21,2
20,5
19,7
19,2
21,2
23,9
24,8
24,2
23
22,2
21,8
21,2
20,5
19,7
19
18,4
20,7
24,5
26
25,2
24,1
23,7
23,5
23,1
22,7
22,5
21,7
20,5
21,9
22,9
21,5
19
17
16,1
15,9
15,7
15,1
14,8
14,3
14,5
18,9
21,6
20,4
17,9
15,7
14,5
14
13,9
14,4
15,8
15,6
14,7
16,7
17,9
18,7
20,1
19,5
19,4
18,6
17,8
17,1
16,5
15,5
14,9
18,6
19,1
18,8
18,2
18
19
20,7
21,2
20,7
19,6
18,6
18,7
23,8
24,9
24,8
23,8
22,3
21,7
20,7
19,7
18,4
17,4
17
18
23,8
25,5
25,6
23,7
22
21,3
20,7
20,4
20,3
20,4
19,8
19,5
23,1
23,5
23,5
22,9
21,9
21,5
20,5
20,2
19,4
19,2
18,8
18,8
22,6
23,3
23
21,4
19,9
18,8
18,6
18,4
18,6
19,9
19,2
18,4
21,1
20,5
19,1
18,1
17
17,1
17,4
16,8
15,3
14,3
13,4
15,3
22,1
23,7
22,2
19,5
16,6
17,3
19,8
21,2
21,5
20,6
19,1
19,6
23,5
24




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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70401&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 time3 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[228])
21620.5-------
21719.1-------
21818.1-------
21917-------
22017.1-------
22117.4-------
22216.8-------
22315.3-------
22414.3-------
22513.4-------
22615.3-------
22722.1-------
22823.7-------
22922.222.597821.492223.70350.24030.025410.0254
23019.520.104817.751222.45840.30730.04050.95250.0014
23116.617.469313.978820.95980.31270.12710.60392e-04
23217.316.358812.056720.66090.3340.45630.36784e-04
23319.816.467711.66521.27030.08690.3670.35180.0016
23421.216.493911.385621.60210.03550.10230.45320.0028
23521.516.160210.826721.49380.02490.0320.6240.0028
23620.616.314510.759821.86910.06520.03360.76140.0046
23719.115.52369.712521.33460.11390.04340.76310.0029
23819.616.302710.195422.410.1450.18470.62620.0088
23923.521.442515.02227.86310.2650.71310.42050.2454
2402422.128215.405428.8510.29260.34460.32340.3234

\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[228]) \tabularnewline
216 & 20.5 & - & - & - & - & - & - & - \tabularnewline
217 & 19.1 & - & - & - & - & - & - & - \tabularnewline
218 & 18.1 & - & - & - & - & - & - & - \tabularnewline
219 & 17 & - & - & - & - & - & - & - \tabularnewline
220 & 17.1 & - & - & - & - & - & - & - \tabularnewline
221 & 17.4 & - & - & - & - & - & - & - \tabularnewline
222 & 16.8 & - & - & - & - & - & - & - \tabularnewline
223 & 15.3 & - & - & - & - & - & - & - \tabularnewline
224 & 14.3 & - & - & - & - & - & - & - \tabularnewline
225 & 13.4 & - & - & - & - & - & - & - \tabularnewline
226 & 15.3 & - & - & - & - & - & - & - \tabularnewline
227 & 22.1 & - & - & - & - & - & - & - \tabularnewline
228 & 23.7 & - & - & - & - & - & - & - \tabularnewline
229 & 22.2 & 22.5978 & 21.4922 & 23.7035 & 0.2403 & 0.0254 & 1 & 0.0254 \tabularnewline
230 & 19.5 & 20.1048 & 17.7512 & 22.4584 & 0.3073 & 0.0405 & 0.9525 & 0.0014 \tabularnewline
231 & 16.6 & 17.4693 & 13.9788 & 20.9598 & 0.3127 & 0.1271 & 0.6039 & 2e-04 \tabularnewline
232 & 17.3 & 16.3588 & 12.0567 & 20.6609 & 0.334 & 0.4563 & 0.3678 & 4e-04 \tabularnewline
233 & 19.8 & 16.4677 & 11.665 & 21.2703 & 0.0869 & 0.367 & 0.3518 & 0.0016 \tabularnewline
234 & 21.2 & 16.4939 & 11.3856 & 21.6021 & 0.0355 & 0.1023 & 0.4532 & 0.0028 \tabularnewline
235 & 21.5 & 16.1602 & 10.8267 & 21.4938 & 0.0249 & 0.032 & 0.624 & 0.0028 \tabularnewline
236 & 20.6 & 16.3145 & 10.7598 & 21.8691 & 0.0652 & 0.0336 & 0.7614 & 0.0046 \tabularnewline
237 & 19.1 & 15.5236 & 9.7125 & 21.3346 & 0.1139 & 0.0434 & 0.7631 & 0.0029 \tabularnewline
238 & 19.6 & 16.3027 & 10.1954 & 22.41 & 0.145 & 0.1847 & 0.6262 & 0.0088 \tabularnewline
239 & 23.5 & 21.4425 & 15.022 & 27.8631 & 0.265 & 0.7131 & 0.4205 & 0.2454 \tabularnewline
240 & 24 & 22.1282 & 15.4054 & 28.851 & 0.2926 & 0.3446 & 0.3234 & 0.3234 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70401&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[228])[/C][/ROW]
[ROW][C]216[/C][C]20.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]217[/C][C]19.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]218[/C][C]18.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]219[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]220[/C][C]17.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]221[/C][C]17.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]222[/C][C]16.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]223[/C][C]15.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]224[/C][C]14.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]225[/C][C]13.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]226[/C][C]15.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]227[/C][C]22.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]228[/C][C]23.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]229[/C][C]22.2[/C][C]22.5978[/C][C]21.4922[/C][C]23.7035[/C][C]0.2403[/C][C]0.0254[/C][C]1[/C][C]0.0254[/C][/ROW]
[ROW][C]230[/C][C]19.5[/C][C]20.1048[/C][C]17.7512[/C][C]22.4584[/C][C]0.3073[/C][C]0.0405[/C][C]0.9525[/C][C]0.0014[/C][/ROW]
[ROW][C]231[/C][C]16.6[/C][C]17.4693[/C][C]13.9788[/C][C]20.9598[/C][C]0.3127[/C][C]0.1271[/C][C]0.6039[/C][C]2e-04[/C][/ROW]
[ROW][C]232[/C][C]17.3[/C][C]16.3588[/C][C]12.0567[/C][C]20.6609[/C][C]0.334[/C][C]0.4563[/C][C]0.3678[/C][C]4e-04[/C][/ROW]
[ROW][C]233[/C][C]19.8[/C][C]16.4677[/C][C]11.665[/C][C]21.2703[/C][C]0.0869[/C][C]0.367[/C][C]0.3518[/C][C]0.0016[/C][/ROW]
[ROW][C]234[/C][C]21.2[/C][C]16.4939[/C][C]11.3856[/C][C]21.6021[/C][C]0.0355[/C][C]0.1023[/C][C]0.4532[/C][C]0.0028[/C][/ROW]
[ROW][C]235[/C][C]21.5[/C][C]16.1602[/C][C]10.8267[/C][C]21.4938[/C][C]0.0249[/C][C]0.032[/C][C]0.624[/C][C]0.0028[/C][/ROW]
[ROW][C]236[/C][C]20.6[/C][C]16.3145[/C][C]10.7598[/C][C]21.8691[/C][C]0.0652[/C][C]0.0336[/C][C]0.7614[/C][C]0.0046[/C][/ROW]
[ROW][C]237[/C][C]19.1[/C][C]15.5236[/C][C]9.7125[/C][C]21.3346[/C][C]0.1139[/C][C]0.0434[/C][C]0.7631[/C][C]0.0029[/C][/ROW]
[ROW][C]238[/C][C]19.6[/C][C]16.3027[/C][C]10.1954[/C][C]22.41[/C][C]0.145[/C][C]0.1847[/C][C]0.6262[/C][C]0.0088[/C][/ROW]
[ROW][C]239[/C][C]23.5[/C][C]21.4425[/C][C]15.022[/C][C]27.8631[/C][C]0.265[/C][C]0.7131[/C][C]0.4205[/C][C]0.2454[/C][/ROW]
[ROW][C]240[/C][C]24[/C][C]22.1282[/C][C]15.4054[/C][C]28.851[/C][C]0.2926[/C][C]0.3446[/C][C]0.3234[/C][C]0.3234[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70401&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70401&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[228])
21620.5-------
21719.1-------
21818.1-------
21917-------
22017.1-------
22117.4-------
22216.8-------
22315.3-------
22414.3-------
22513.4-------
22615.3-------
22722.1-------
22823.7-------
22922.222.597821.492223.70350.24030.025410.0254
23019.520.104817.751222.45840.30730.04050.95250.0014
23116.617.469313.978820.95980.31270.12710.60392e-04
23217.316.358812.056720.66090.3340.45630.36784e-04
23319.816.467711.66521.27030.08690.3670.35180.0016
23421.216.493911.385621.60210.03550.10230.45320.0028
23521.516.160210.826721.49380.02490.0320.6240.0028
23620.616.314510.759821.86910.06520.03360.76140.0046
23719.115.52369.712521.33460.11390.04340.76310.0029
23819.616.302710.195422.410.1450.18470.62620.0088
23923.521.442515.02227.86310.2650.71310.42050.2454
2402422.128215.405428.8510.29260.34460.32340.3234







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
2290.025-0.017600.158300
2300.0597-0.03010.02380.36580.2620.5119
2310.1019-0.04980.03250.75570.42660.6531
2320.13420.05750.03870.88580.54140.7358
2330.14880.20240.071511.10452.6541.6291
2340.1580.28530.107122.14765.90292.4296
2350.16840.33040.13928.5139.13293.0221
2360.17370.26270.154518.365710.2873.2073
2370.1910.23040.162912.790910.56523.2504
2380.19110.20230.166810.872210.59593.2551
2390.15280.0960.16044.233210.01753.165
2400.1550.08460.15413.50369.47473.0781

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
229 & 0.025 & -0.0176 & 0 & 0.1583 & 0 & 0 \tabularnewline
230 & 0.0597 & -0.0301 & 0.0238 & 0.3658 & 0.262 & 0.5119 \tabularnewline
231 & 0.1019 & -0.0498 & 0.0325 & 0.7557 & 0.4266 & 0.6531 \tabularnewline
232 & 0.1342 & 0.0575 & 0.0387 & 0.8858 & 0.5414 & 0.7358 \tabularnewline
233 & 0.1488 & 0.2024 & 0.0715 & 11.1045 & 2.654 & 1.6291 \tabularnewline
234 & 0.158 & 0.2853 & 0.1071 & 22.1476 & 5.9029 & 2.4296 \tabularnewline
235 & 0.1684 & 0.3304 & 0.139 & 28.513 & 9.1329 & 3.0221 \tabularnewline
236 & 0.1737 & 0.2627 & 0.1545 & 18.3657 & 10.287 & 3.2073 \tabularnewline
237 & 0.191 & 0.2304 & 0.1629 & 12.7909 & 10.5652 & 3.2504 \tabularnewline
238 & 0.1911 & 0.2023 & 0.1668 & 10.8722 & 10.5959 & 3.2551 \tabularnewline
239 & 0.1528 & 0.096 & 0.1604 & 4.2332 & 10.0175 & 3.165 \tabularnewline
240 & 0.155 & 0.0846 & 0.1541 & 3.5036 & 9.4747 & 3.0781 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70401&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]229[/C][C]0.025[/C][C]-0.0176[/C][C]0[/C][C]0.1583[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]230[/C][C]0.0597[/C][C]-0.0301[/C][C]0.0238[/C][C]0.3658[/C][C]0.262[/C][C]0.5119[/C][/ROW]
[ROW][C]231[/C][C]0.1019[/C][C]-0.0498[/C][C]0.0325[/C][C]0.7557[/C][C]0.4266[/C][C]0.6531[/C][/ROW]
[ROW][C]232[/C][C]0.1342[/C][C]0.0575[/C][C]0.0387[/C][C]0.8858[/C][C]0.5414[/C][C]0.7358[/C][/ROW]
[ROW][C]233[/C][C]0.1488[/C][C]0.2024[/C][C]0.0715[/C][C]11.1045[/C][C]2.654[/C][C]1.6291[/C][/ROW]
[ROW][C]234[/C][C]0.158[/C][C]0.2853[/C][C]0.1071[/C][C]22.1476[/C][C]5.9029[/C][C]2.4296[/C][/ROW]
[ROW][C]235[/C][C]0.1684[/C][C]0.3304[/C][C]0.139[/C][C]28.513[/C][C]9.1329[/C][C]3.0221[/C][/ROW]
[ROW][C]236[/C][C]0.1737[/C][C]0.2627[/C][C]0.1545[/C][C]18.3657[/C][C]10.287[/C][C]3.2073[/C][/ROW]
[ROW][C]237[/C][C]0.191[/C][C]0.2304[/C][C]0.1629[/C][C]12.7909[/C][C]10.5652[/C][C]3.2504[/C][/ROW]
[ROW][C]238[/C][C]0.1911[/C][C]0.2023[/C][C]0.1668[/C][C]10.8722[/C][C]10.5959[/C][C]3.2551[/C][/ROW]
[ROW][C]239[/C][C]0.1528[/C][C]0.096[/C][C]0.1604[/C][C]4.2332[/C][C]10.0175[/C][C]3.165[/C][/ROW]
[ROW][C]240[/C][C]0.155[/C][C]0.0846[/C][C]0.1541[/C][C]3.5036[/C][C]9.4747[/C][C]3.0781[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70401&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70401&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
2290.025-0.017600.158300
2300.0597-0.03010.02380.36580.2620.5119
2310.1019-0.04980.03250.75570.42660.6531
2320.13420.05750.03870.88580.54140.7358
2330.14880.20240.071511.10452.6541.6291
2340.1580.28530.107122.14765.90292.4296
2350.16840.33040.13928.5139.13293.0221
2360.17370.26270.154518.365710.2873.2073
2370.1910.23040.162912.790910.56523.2504
2380.19110.20230.166810.872210.59593.2551
2390.15280.0960.16044.233210.01753.165
2400.1550.08460.15413.50369.47473.0781



Parameters (Session):
par1 = 1 ; par2 = 2 ; par3 = 1 ; par4 = 1 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 2 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; 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,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')