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 computationThu, 10 Dec 2009 03:14:16 -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/10/t1260440127wzs95zbscdcoy2z.htm/, Retrieved Fri, 19 Apr 2024 01:12:39 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65245, Retrieved Fri, 19 Apr 2024 01:12:39 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact193
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-08 17:36:01] [7369a9baefff1ba9d2171738b4c9faa6]
-    D    [ARIMA Forecasting] [ARIMA forecasting...] [2009-12-10 10:14:16] [4996e0131d5120d29a6e9a8dccb25dc3] [Current]
-   P       [ARIMA Forecasting] [Forecasting] [2009-12-19 10:30:06] [e3c32faf833f030d3b397185b633f75f]
Feedback Forum

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




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65245&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[49])
3724-------
3817-------
3921-------
4019-------
4122-------
4222-------
4318-------
4416-------
4514-------
4612-------
4714-------
4816-------
498-------
5034.8862-2.906312.67860.31760.21680.00120.2168
5104.9534-6.066815.97360.18920.63590.00220.294
5256.8993-6.597620.39630.39130.84180.03940.4365
5318.8138-6.771224.39870.16290.68430.04860.5408
5417.8542-9.570325.27870.22040.77960.05580.4935
5536.8917-12.195925.97920.34470.72740.1270.4547
5664.6906-15.926325.30760.45050.56380.14120.3765
5774.55-17.490426.59040.41380.44870.20040.3795
5883.3237-20.053726.70110.34750.3790.23350.3475
59143.9482-20.693728.59010.2120.37360.2120.3736
60143.9302-21.914529.77480.22250.22250.180.3788
61133.2814-23.712530.27530.24020.21820.36590.3659

