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:39:50 -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/t12614316206i82sdqw8jg3slp.htm/, Retrieved Sun, 05 May 2024 09:33:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70402, Retrieved Sun, 05 May 2024 09:33:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact91
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:39:50] [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




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=70402&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=70402&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70402&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])
3617.2-------
3718-------
3818.1-------
3918-------
4018.3-------
4118.7-------
4218.6-------
4318.3-------
4417.9-------
4517.4-------
4617.4-------
4720.1-------
4823.2-------
4924.224.366424.06524.66790.1396111
5024.224.787424.174925.39980.03010.969911
5123.924.953724.021125.88640.01340.943410.9999
5223.825.420124.193126.64710.00480.992410.9998
5323.826.021424.519427.52340.00190.998110.9999
5423.326.160124.389327.93098e-040.995510.9995
5522.426.073324.02728.11962e-040.996110.997
5621.525.97923.643628.31431e-040.998710.9902
5720.525.874923.235528.514300.999410.9765
5819.926.239123.281829.196400.999910.978
592229.211425.924432.49840110.9998
6024.932.583428.956336.21050111

\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 & 17.2 & - & - & - & - & - & - & - \tabularnewline
37 & 18 & - & - & - & - & - & - & - \tabularnewline
38 & 18.1 & - & - & - & - & - & - & - \tabularnewline
39 & 18 & - & - & - & - & - & - & - \tabularnewline
40 & 18.3 & - & - & - & - & - & - & - \tabularnewline
41 & 18.7 & - & - & - & - & - & - & - \tabularnewline
42 & 18.6 & - & - & - & - & - & - & - \tabularnewline
43 & 18.3 & - & - & - & - & - & - & - \tabularnewline
44 & 17.9 & - & - & - & - & - & - & - \tabularnewline
45 & 17.4 & - & - & - & - & - & - & - \tabularnewline
46 & 17.4 & - & - & - & - & - & - & - \tabularnewline
47 & 20.1 & - & - & - & - & - & - & - \tabularnewline
48 & 23.2 & - & - & - & - & - & - & - \tabularnewline
49 & 24.2 & 24.3664 & 24.065 & 24.6679 & 0.1396 & 1 & 1 & 1 \tabularnewline
50 & 24.2 & 24.7874 & 24.1749 & 25.3998 & 0.0301 & 0.9699 & 1 & 1 \tabularnewline
51 & 23.9 & 24.9537 & 24.0211 & 25.8864 & 0.0134 & 0.9434 & 1 & 0.9999 \tabularnewline
52 & 23.8 & 25.4201 & 24.1931 & 26.6471 & 0.0048 & 0.9924 & 1 & 0.9998 \tabularnewline
53 & 23.8 & 26.0214 & 24.5194 & 27.5234 & 0.0019 & 0.9981 & 1 & 0.9999 \tabularnewline
54 & 23.3 & 26.1601 & 24.3893 & 27.9309 & 8e-04 & 0.9955 & 1 & 0.9995 \tabularnewline
55 & 22.4 & 26.0733 & 24.027 & 28.1196 & 2e-04 & 0.9961 & 1 & 0.997 \tabularnewline
56 & 21.5 & 25.979 & 23.6436 & 28.3143 & 1e-04 & 0.9987 & 1 & 0.9902 \tabularnewline
57 & 20.5 & 25.8749 & 23.2355 & 28.5143 & 0 & 0.9994 & 1 & 0.9765 \tabularnewline
58 & 19.9 & 26.2391 & 23.2818 & 29.1964 & 0 & 0.9999 & 1 & 0.978 \tabularnewline
59 & 22 & 29.2114 & 25.9244 & 32.4984 & 0 & 1 & 1 & 0.9998 \tabularnewline
60 & 24.9 & 32.5834 & 28.9563 & 36.2105 & 0 & 1 & 1 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70402&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]17.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]18.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]18.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]18.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]18.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]18.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]17.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]17.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]17.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]20.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]23.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]24.2[/C][C]24.3664[/C][C]24.065[/C][C]24.6679[/C][C]0.1396[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]24.2[/C][C]24.7874[/C][C]24.1749[/C][C]25.3998[/C][C]0.0301[/C][C]0.9699[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]23.9[/C][C]24.9537[/C][C]24.0211[/C][C]25.8864[/C][C]0.0134[/C][C]0.9434[/C][C]1[/C][C]0.9999[/C][/ROW]
[ROW][C]52[/C][C]23.8[/C][C]25.4201[/C][C]24.1931[/C][C]26.6471[/C][C]0.0048[/C][C]0.9924[/C][C]1[/C][C]0.9998[/C][/ROW]
[ROW][C]53[/C][C]23.8[/C][C]26.0214[/C][C]24.5194[/C][C]27.5234[/C][C]0.0019[/C][C]0.9981[/C][C]1[/C][C]0.9999[/C][/ROW]
[ROW][C]54[/C][C]23.3[/C][C]26.1601[/C][C]24.3893[/C][C]27.9309[/C][C]8e-04[/C][C]0.9955[/C][C]1[/C][C]0.9995[/C][/ROW]
[ROW][C]55[/C][C]22.4[/C][C]26.0733[/C][C]24.027[/C][C]28.1196[/C][C]2e-04[/C][C]0.9961[/C][C]1[/C][C]0.997[/C][/ROW]
[ROW][C]56[/C][C]21.5[/C][C]25.979[/C][C]23.6436[/C][C]28.3143[/C][C]1e-04[/C][C]0.9987[/C][C]1[/C][C]0.9902[/C][/ROW]
[ROW][C]57[/C][C]20.5[/C][C]25.8749[/C][C]23.2355[/C][C]28.5143[/C][C]0[/C][C]0.9994[/C][C]1[/C][C]0.9765[/C][/ROW]
[ROW][C]58[/C][C]19.9[/C][C]26.2391[/C][C]23.2818[/C][C]29.1964[/C][C]0[/C][C]0.9999[/C][C]1[/C][C]0.978[/C][/ROW]
[ROW][C]59[/C][C]22[/C][C]29.2114[/C][C]25.9244[/C][C]32.4984[/C][C]0[/C][C]1[/C][C]1[/C][C]0.9998[/C][/ROW]
[ROW][C]60[/C][C]24.9[/C][C]32.5834[/C][C]28.9563[/C][C]36.2105[/C][C]0[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70402&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70402&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])
3617.2-------
3718-------
3818.1-------
3918-------
4018.3-------
4118.7-------
4218.6-------
4318.3-------
4417.9-------
4517.4-------
4617.4-------
4720.1-------
4823.2-------
4924.224.366424.06524.66790.1396111
5024.224.787424.174925.39980.03010.969911
5123.924.953724.021125.88640.01340.943410.9999
5223.825.420124.193126.64710.00480.992410.9998
5323.826.021424.519427.52340.00190.998110.9999
5423.326.160124.389327.93098e-040.995510.9995
5522.426.073324.02728.11962e-040.996110.997
5621.525.97923.643628.31431e-040.998710.9902
5720.525.874923.235528.514300.999410.9765
5819.926.239123.281829.196400.999910.978
592229.211425.924432.49840110.9998
6024.932.583428.956336.21050111







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0063-0.006800.027700
500.0126-0.02370.01530.3450.18630.4317
510.0191-0.04220.02431.11030.49430.7031
520.0246-0.06370.03412.62471.02691.0134
530.0294-0.08540.04444.93451.80851.3448
540.0345-0.10930.05528.18012.87041.6942
550.04-0.14090.067413.49324.38792.0947
560.0459-0.17240.080620.06116.34712.5193
570.052-0.20770.094728.88948.85182.9752
580.0575-0.24160.109440.184311.9853.4619
590.0574-0.24690.121952.003815.62313.9526
600.0568-0.23580.131459.034619.24074.3864

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0063 & -0.0068 & 0 & 0.0277 & 0 & 0 \tabularnewline
50 & 0.0126 & -0.0237 & 0.0153 & 0.345 & 0.1863 & 0.4317 \tabularnewline
51 & 0.0191 & -0.0422 & 0.0243 & 1.1103 & 0.4943 & 0.7031 \tabularnewline
52 & 0.0246 & -0.0637 & 0.0341 & 2.6247 & 1.0269 & 1.0134 \tabularnewline
53 & 0.0294 & -0.0854 & 0.0444 & 4.9345 & 1.8085 & 1.3448 \tabularnewline
54 & 0.0345 & -0.1093 & 0.0552 & 8.1801 & 2.8704 & 1.6942 \tabularnewline
55 & 0.04 & -0.1409 & 0.0674 & 13.4932 & 4.3879 & 2.0947 \tabularnewline
56 & 0.0459 & -0.1724 & 0.0806 & 20.0611 & 6.3471 & 2.5193 \tabularnewline
57 & 0.052 & -0.2077 & 0.0947 & 28.8894 & 8.8518 & 2.9752 \tabularnewline
58 & 0.0575 & -0.2416 & 0.1094 & 40.1843 & 11.985 & 3.4619 \tabularnewline
59 & 0.0574 & -0.2469 & 0.1219 & 52.0038 & 15.6231 & 3.9526 \tabularnewline
60 & 0.0568 & -0.2358 & 0.1314 & 59.0346 & 19.2407 & 4.3864 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70402&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.0063[/C][C]-0.0068[/C][C]0[/C][C]0.0277[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0126[/C][C]-0.0237[/C][C]0.0153[/C][C]0.345[/C][C]0.1863[/C][C]0.4317[/C][/ROW]
[ROW][C]51[/C][C]0.0191[/C][C]-0.0422[/C][C]0.0243[/C][C]1.1103[/C][C]0.4943[/C][C]0.7031[/C][/ROW]
[ROW][C]52[/C][C]0.0246[/C][C]-0.0637[/C][C]0.0341[/C][C]2.6247[/C][C]1.0269[/C][C]1.0134[/C][/ROW]
[ROW][C]53[/C][C]0.0294[/C][C]-0.0854[/C][C]0.0444[/C][C]4.9345[/C][C]1.8085[/C][C]1.3448[/C][/ROW]
[ROW][C]54[/C][C]0.0345[/C][C]-0.1093[/C][C]0.0552[/C][C]8.1801[/C][C]2.8704[/C][C]1.6942[/C][/ROW]
[ROW][C]55[/C][C]0.04[/C][C]-0.1409[/C][C]0.0674[/C][C]13.4932[/C][C]4.3879[/C][C]2.0947[/C][/ROW]
[ROW][C]56[/C][C]0.0459[/C][C]-0.1724[/C][C]0.0806[/C][C]20.0611[/C][C]6.3471[/C][C]2.5193[/C][/ROW]
[ROW][C]57[/C][C]0.052[/C][C]-0.2077[/C][C]0.0947[/C][C]28.8894[/C][C]8.8518[/C][C]2.9752[/C][/ROW]
[ROW][C]58[/C][C]0.0575[/C][C]-0.2416[/C][C]0.1094[/C][C]40.1843[/C][C]11.985[/C][C]3.4619[/C][/ROW]
[ROW][C]59[/C][C]0.0574[/C][C]-0.2469[/C][C]0.1219[/C][C]52.0038[/C][C]15.6231[/C][C]3.9526[/C][/ROW]
[ROW][C]60[/C][C]0.0568[/C][C]-0.2358[/C][C]0.1314[/C][C]59.0346[/C][C]19.2407[/C][C]4.3864[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70402&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70402&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.0063-0.006800.027700
500.0126-0.02370.01530.3450.18630.4317
510.0191-0.04220.02431.11030.49430.7031
520.0246-0.06370.03412.62471.02691.0134
530.0294-0.08540.04444.93451.80851.3448
540.0345-0.10930.05528.18012.87041.6942
550.04-0.14090.067413.49324.38792.0947
560.0459-0.17240.080620.06116.34712.5193
570.052-0.20770.094728.88948.85182.9752
580.0575-0.24160.109440.184311.9853.4619
590.0574-0.24690.121952.003815.62313.9526
600.0568-0.23580.131459.034619.24074.3864



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')