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 computationFri, 04 Dec 2009 15:28:42 -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/04/t1259965761pwy9fphhkoxqavu.htm/, Retrieved Sun, 28 Apr 2024 07:01:36 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=64190, Retrieved Sun, 28 Apr 2024 07:01:36 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact130
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ws 10] [2009-12-04 22:28:42] [2e4ef2c1b76db9b31c0a03b96e94ad77] [Current]
-   PD    [ARIMA Forecasting] [workshop 10 berek...] [2009-12-10 20:00:36] [eaf42bcf5162b5692bb3c7f9d4636222]
-   PD      [ARIMA Forecasting] [workshop 10] [2009-12-11 12:07:20] [eaf42bcf5162b5692bb3c7f9d4636222]
- R PD    [ARIMA Forecasting] [Paper Voorspelling] [2010-12-21 16:33:54] [a9e130f95bad0a0597234e75c6380c5a]
- R PD      [ARIMA Forecasting] [] [2011-12-20 22:02:36] [06f5daa9a1979410bf169cb7a41fb3eb]
Feedback Forum

Post a new message
Dataseries X:
103,63
103,64
103,66
103,77
103,88
103,91
103,91
103,92
104,05
104,23
104,30
104,31
104,31
104,34
104,55
104,65
104,73
104,75
104,75
104,76
104,94
105,29
105,38
105,43
105,43
105,42
105,52
105,69
105,72
105,74
105,74
105,74
105,95
106,17
106,34
106,37
106,37
106,36
106,44
106,29
106,23
106,23
106,23
106,23
106,34
106,44
106,44
106,48
106,50
106,57
106,40
106,37
106,25
106,21
106,21
106,24
106,19
106,08
106,13
106,09




Summary of computational 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 computational 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=64190&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]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=64190&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64190&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 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[48])
36106.37-------
37106.37-------
38106.36-------
39106.44-------
40106.29-------
41106.23-------
42106.23-------
43106.23-------
44106.23-------
45106.34-------
46106.44-------
47106.44-------
48106.48-------
49106.5106.49106.3451106.63490.44630.55380.94770.5538
50106.57106.489106.2399106.73820.26210.46570.8450.5284
51106.4106.5302106.1942106.86630.22380.40830.70060.6152
52106.37106.4566106.0467106.86650.33940.60670.78720.4555
53106.25106.4272105.953106.90130.2320.59340.79250.4136
54106.21106.4273105.8959106.95860.21140.74340.76660.4229
55106.21106.4273105.8441107.01050.23260.76740.74640.4297
56106.24106.4273105.7965107.05820.28030.75020.73010.435
57106.19106.4818105.8066107.1570.19850.75860.65970.5021
58106.08106.5313105.8144107.24810.10860.82460.59850.5557
59106.13106.5313105.7751107.28740.14910.87890.59350.5529
60106.09106.5511105.7575107.34460.12740.85080.56970.5697