\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[49]) \tabularnewline
37 & 24 & - & - & - & - & - & - & - \tabularnewline
38 & 17 & - & - & - & - & - & - & - \tabularnewline
39 & 21 & - & - & - & - & - & - & - \tabularnewline
40 & 19 & - & - & - & - & - & - & - \tabularnewline
41 & 22 & - & - & - & - & - & - & - \tabularnewline
42 & 22 & - & - & - & - & - & - & - \tabularnewline
43 & 18 & - & - & - & - & - & - & - \tabularnewline
44 & 16 & - & - & - & - & - & - & - \tabularnewline
45 & 14 & - & - & - & - & - & - & - \tabularnewline
46 & 12 & - & - & - & - & - & - & - \tabularnewline
47 & 14 & - & - & - & - & - & - & - \tabularnewline
48 & 16 & - & - & - & - & - & - & - \tabularnewline
49 & 8 & - & - & - & - & - & - & - \tabularnewline
50 & 3 & 4.8862 & -2.9063 & 12.6786 & 0.3176 & 0.2168 & 0.0012 & 0.2168 \tabularnewline
51 & 0 & 4.9534 & -6.0668 & 15.9736 & 0.1892 & 0.6359 & 0.0022 & 0.294 \tabularnewline
52 & 5 & 6.8993 & -6.5976 & 20.3963 & 0.3913 & 0.8418 & 0.0394 & 0.4365 \tabularnewline
53 & 1 & 8.8138 & -6.7712 & 24.3987 & 0.1629 & 0.6843 & 0.0486 & 0.5408 \tabularnewline
54 & 1 & 7.8542 & -9.5703 & 25.2787 & 0.2204 & 0.7796 & 0.0558 & 0.4935 \tabularnewline
55 & 3 & 6.8917 & -12.1959 & 25.9792 & 0.3447 & 0.7274 & 0.127 & 0.4547 \tabularnewline
56 & 6 & 4.6906 & -15.9263 & 25.3076 & 0.4505 & 0.5638 & 0.1412 & 0.3765 \tabularnewline
57 & 7 & 4.55 & -17.4904 & 26.5904 & 0.4138 & 0.4487 & 0.2004 & 0.3795 \tabularnewline
58 & 8 & 3.3237 & -20.0537 & 26.7011 & 0.3475 & 0.379 & 0.2335 & 0.3475 \tabularnewline
59 & 14 & 3.9482 & -20.6937 & 28.5901 & 0.212 & 0.3736 & 0.212 & 0.3736 \tabularnewline
60 & 14 & 3.9302 & -21.9145 & 29.7748 & 0.2225 & 0.2225 & 0.18 & 0.3788 \tabularnewline
61 & 13 & 3.2814 & -23.7125 & 30.2753 & 0.2402 & 0.2182 & 0.3659 & 0.3659 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65245&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[49])[/C][/ROW]
[ROW][C]37[/C][C]24[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]21[/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]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]12[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]3[/C][C]4.8862[/C][C]-2.9063[/C][C]12.6786[/C][C]0.3176[/C][C]0.2168[/C][C]0.0012[/C][C]0.2168[/C][/ROW]
[ROW][C]51[/C][C]0[/C][C]4.9534[/C][C]-6.0668[/C][C]15.9736[/C][C]0.1892[/C][C]0.6359[/C][C]0.0022[/C][C]0.294[/C][/ROW]
[ROW][C]52[/C][C]5[/C][C]6.8993[/C][C]-6.5976[/C][C]20.3963[/C][C]0.3913[/C][C]0.8418[/C][C]0.0394[/C][C]0.4365[/C][/ROW]
[ROW][C]53[/C][C]1[/C][C]8.8138[/C][C]-6.7712[/C][C]24.3987[/C][C]0.1629[/C][C]0.6843[/C][C]0.0486[/C][C]0.5408[/C][/ROW]
[ROW][C]54[/C][C]1[/C][C]7.8542[/C][C]-9.5703[/C][C]25.2787[/C][C]0.2204[/C][C]0.7796[/C][C]0.0558[/C][C]0.4935[/C][/ROW]
[ROW][C]55[/C][C]3[/C][C]6.8917[/C][C]-12.1959[/C][C]25.9792[/C][C]0.3447[/C][C]0.7274[/C][C]0.127[/C][C]0.4547[/C][/ROW]
[ROW][C]56[/C][C]6[/C][C]4.6906[/C][C]-15.9263[/C][C]25.3076[/C][C]0.4505[/C][C]0.5638[/C][C]0.1412[/C][C]0.3765[/C][/ROW]
[ROW][C]57[/C][C]7[/C][C]4.55[/C][C]-17.4904[/C][C]26.5904[/C][C]0.4138[/C][C]0.4487[/C][C]0.2004[/C][C]0.3795[/C][/ROW]
[ROW][C]58[/C][C]8[/C][C]3.3237[/C][C]-20.0537[/C][C]26.7011[/C][C]0.3475[/C][C]0.379[/C][C]0.2335[/C][C]0.3475[/C][/ROW]
[ROW][C]59[/C][C]14[/C][C]3.9482[/C][C]-20.6937[/C][C]28.5901[/C][C]0.212[/C][C]0.3736[/C][C]0.212[/C][C]0.3736[/C][/ROW]
[ROW][C]60[/C][C]14[/C][C]3.9302[/C][C]-21.9145[/C][C]29.7748[/C][C]0.2225[/C][C]0.2225[/C][C]0.18[/C][C]0.3788[/C][/ROW]
[ROW][C]61[/C][C]13[/C][C]3.2814[/C][C]-23.7125[/C][C]30.2753[/C][C]0.2402[/C][C]0.2182[/C][C]0.3659[/C][C]0.3659[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65245&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65245&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[49])
3724-------
3817-------
3921-------
4019-------
4122-------
4222-------
4318-------
4416-------
4514-------
4612-------
4714-------
4816-------
498-------
5034.8862-2.906312.67860.31760.21680.00120.2168
5104.9534-6.066815.97360.18920.63590.00220.294
5256.8993-6.597620.39630.39130.84180.03940.4365
5318.8138-6.771224.39870.16290.68430.04860.5408
5417.8542-9.570325.27870.22040.77960.05580.4935
5536.8917-12.195925.97920.34470.72740.1270.4547
5664.6906-15.926325.30760.45050.56380.14120.3765
5774.55-17.490426.59040.41380.44870.20040.3795
5883.3237-20.053726.70110.34750.3790.23350.3475
59143.9482-20.693728.59010.2120.37360.2120.3736
60143.9302-21.914529.77480.22250.22250.180.3788
61133.2814-23.712530.27530.24020.21820.36590.3659







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.8137-0.38603.557600
511.1351-10.69324.535814.04673.7479
520.9981-0.27530.55383.607510.5673.2507
530.9022-0.88650.63761.054723.18894.8155
541.1319-0.87270.684146.980227.94715.2865
551.4131-0.56470.664215.14525.81355.0807
562.24250.27910.60921.714422.37074.7298
572.47150.53850.60046.002620.32474.5083
583.58851.40690.6921.867420.49614.5273
593.18432.54590.8756101.038328.55035.3433
603.35512.56221.0289101.401435.17325.9307
614.19712.96181.1994.451740.1136.3335

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.8137 & -0.386 & 0 & 3.5576 & 0 & 0 \tabularnewline
51 & 1.1351 & -1 & 0.693 & 24.5358 & 14.0467 & 3.7479 \tabularnewline
52 & 0.9981 & -0.2753 & 0.5538 & 3.6075 & 10.567 & 3.2507 \tabularnewline
53 & 0.9022 & -0.8865 & 0.637 & 61.0547 & 23.1889 & 4.8155 \tabularnewline
54 & 1.1319 & -0.8727 & 0.6841 & 46.9802 & 27.9471 & 5.2865 \tabularnewline
55 & 1.4131 & -0.5647 & 0.6642 & 15.145 & 25.8135 & 5.0807 \tabularnewline
56 & 2.2425 & 0.2791 & 0.6092 & 1.7144 & 22.3707 & 4.7298 \tabularnewline
57 & 2.4715 & 0.5385 & 0.6004 & 6.0026 & 20.3247 & 4.5083 \tabularnewline
58 & 3.5885 & 1.4069 & 0.69 & 21.8674 & 20.4961 & 4.5273 \tabularnewline
59 & 3.1843 & 2.5459 & 0.8756 & 101.0383 & 28.5503 & 5.3433 \tabularnewline
60 & 3.3551 & 2.5622 & 1.0289 & 101.4014 & 35.1732 & 5.9307 \tabularnewline
61 & 4.1971 & 2.9618 & 1.19 & 94.4517 & 40.113 & 6.3335 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65245&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]50[/C][C]0.8137[/C][C]-0.386[/C][C]0[/C][C]3.5576[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]1.1351[/C][C]-1[/C][C]0.693[/C][C]24.5358[/C][C]14.0467[/C][C]3.7479[/C][/ROW]
[ROW][C]52[/C][C]0.9981[/C][C]-0.2753[/C][C]0.5538[/C][C]3.6075[/C][C]10.567[/C][C]3.2507[/C][/ROW]
[ROW][C]53[/C][C]0.9022[/C][C]-0.8865[/C][C]0.637[/C][C]61.0547[/C][C]23.1889[/C][C]4.8155[/C][/ROW]
[ROW][C]54[/C][C]1.1319[/C][C]-0.8727[/C][C]0.6841[/C][C]46.9802[/C][C]27.9471[/C][C]5.2865[/C][/ROW]
[ROW][C]55[/C][C]1.4131[/C][C]-0.5647[/C][C]0.6642[/C][C]15.145[/C][C]25.8135[/C][C]5.0807[/C][/ROW]
[ROW][C]56[/C][C]2.2425[/C][C]0.2791[/C][C]0.6092[/C][C]1.7144[/C][C]22.3707[/C][C]4.7298[/C][/ROW]
[ROW][C]57[/C][C]2.4715[/C][C]0.5385[/C][C]0.6004[/C][C]6.0026[/C][C]20.3247[/C][C]4.5083[/C][/ROW]
[ROW][C]58[/C][C]3.5885[/C][C]1.4069[/C][C]0.69[/C][C]21.8674[/C][C]20.4961[/C][C]4.5273[/C][/ROW]
[ROW][C]59[/C][C]3.1843[/C][C]2.5459[/C][C]0.8756[/C][C]101.0383[/C][C]28.5503[/C][C]5.3433[/C][/ROW]
[ROW][C]60[/C][C]3.3551[/C][C]2.5622[/C][C]1.0289[/C][C]101.4014[/C][C]35.1732[/C][C]5.9307[/C][/ROW]
[ROW][C]61[/C][C]4.1971[/C][C]2.9618[/C][C]1.19[/C][C]94.4517[/C][C]40.113[/C][C]6.3335[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65245&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65245&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
500.8137-0.38603.557600
511.1351-10.69324.535814.04673.7479
520.9981-0.27530.55383.607510.5673.2507
530.9022-0.88650.63761.054723.18894.8155
541.1319-0.87270.684146.980227.94715.2865
551.4131-0.56470.664215.14525.81355.0807
562.24250.27910.60921.714422.37074.7298
572.47150.53850.60046.002620.32474.5083
583.58851.40690.6921.867420.49614.5273
593.18432.54590.8756101.038328.55035.3433
603.35512.56221.0289101.401435.17325.9307
614.19712.96181.1994.451740.1136.3335



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