Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 05 Dec 2007 13:57:05 -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/2007/Dec/05/t1196887506d0s8u6c1enuy51w.htm/, Retrieved Thu, 02 May 2024 22:12:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2518, Retrieved Thu, 02 May 2024 22:12:08 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact207
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMAFORCfinsitbG3] [2007-12-05 20:57:05] [142ab5472309a9ae9a3b52678758dc4a] [Current]
Feedback Forum

Post a new message
Dataseries X:
22
27
24
24
22
23
25
23
21
21
22
20
22
22
20
21
20
21
21
21
19
21
21
22
19
24
22
22
22
24
22
23
24
21
20
22
23
23
22
20
21
21
20
20
17
18
19
19
20
21
20
21
19
22
20
18
16
17
18
19




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational 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 & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2518&T=0

[TABLE]
[ROW][C]Summary of compuational 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]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2518&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2518&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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])
3622-------
3723-------
3823-------
3922-------
4020-------
4121-------
4221-------
4320-------
4420-------
4517-------
4618-------
4719-------
4819-------
492018.892314.886522.8980.29390.4790.02220.479
502120.142716.006424.27890.34230.52690.08790.7059
512019.572515.331223.81370.42170.25470.1310.6043
522116.934412.506821.3620.0360.08740.08740.1803
531917.7112.787722.63230.30370.09510.09510.3037
542218.088312.986923.18960.06640.36310.13160.3631
552017.166611.898222.4350.14590.03610.14590.2476
561816.97211.499122.44490.35640.13910.13910.2338
571613.9358.214419.65560.23960.08180.14680.0413
581715.0469.146420.94560.25810.37560.16320.0945
591816.05519.981622.12850.26510.38020.1710.171
601915.99799.740922.25490.17350.26530.17350.1735

