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 computationSun, 14 Dec 2008 05:32:01 -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/2008/Dec/14/t12292581615v86ac1n390pxyh.htm/, Retrieved Wed, 15 May 2024 01:05:03 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33324, Retrieved Wed, 15 May 2024 01:05:03 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact186
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [1.5 ARIMA Forecas...] [2008-12-14 12:32:01] [ee6d9573aeb8a2216fa3549ce57cd52f] [Current]
- RMP     [ARIMA Backward Selection] [] [2008-12-15 20:16:18] [cb714085b233acee8e8acd879ea442b6]
Feedback Forum

Post a new message
Dataseries X:
0
9
1
4
6
21
24
23
22
21
20
16
18
18
24
16
15
24
18
15
4
3
6
5
12
12
12
14
12
17
12
20
21
15
22
19
19
26
25
19
20
30
31
35
33
26
25
17
14
8
12
7
4
10
8
16
14
20
9
10




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33324&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 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[48])
3619-------
3719-------
3826-------
3925-------
4019-------
4120-------
4230-------
4331-------
4435-------
4533-------
4626-------
4725-------
4817-------
491417.2414.48429.99790.30930.51480.39350.5148
50824.15856.730741.58640.03460.87340.4180.7896
511223.16741.949344.38550.15110.91940.43280.7156
52717.1657-7.247841.57920.20720.66080.44150.5053
53418.166-9.072845.40470.1540.78910.44750.5334
541028.1659-1.631157.9630.11610.9440.4520.7687
55829.1659-2.986661.31840.09850.87870.45550.7708
561633.1659-1.180867.51260.16360.92450.45830.8219
571431.1659-5.243167.57490.17770.79290.46070.7771
582024.1659-14.194662.52650.41570.69830.46270.6429
59923.1659-17.051663.38340.2450.56130.46440.6181
601015.1659-26.826557.15830.40470.61320.46590.4659