\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[48]) \tabularnewline
36 & 106.37 & - & - & - & - & - & - & - \tabularnewline
37 & 106.37 & - & - & - & - & - & - & - \tabularnewline
38 & 106.36 & - & - & - & - & - & - & - \tabularnewline
39 & 106.44 & - & - & - & - & - & - & - \tabularnewline
40 & 106.29 & - & - & - & - & - & - & - \tabularnewline
41 & 106.23 & - & - & - & - & - & - & - \tabularnewline
42 & 106.23 & - & - & - & - & - & - & - \tabularnewline
43 & 106.23 & - & - & - & - & - & - & - \tabularnewline
44 & 106.23 & - & - & - & - & - & - & - \tabularnewline
45 & 106.34 & - & - & - & - & - & - & - \tabularnewline
46 & 106.44 & - & - & - & - & - & - & - \tabularnewline
47 & 106.44 & - & - & - & - & - & - & - \tabularnewline
48 & 106.48 & - & - & - & - & - & - & - \tabularnewline
49 & 106.5 & 106.49 & 106.3451 & 106.6349 & 0.4463 & 0.5538 & 0.9477 & 0.5538 \tabularnewline
50 & 106.57 & 106.489 & 106.2399 & 106.7382 & 0.2621 & 0.4657 & 0.845 & 0.5284 \tabularnewline
51 & 106.4 & 106.5302 & 106.1942 & 106.8663 & 0.2238 & 0.4083 & 0.7006 & 0.6152 \tabularnewline
52 & 106.37 & 106.4566 & 106.0467 & 106.8665 & 0.3394 & 0.6067 & 0.7872 & 0.4555 \tabularnewline
53 & 106.25 & 106.4272 & 105.953 & 106.9013 & 0.232 & 0.5934 & 0.7925 & 0.4136 \tabularnewline
54 & 106.21 & 106.4273 & 105.8959 & 106.9586 & 0.2114 & 0.7434 & 0.7666 & 0.4229 \tabularnewline
55 & 106.21 & 106.4273 & 105.8441 & 107.0105 & 0.2326 & 0.7674 & 0.7464 & 0.4297 \tabularnewline
56 & 106.24 & 106.4273 & 105.7965 & 107.0582 & 0.2803 & 0.7502 & 0.7301 & 0.435 \tabularnewline
57 & 106.19 & 106.4818 & 105.8066 & 107.157 & 0.1985 & 0.7586 & 0.6597 & 0.5021 \tabularnewline
58 & 106.08 & 106.5313 & 105.8144 & 107.2481 & 0.1086 & 0.8246 & 0.5985 & 0.5557 \tabularnewline
59 & 106.13 & 106.5313 & 105.7751 & 107.2874 & 0.1491 & 0.8789 & 0.5935 & 0.5529 \tabularnewline
60 & 106.09 & 106.5511 & 105.7575 & 107.3446 & 0.1274 & 0.8508 & 0.5697 & 0.5697 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64190&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[48])[/C][/ROW]
[ROW][C]36[/C][C]106.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]106.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]106.36[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]106.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]106.29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]106.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]106.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]106.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]106.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]106.34[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]106.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]106.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]106.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]106.5[/C][C]106.49[/C][C]106.3451[/C][C]106.6349[/C][C]0.4463[/C][C]0.5538[/C][C]0.9477[/C][C]0.5538[/C][/ROW]
[ROW][C]50[/C][C]106.57[/C][C]106.489[/C][C]106.2399[/C][C]106.7382[/C][C]0.2621[/C][C]0.4657[/C][C]0.845[/C][C]0.5284[/C][/ROW]
[ROW][C]51[/C][C]106.4[/C][C]106.5302[/C][C]106.1942[/C][C]106.8663[/C][C]0.2238[/C][C]0.4083[/C][C]0.7006[/C][C]0.6152[/C][/ROW]
[ROW][C]52[/C][C]106.37[/C][C]106.4566[/C][C]106.0467[/C][C]106.8665[/C][C]0.3394[/C][C]0.6067[/C][C]0.7872[/C][C]0.4555[/C][/ROW]
[ROW][C]53[/C][C]106.25[/C][C]106.4272[/C][C]105.953[/C][C]106.9013[/C][C]0.232[/C][C]0.5934[/C][C]0.7925[/C][C]0.4136[/C][/ROW]
[ROW][C]54[/C][C]106.21[/C][C]106.4273[/C][C]105.8959[/C][C]106.9586[/C][C]0.2114[/C][C]0.7434[/C][C]0.7666[/C][C]0.4229[/C][/ROW]
[ROW][C]55[/C][C]106.21[/C][C]106.4273[/C][C]105.8441[/C][C]107.0105[/C][C]0.2326[/C][C]0.7674[/C][C]0.7464[/C][C]0.4297[/C][/ROW]
[ROW][C]56[/C][C]106.24[/C][C]106.4273[/C][C]105.7965[/C][C]107.0582[/C][C]0.2803[/C][C]0.7502[/C][C]0.7301[/C][C]0.435[/C][/ROW]
[ROW][C]57[/C][C]106.19[/C][C]106.4818[/C][C]105.8066[/C][C]107.157[/C][C]0.1985[/C][C]0.7586[/C][C]0.6597[/C][C]0.5021[/C][/ROW]
[ROW][C]58[/C][C]106.08[/C][C]106.5313[/C][C]105.8144[/C][C]107.2481[/C][C]0.1086[/C][C]0.8246[/C][C]0.5985[/C][C]0.5557[/C][/ROW]
[ROW][C]59[/C][C]106.13[/C][C]106.5313[/C][C]105.7751[/C][C]107.2874[/C][C]0.1491[/C][C]0.8789[/C][C]0.5935[/C][C]0.5529[/C][/ROW]
[ROW][C]60[/C][C]106.09[/C][C]106.5511[/C][C]105.7575[/C][C]107.3446[/C][C]0.1274[/C][C]0.8508[/C][C]0.5697[/C][C]0.5697[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64190&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64190&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[48])
36106.37-------
37106.37-------
38106.36-------
39106.44-------
40106.29-------
41106.23-------
42106.23-------
43106.23-------
44106.23-------
45106.34-------
46106.44-------
47106.44-------
48106.48-------
49106.5106.49106.3451106.63490.44630.55380.94770.5538
50106.57106.489106.2399106.73820.26210.46570.8450.5284
51106.4106.5302106.1942106.86630.22380.40830.70060.6152
52106.37106.4566106.0467106.86650.33940.60670.78720.4555
53106.25106.4272105.953106.90130.2320.59340.79250.4136
54106.21106.4273105.8959106.95860.21140.74340.76660.4229
55106.21106.4273105.8441107.01050.23260.76740.74640.4297
56106.24106.4273105.7965107.05820.28030.75020.73010.435
57106.19106.4818105.8066107.1570.19850.75860.65970.5021
58106.08106.5313105.8144107.24810.10860.82460.59850.5557
59106.13106.5313105.7751107.28740.14910.87890.59350.5529
60106.09106.5511105.7575107.34460.12740.85080.56970.5697







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
497e-041e-0401e-0400.0029
500.00128e-041e-040.00665e-040.0234
510.0016-0.00121e-040.0170.00140.0376
520.002-8e-041e-040.00756e-040.025
530.0023-0.00171e-040.03140.00260.0511
540.0025-0.0022e-040.04720.00390.0627
550.0028-0.0022e-040.04720.00390.0627
560.003-0.00181e-040.03510.00290.0541
570.0032-0.00272e-040.08510.00710.0842
580.0034-0.00424e-040.20360.0170.1303
590.0036-0.00383e-040.1610.01340.1158
600.0038-0.00434e-040.21260.01770.1331

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 7e-04 & 1e-04 & 0 & 1e-04 & 0 & 0.0029 \tabularnewline
50 & 0.0012 & 8e-04 & 1e-04 & 0.0066 & 5e-04 & 0.0234 \tabularnewline
51 & 0.0016 & -0.0012 & 1e-04 & 0.017 & 0.0014 & 0.0376 \tabularnewline
52 & 0.002 & -8e-04 & 1e-04 & 0.0075 & 6e-04 & 0.025 \tabularnewline
53 & 0.0023 & -0.0017 & 1e-04 & 0.0314 & 0.0026 & 0.0511 \tabularnewline
54 & 0.0025 & -0.002 & 2e-04 & 0.0472 & 0.0039 & 0.0627 \tabularnewline
55 & 0.0028 & -0.002 & 2e-04 & 0.0472 & 0.0039 & 0.0627 \tabularnewline
56 & 0.003 & -0.0018 & 1e-04 & 0.0351 & 0.0029 & 0.0541 \tabularnewline
57 & 0.0032 & -0.0027 & 2e-04 & 0.0851 & 0.0071 & 0.0842 \tabularnewline
58 & 0.0034 & -0.0042 & 4e-04 & 0.2036 & 0.017 & 0.1303 \tabularnewline
59 & 0.0036 & -0.0038 & 3e-04 & 0.161 & 0.0134 & 0.1158 \tabularnewline
60 & 0.0038 & -0.0043 & 4e-04 & 0.2126 & 0.0177 & 0.1331 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64190&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]49[/C][C]7e-04[/C][C]1e-04[/C][C]0[/C][C]1e-04[/C][C]0[/C][C]0.0029[/C][/ROW]
[ROW][C]50[/C][C]0.0012[/C][C]8e-04[/C][C]1e-04[/C][C]0.0066[/C][C]5e-04[/C][C]0.0234[/C][/ROW]
[ROW][C]51[/C][C]0.0016[/C][C]-0.0012[/C][C]1e-04[/C][C]0.017[/C][C]0.0014[/C][C]0.0376[/C][/ROW]
[ROW][C]52[/C][C]0.002[/C][C]-8e-04[/C][C]1e-04[/C][C]0.0075[/C][C]6e-04[/C][C]0.025[/C][/ROW]
[ROW][C]53[/C][C]0.0023[/C][C]-0.0017[/C][C]1e-04[/C][C]0.0314[/C][C]0.0026[/C][C]0.0511[/C][/ROW]
[ROW][C]54[/C][C]0.0025[/C][C]-0.002[/C][C]2e-04[/C][C]0.0472[/C][C]0.0039[/C][C]0.0627[/C][/ROW]
[ROW][C]55[/C][C]0.0028[/C][C]-0.002[/C][C]2e-04[/C][C]0.0472[/C][C]0.0039[/C][C]0.0627[/C][/ROW]
[ROW][C]56[/C][C]0.003[/C][C]-0.0018[/C][C]1e-04[/C][C]0.0351[/C][C]0.0029[/C][C]0.0541[/C][/ROW]
[ROW][C]57[/C][C]0.0032[/C][C]-0.0027[/C][C]2e-04[/C][C]0.0851[/C][C]0.0071[/C][C]0.0842[/C][/ROW]
[ROW][C]58[/C][C]0.0034[/C][C]-0.0042[/C][C]4e-04[/C][C]0.2036[/C][C]0.017[/C][C]0.1303[/C][/ROW]
[ROW][C]59[/C][C]0.0036[/C][C]-0.0038[/C][C]3e-04[/C][C]0.161[/C][C]0.0134[/C][C]0.1158[/C][/ROW]
[ROW][C]60[/C][C]0.0038[/C][C]-0.0043[/C][C]4e-04[/C][C]0.2126[/C][C]0.0177[/C][C]0.1331[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64190&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64190&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
497e-041e-0401e-0400.0029
500.00128e-041e-040.00665e-040.0234
510.0016-0.00121e-040.0170.00140.0376
520.002-8e-041e-040.00756e-040.025
530.0023-0.00171e-040.03140.00260.0511
540.0025-0.0022e-040.04720.00390.0627
550.0028-0.0022e-040.04720.00390.0627
560.003-0.00181e-040.03510.00290.0541
570.0032-0.00272e-040.08510.00710.0842
580.0034-0.00424e-040.20360.0170.1303
590.0036-0.00383e-040.1610.01340.1158
600.0038-0.00434e-040.21260.01770.1331



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