\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 & 22 & - & - & - & - & - & - & - \tabularnewline
37 & 23 & - & - & - & - & - & - & - \tabularnewline
38 & 23 & - & - & - & - & - & - & - \tabularnewline
39 & 22 & - & - & - & - & - & - & - \tabularnewline
40 & 20 & - & - & - & - & - & - & - \tabularnewline
41 & 21 & - & - & - & - & - & - & - \tabularnewline
42 & 21 & - & - & - & - & - & - & - \tabularnewline
43 & 20 & - & - & - & - & - & - & - \tabularnewline
44 & 20 & - & - & - & - & - & - & - \tabularnewline
45 & 17 & - & - & - & - & - & - & - \tabularnewline
46 & 18 & - & - & - & - & - & - & - \tabularnewline
47 & 19 & - & - & - & - & - & - & - \tabularnewline
48 & 19 & - & - & - & - & - & - & - \tabularnewline
49 & 20 & 18.8923 & 14.8865 & 22.898 & 0.2939 & 0.479 & 0.0222 & 0.479 \tabularnewline
50 & 21 & 20.1427 & 16.0064 & 24.2789 & 0.3423 & 0.5269 & 0.0879 & 0.7059 \tabularnewline
51 & 20 & 19.5725 & 15.3312 & 23.8137 & 0.4217 & 0.2547 & 0.131 & 0.6043 \tabularnewline
52 & 21 & 16.9344 & 12.5068 & 21.362 & 0.036 & 0.0874 & 0.0874 & 0.1803 \tabularnewline
53 & 19 & 17.71 & 12.7877 & 22.6323 & 0.3037 & 0.0951 & 0.0951 & 0.3037 \tabularnewline
54 & 22 & 18.0883 & 12.9869 & 23.1896 & 0.0664 & 0.3631 & 0.1316 & 0.3631 \tabularnewline
55 & 20 & 17.1666 & 11.8982 & 22.435 & 0.1459 & 0.0361 & 0.1459 & 0.2476 \tabularnewline
56 & 18 & 16.972 & 11.4991 & 22.4449 & 0.3564 & 0.1391 & 0.1391 & 0.2338 \tabularnewline
57 & 16 & 13.935 & 8.2144 & 19.6556 & 0.2396 & 0.0818 & 0.1468 & 0.0413 \tabularnewline
58 & 17 & 15.046 & 9.1464 & 20.9456 & 0.2581 & 0.3756 & 0.1632 & 0.0945 \tabularnewline
59 & 18 & 16.0551 & 9.9816 & 22.1285 & 0.2651 & 0.3802 & 0.171 & 0.171 \tabularnewline
60 & 19 & 15.9979 & 9.7409 & 22.2549 & 0.1735 & 0.2653 & 0.1735 & 0.1735 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2518&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]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]20[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]20[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]20[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]20[/C][C]18.8923[/C][C]14.8865[/C][C]22.898[/C][C]0.2939[/C][C]0.479[/C][C]0.0222[/C][C]0.479[/C][/ROW]
[ROW][C]50[/C][C]21[/C][C]20.1427[/C][C]16.0064[/C][C]24.2789[/C][C]0.3423[/C][C]0.5269[/C][C]0.0879[/C][C]0.7059[/C][/ROW]
[ROW][C]51[/C][C]20[/C][C]19.5725[/C][C]15.3312[/C][C]23.8137[/C][C]0.4217[/C][C]0.2547[/C][C]0.131[/C][C]0.6043[/C][/ROW]
[ROW][C]52[/C][C]21[/C][C]16.9344[/C][C]12.5068[/C][C]21.362[/C][C]0.036[/C][C]0.0874[/C][C]0.0874[/C][C]0.1803[/C][/ROW]
[ROW][C]53[/C][C]19[/C][C]17.71[/C][C]12.7877[/C][C]22.6323[/C][C]0.3037[/C][C]0.0951[/C][C]0.0951[/C][C]0.3037[/C][/ROW]
[ROW][C]54[/C][C]22[/C][C]18.0883[/C][C]12.9869[/C][C]23.1896[/C][C]0.0664[/C][C]0.3631[/C][C]0.1316[/C][C]0.3631[/C][/ROW]
[ROW][C]55[/C][C]20[/C][C]17.1666[/C][C]11.8982[/C][C]22.435[/C][C]0.1459[/C][C]0.0361[/C][C]0.1459[/C][C]0.2476[/C][/ROW]
[ROW][C]56[/C][C]18[/C][C]16.972[/C][C]11.4991[/C][C]22.4449[/C][C]0.3564[/C][C]0.1391[/C][C]0.1391[/C][C]0.2338[/C][/ROW]
[ROW][C]57[/C][C]16[/C][C]13.935[/C][C]8.2144[/C][C]19.6556[/C][C]0.2396[/C][C]0.0818[/C][C]0.1468[/C][C]0.0413[/C][/ROW]
[ROW][C]58[/C][C]17[/C][C]15.046[/C][C]9.1464[/C][C]20.9456[/C][C]0.2581[/C][C]0.3756[/C][C]0.1632[/C][C]0.0945[/C][/ROW]
[ROW][C]59[/C][C]18[/C][C]16.0551[/C][C]9.9816[/C][C]22.1285[/C][C]0.2651[/C][C]0.3802[/C][C]0.171[/C][C]0.171[/C][/ROW]
[ROW][C]60[/C][C]19[/C][C]15.9979[/C][C]9.7409[/C][C]22.2549[/C][C]0.1735[/C][C]0.2653[/C][C]0.1735[/C][C]0.1735[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2518&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2518&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])
3622-------
3723-------
3823-------
3922-------
4020-------
4121-------
4221-------
4320-------
4420-------
4517-------
4618-------
4719-------
4819-------
492018.892314.886522.8980.29390.4790.02220.479
502120.142716.006424.27890.34230.52690.08790.7059
512019.572515.331223.81370.42170.25470.1310.6043
522116.934412.506821.3620.0360.08740.08740.1803
531917.7112.787722.63230.30370.09510.09510.3037
542218.088312.986923.18960.06640.36310.13160.3631
552017.166611.898222.4350.14590.03610.14590.2476
561816.97211.499122.44490.35640.13910.13910.2338
571613.9358.214419.65560.23960.08180.14680.0413
581715.0469.146420.94560.25810.37560.16320.0945
591816.05519.981622.12850.26510.38020.1710.171
601915.99799.740922.25490.17350.26530.17350.1735







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.10820.05860.00491.2270.10230.3198
500.10480.04260.00350.7350.06130.2475
510.11060.02180.00180.18280.01520.1234
520.13340.24010.0216.52921.37741.1736
530.14180.07280.00611.66410.13870.3724
540.14390.21630.01815.30171.27511.1292
550.15660.16510.01388.02830.6690.8179
560.16450.06060.0051.05680.08810.2968
570.20940.14820.01234.26430.35540.5961
580.20010.12990.01083.8180.31820.5641
590.1930.12110.01013.78280.31520.5615
600.19950.18770.01569.01270.75110.8666

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1082 & 0.0586 & 0.0049 & 1.227 & 0.1023 & 0.3198 \tabularnewline
50 & 0.1048 & 0.0426 & 0.0035 & 0.735 & 0.0613 & 0.2475 \tabularnewline
51 & 0.1106 & 0.0218 & 0.0018 & 0.1828 & 0.0152 & 0.1234 \tabularnewline
52 & 0.1334 & 0.2401 & 0.02 & 16.5292 & 1.3774 & 1.1736 \tabularnewline
53 & 0.1418 & 0.0728 & 0.0061 & 1.6641 & 0.1387 & 0.3724 \tabularnewline
54 & 0.1439 & 0.2163 & 0.018 & 15.3017 & 1.2751 & 1.1292 \tabularnewline
55 & 0.1566 & 0.1651 & 0.0138 & 8.0283 & 0.669 & 0.8179 \tabularnewline
56 & 0.1645 & 0.0606 & 0.005 & 1.0568 & 0.0881 & 0.2968 \tabularnewline
57 & 0.2094 & 0.1482 & 0.0123 & 4.2643 & 0.3554 & 0.5961 \tabularnewline
58 & 0.2001 & 0.1299 & 0.0108 & 3.818 & 0.3182 & 0.5641 \tabularnewline
59 & 0.193 & 0.1211 & 0.0101 & 3.7828 & 0.3152 & 0.5615 \tabularnewline
60 & 0.1995 & 0.1877 & 0.0156 & 9.0127 & 0.7511 & 0.8666 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2518&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.1082[/C][C]0.0586[/C][C]0.0049[/C][C]1.227[/C][C]0.1023[/C][C]0.3198[/C][/ROW]
[ROW][C]50[/C][C]0.1048[/C][C]0.0426[/C][C]0.0035[/C][C]0.735[/C][C]0.0613[/C][C]0.2475[/C][/ROW]
[ROW][C]51[/C][C]0.1106[/C][C]0.0218[/C][C]0.0018[/C][C]0.1828[/C][C]0.0152[/C][C]0.1234[/C][/ROW]
[ROW][C]52[/C][C]0.1334[/C][C]0.2401[/C][C]0.02[/C][C]16.5292[/C][C]1.3774[/C][C]1.1736[/C][/ROW]
[ROW][C]53[/C][C]0.1418[/C][C]0.0728[/C][C]0.0061[/C][C]1.6641[/C][C]0.1387[/C][C]0.3724[/C][/ROW]
[ROW][C]54[/C][C]0.1439[/C][C]0.2163[/C][C]0.018[/C][C]15.3017[/C][C]1.2751[/C][C]1.1292[/C][/ROW]
[ROW][C]55[/C][C]0.1566[/C][C]0.1651[/C][C]0.0138[/C][C]8.0283[/C][C]0.669[/C][C]0.8179[/C][/ROW]
[ROW][C]56[/C][C]0.1645[/C][C]0.0606[/C][C]0.005[/C][C]1.0568[/C][C]0.0881[/C][C]0.2968[/C][/ROW]
[ROW][C]57[/C][C]0.2094[/C][C]0.1482[/C][C]0.0123[/C][C]4.2643[/C][C]0.3554[/C][C]0.5961[/C][/ROW]
[ROW][C]58[/C][C]0.2001[/C][C]0.1299[/C][C]0.0108[/C][C]3.818[/C][C]0.3182[/C][C]0.5641[/C][/ROW]
[ROW][C]59[/C][C]0.193[/C][C]0.1211[/C][C]0.0101[/C][C]3.7828[/C][C]0.3152[/C][C]0.5615[/C][/ROW]
[ROW][C]60[/C][C]0.1995[/C][C]0.1877[/C][C]0.0156[/C][C]9.0127[/C][C]0.7511[/C][C]0.8666[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2518&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2518&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.10820.05860.00491.2270.10230.3198
500.10480.04260.00350.7350.06130.2475
510.11060.02180.00180.18280.01520.1234
520.13340.24010.0216.52921.37741.1736
530.14180.07280.00611.66410.13870.3724
540.14390.21630.01815.30171.27511.1292
550.15660.16510.01388.02830.6690.8179
560.16450.06060.0051.05680.08810.2968
570.20940.14820.01234.26430.35540.5961
580.20010.12990.01083.8180.31820.5641
590.1930.12110.01013.78280.31520.5615
600.19950.18770.01569.01270.75110.8666



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