\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 & 19 & - & - & - & - & - & - & - \tabularnewline
37 & 19 & - & - & - & - & - & - & - \tabularnewline
38 & 26 & - & - & - & - & - & - & - \tabularnewline
39 & 25 & - & - & - & - & - & - & - \tabularnewline
40 & 19 & - & - & - & - & - & - & - \tabularnewline
41 & 20 & - & - & - & - & - & - & - \tabularnewline
42 & 30 & - & - & - & - & - & - & - \tabularnewline
43 & 31 & - & - & - & - & - & - & - \tabularnewline
44 & 35 & - & - & - & - & - & - & - \tabularnewline
45 & 33 & - & - & - & - & - & - & - \tabularnewline
46 & 26 & - & - & - & - & - & - & - \tabularnewline
47 & 25 & - & - & - & - & - & - & - \tabularnewline
48 & 17 & - & - & - & - & - & - & - \tabularnewline
49 & 14 & 17.241 & 4.484 & 29.9979 & 0.3093 & 0.5148 & 0.3935 & 0.5148 \tabularnewline
50 & 8 & 24.1585 & 6.7307 & 41.5864 & 0.0346 & 0.8734 & 0.418 & 0.7896 \tabularnewline
51 & 12 & 23.1674 & 1.9493 & 44.3855 & 0.1511 & 0.9194 & 0.4328 & 0.7156 \tabularnewline
52 & 7 & 17.1657 & -7.2478 & 41.5792 & 0.2072 & 0.6608 & 0.4415 & 0.5053 \tabularnewline
53 & 4 & 18.166 & -9.0728 & 45.4047 & 0.154 & 0.7891 & 0.4475 & 0.5334 \tabularnewline
54 & 10 & 28.1659 & -1.6311 & 57.963 & 0.1161 & 0.944 & 0.452 & 0.7687 \tabularnewline
55 & 8 & 29.1659 & -2.9866 & 61.3184 & 0.0985 & 0.8787 & 0.4555 & 0.7708 \tabularnewline
56 & 16 & 33.1659 & -1.1808 & 67.5126 & 0.1636 & 0.9245 & 0.4583 & 0.8219 \tabularnewline
57 & 14 & 31.1659 & -5.2431 & 67.5749 & 0.1777 & 0.7929 & 0.4607 & 0.7771 \tabularnewline
58 & 20 & 24.1659 & -14.1946 & 62.5265 & 0.4157 & 0.6983 & 0.4627 & 0.6429 \tabularnewline
59 & 9 & 23.1659 & -17.0516 & 63.3834 & 0.245 & 0.5613 & 0.4644 & 0.6181 \tabularnewline
60 & 10 & 15.1659 & -26.8265 & 57.1583 & 0.4047 & 0.6132 & 0.4659 & 0.4659 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33324&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]19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]26[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]25[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]20[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]30[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]31[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]35[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]33[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]26[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]25[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]14[/C][C]17.241[/C][C]4.484[/C][C]29.9979[/C][C]0.3093[/C][C]0.5148[/C][C]0.3935[/C][C]0.5148[/C][/ROW]
[ROW][C]50[/C][C]8[/C][C]24.1585[/C][C]6.7307[/C][C]41.5864[/C][C]0.0346[/C][C]0.8734[/C][C]0.418[/C][C]0.7896[/C][/ROW]
[ROW][C]51[/C][C]12[/C][C]23.1674[/C][C]1.9493[/C][C]44.3855[/C][C]0.1511[/C][C]0.9194[/C][C]0.4328[/C][C]0.7156[/C][/ROW]
[ROW][C]52[/C][C]7[/C][C]17.1657[/C][C]-7.2478[/C][C]41.5792[/C][C]0.2072[/C][C]0.6608[/C][C]0.4415[/C][C]0.5053[/C][/ROW]
[ROW][C]53[/C][C]4[/C][C]18.166[/C][C]-9.0728[/C][C]45.4047[/C][C]0.154[/C][C]0.7891[/C][C]0.4475[/C][C]0.5334[/C][/ROW]
[ROW][C]54[/C][C]10[/C][C]28.1659[/C][C]-1.6311[/C][C]57.963[/C][C]0.1161[/C][C]0.944[/C][C]0.452[/C][C]0.7687[/C][/ROW]
[ROW][C]55[/C][C]8[/C][C]29.1659[/C][C]-2.9866[/C][C]61.3184[/C][C]0.0985[/C][C]0.8787[/C][C]0.4555[/C][C]0.7708[/C][/ROW]
[ROW][C]56[/C][C]16[/C][C]33.1659[/C][C]-1.1808[/C][C]67.5126[/C][C]0.1636[/C][C]0.9245[/C][C]0.4583[/C][C]0.8219[/C][/ROW]
[ROW][C]57[/C][C]14[/C][C]31.1659[/C][C]-5.2431[/C][C]67.5749[/C][C]0.1777[/C][C]0.7929[/C][C]0.4607[/C][C]0.7771[/C][/ROW]
[ROW][C]58[/C][C]20[/C][C]24.1659[/C][C]-14.1946[/C][C]62.5265[/C][C]0.4157[/C][C]0.6983[/C][C]0.4627[/C][C]0.6429[/C][/ROW]
[ROW][C]59[/C][C]9[/C][C]23.1659[/C][C]-17.0516[/C][C]63.3834[/C][C]0.245[/C][C]0.5613[/C][C]0.4644[/C][C]0.6181[/C][/ROW]
[ROW][C]60[/C][C]10[/C][C]15.1659[/C][C]-26.8265[/C][C]57.1583[/C][C]0.4047[/C][C]0.6132[/C][C]0.4659[/C][C]0.4659[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33324&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33324&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])
3619-------
3719-------
3826-------
3925-------
4019-------
4120-------
4230-------
4331-------
4435-------
4533-------
4626-------
4725-------
4817-------
491417.2414.48429.99790.30930.51480.39350.5148
50824.15856.730741.58640.03460.87340.4180.7896
511223.16741.949344.38550.15110.91940.43280.7156
52717.1657-7.247841.57920.20720.66080.44150.5053
53418.166-9.072845.40470.1540.78910.44750.5334
541028.1659-1.631157.9630.11610.9440.4520.7687
55829.1659-2.986661.31840.09850.87870.45550.7708
561633.1659-1.180867.51260.16360.92450.45830.8219
571431.1659-5.243167.57490.17770.79290.46070.7771
582024.1659-14.194662.52650.41570.69830.46270.6429
59923.1659-17.051663.38340.2450.56130.46440.6181
601015.1659-26.826557.15830.40470.61320.46590.4659







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.3775-0.1880.015710.50380.87530.9356
500.3681-0.66890.0557261.098521.75824.6646
510.4673-0.4820.0402124.711210.39263.2238
520.7256-0.59220.0494103.34188.61182.9346
530.765-0.77980.065200.674216.72294.0894
540.5398-0.6450.0537330.000427.55.244
550.5624-0.72570.0605447.996237.3336.1101
560.5284-0.51760.0431294.668824.55574.9554
570.596-0.55080.0459294.668824.55574.9554
580.8099-0.17240.014417.35491.44621.2026
590.8857-0.61150.051200.673316.72284.0893
601.4127-0.34060.028426.68672.22391.4913

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.3775 & -0.188 & 0.0157 & 10.5038 & 0.8753 & 0.9356 \tabularnewline
50 & 0.3681 & -0.6689 & 0.0557 & 261.0985 & 21.7582 & 4.6646 \tabularnewline
51 & 0.4673 & -0.482 & 0.0402 & 124.7112 & 10.3926 & 3.2238 \tabularnewline
52 & 0.7256 & -0.5922 & 0.0494 & 103.3418 & 8.6118 & 2.9346 \tabularnewline
53 & 0.765 & -0.7798 & 0.065 & 200.6742 & 16.7229 & 4.0894 \tabularnewline
54 & 0.5398 & -0.645 & 0.0537 & 330.0004 & 27.5 & 5.244 \tabularnewline
55 & 0.5624 & -0.7257 & 0.0605 & 447.9962 & 37.333 & 6.1101 \tabularnewline
56 & 0.5284 & -0.5176 & 0.0431 & 294.6688 & 24.5557 & 4.9554 \tabularnewline
57 & 0.596 & -0.5508 & 0.0459 & 294.6688 & 24.5557 & 4.9554 \tabularnewline
58 & 0.8099 & -0.1724 & 0.0144 & 17.3549 & 1.4462 & 1.2026 \tabularnewline
59 & 0.8857 & -0.6115 & 0.051 & 200.6733 & 16.7228 & 4.0893 \tabularnewline
60 & 1.4127 & -0.3406 & 0.0284 & 26.6867 & 2.2239 & 1.4913 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33324&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]0.3775[/C][C]-0.188[/C][C]0.0157[/C][C]10.5038[/C][C]0.8753[/C][C]0.9356[/C][/ROW]
[ROW][C]50[/C][C]0.3681[/C][C]-0.6689[/C][C]0.0557[/C][C]261.0985[/C][C]21.7582[/C][C]4.6646[/C][/ROW]
[ROW][C]51[/C][C]0.4673[/C][C]-0.482[/C][C]0.0402[/C][C]124.7112[/C][C]10.3926[/C][C]3.2238[/C][/ROW]
[ROW][C]52[/C][C]0.7256[/C][C]-0.5922[/C][C]0.0494[/C][C]103.3418[/C][C]8.6118[/C][C]2.9346[/C][/ROW]
[ROW][C]53[/C][C]0.765[/C][C]-0.7798[/C][C]0.065[/C][C]200.6742[/C][C]16.7229[/C][C]4.0894[/C][/ROW]
[ROW][C]54[/C][C]0.5398[/C][C]-0.645[/C][C]0.0537[/C][C]330.0004[/C][C]27.5[/C][C]5.244[/C][/ROW]
[ROW][C]55[/C][C]0.5624[/C][C]-0.7257[/C][C]0.0605[/C][C]447.9962[/C][C]37.333[/C][C]6.1101[/C][/ROW]
[ROW][C]56[/C][C]0.5284[/C][C]-0.5176[/C][C]0.0431[/C][C]294.6688[/C][C]24.5557[/C][C]4.9554[/C][/ROW]
[ROW][C]57[/C][C]0.596[/C][C]-0.5508[/C][C]0.0459[/C][C]294.6688[/C][C]24.5557[/C][C]4.9554[/C][/ROW]
[ROW][C]58[/C][C]0.8099[/C][C]-0.1724[/C][C]0.0144[/C][C]17.3549[/C][C]1.4462[/C][C]1.2026[/C][/ROW]
[ROW][C]59[/C][C]0.8857[/C][C]-0.6115[/C][C]0.051[/C][C]200.6733[/C][C]16.7228[/C][C]4.0893[/C][/ROW]
[ROW][C]60[/C][C]1.4127[/C][C]-0.3406[/C][C]0.0284[/C][C]26.6867[/C][C]2.2239[/C][C]1.4913[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33324&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33324&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
490.3775-0.1880.015710.50380.87530.9356
500.3681-0.66890.0557261.098521.75824.6646
510.4673-0.4820.0402124.711210.39263.2238
520.7256-0.59220.0494103.34188.61182.9346
530.765-0.77980.065200.674216.72294.0894
540.5398-0.6450.0537330.000427.55.244
550.5624-0.72570.0605447.996237.3336.1101
560.5284-0.51760.0431294.668824.55574.9554
570.596-0.55080.0459294.668824.55574.9554
580.8099-0.17240.014417.35491.44621.2026
590.8857-0.61150.051200.673316.72284.0893
601.4127-0.34060.028426.68672.22391.4913



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