Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 30 Dec 2009 10:30: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/30/t1262194343stdul6i57rgvd55.htm/, Retrieved Sun, 28 Apr 2024 21:07:03 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71336, Retrieved Sun, 28 Apr 2024 21:07:03 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact104
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forecasting...] [2009-12-30 17:30:42] [dbd46bd47d5f87b1007a5a1708bef00e] [Current]
Feedback Forum

Post a new message




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 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 & 3 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71336&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]3 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=71336&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71336&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 time3 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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417435.9938379.6114492.37630.25450.85940.99590.8594
134391447.6913354.2265541.15620.11730.74010.98670.8147
135419438.8378320.9768556.69880.37070.78680.70750.7132
136461428.5103297.2417559.77890.31380.55650.68630.6372
137472424.3841283.7852564.98290.25340.30490.52440.6065
138535426.2549276.8249575.68490.07690.27420.27420.6098
139622429.3833270.3615588.40520.00880.09650.07190.6181
140606430.8639261.9555599.77240.02110.01330.06850.618
141508430.5205252.2094608.83160.19720.02690.36050.6105
142461429.6096242.6759616.54330.3710.20560.59370.6018
143390429.0965234.1567624.03630.34710.37420.750.5957
144432429.1332226.5435631.72280.48890.64750.59230.5923

\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[132]) \tabularnewline
120 & 337 & - & - & - & - & - & - & - \tabularnewline
121 & 360 & - & - & - & - & - & - & - \tabularnewline
122 & 342 & - & - & - & - & - & - & - \tabularnewline
123 & 406 & - & - & - & - & - & - & - \tabularnewline
124 & 396 & - & - & - & - & - & - & - \tabularnewline
125 & 420 & - & - & - & - & - & - & - \tabularnewline
126 & 472 & - & - & - & - & - & - & - \tabularnewline
127 & 548 & - & - & - & - & - & - & - \tabularnewline
128 & 559 & - & - & - & - & - & - & - \tabularnewline
129 & 463 & - & - & - & - & - & - & - \tabularnewline
130 & 407 & - & - & - & - & - & - & - \tabularnewline
131 & 362 & - & - & - & - & - & - & - \tabularnewline
132 & 405 & - & - & - & - & - & - & - \tabularnewline
133 & 417 & 435.9938 & 379.6114 & 492.3763 & 0.2545 & 0.8594 & 0.9959 & 0.8594 \tabularnewline
134 & 391 & 447.6913 & 354.2265 & 541.1562 & 0.1173 & 0.7401 & 0.9867 & 0.8147 \tabularnewline
135 & 419 & 438.8378 & 320.9768 & 556.6988 & 0.3707 & 0.7868 & 0.7075 & 0.7132 \tabularnewline
136 & 461 & 428.5103 & 297.2417 & 559.7789 & 0.3138 & 0.5565 & 0.6863 & 0.6372 \tabularnewline
137 & 472 & 424.3841 & 283.7852 & 564.9829 & 0.2534 & 0.3049 & 0.5244 & 0.6065 \tabularnewline
138 & 535 & 426.2549 & 276.8249 & 575.6849 & 0.0769 & 0.2742 & 0.2742 & 0.6098 \tabularnewline
139 & 622 & 429.3833 & 270.3615 & 588.4052 & 0.0088 & 0.0965 & 0.0719 & 0.6181 \tabularnewline
140 & 606 & 430.8639 & 261.9555 & 599.7724 & 0.0211 & 0.0133 & 0.0685 & 0.618 \tabularnewline
141 & 508 & 430.5205 & 252.2094 & 608.8316 & 0.1972 & 0.0269 & 0.3605 & 0.6105 \tabularnewline
142 & 461 & 429.6096 & 242.6759 & 616.5433 & 0.371 & 0.2056 & 0.5937 & 0.6018 \tabularnewline
143 & 390 & 429.0965 & 234.1567 & 624.0363 & 0.3471 & 0.3742 & 0.75 & 0.5957 \tabularnewline
144 & 432 & 429.1332 & 226.5435 & 631.7228 & 0.4889 & 0.6475 & 0.5923 & 0.5923 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71336&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[132])[/C][/ROW]
[ROW][C]120[/C][C]337[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]360[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]342[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]406[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]396[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]420[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]472[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]548[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]559[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]463[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]407[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]131[/C][C]362[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]132[/C][C]405[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]133[/C][C]417[/C][C]435.9938[/C][C]379.6114[/C][C]492.3763[/C][C]0.2545[/C][C]0.8594[/C][C]0.9959[/C][C]0.8594[/C][/ROW]
[ROW][C]134[/C][C]391[/C][C]447.6913[/C][C]354.2265[/C][C]541.1562[/C][C]0.1173[/C][C]0.7401[/C][C]0.9867[/C][C]0.8147[/C][/ROW]
[ROW][C]135[/C][C]419[/C][C]438.8378[/C][C]320.9768[/C][C]556.6988[/C][C]0.3707[/C][C]0.7868[/C][C]0.7075[/C][C]0.7132[/C][/ROW]
[ROW][C]136[/C][C]461[/C][C]428.5103[/C][C]297.2417[/C][C]559.7789[/C][C]0.3138[/C][C]0.5565[/C][C]0.6863[/C][C]0.6372[/C][/ROW]
[ROW][C]137[/C][C]472[/C][C]424.3841[/C][C]283.7852[/C][C]564.9829[/C][C]0.2534[/C][C]0.3049[/C][C]0.5244[/C][C]0.6065[/C][/ROW]
[ROW][C]138[/C][C]535[/C][C]426.2549[/C][C]276.8249[/C][C]575.6849[/C][C]0.0769[/C][C]0.2742[/C][C]0.2742[/C][C]0.6098[/C][/ROW]
[ROW][C]139[/C][C]622[/C][C]429.3833[/C][C]270.3615[/C][C]588.4052[/C][C]0.0088[/C][C]0.0965[/C][C]0.0719[/C][C]0.6181[/C][/ROW]
[ROW][C]140[/C][C]606[/C][C]430.8639[/C][C]261.9555[/C][C]599.7724[/C][C]0.0211[/C][C]0.0133[/C][C]0.0685[/C][C]0.618[/C][/ROW]
[ROW][C]141[/C][C]508[/C][C]430.5205[/C][C]252.2094[/C][C]608.8316[/C][C]0.1972[/C][C]0.0269[/C][C]0.3605[/C][C]0.6105[/C][/ROW]
[ROW][C]142[/C][C]461[/C][C]429.6096[/C][C]242.6759[/C][C]616.5433[/C][C]0.371[/C][C]0.2056[/C][C]0.5937[/C][C]0.6018[/C][/ROW]
[ROW][C]143[/C][C]390[/C][C]429.0965[/C][C]234.1567[/C][C]624.0363[/C][C]0.3471[/C][C]0.3742[/C][C]0.75[/C][C]0.5957[/C][/ROW]
[ROW][C]144[/C][C]432[/C][C]429.1332[/C][C]226.5435[/C][C]631.7228[/C][C]0.4889[/C][C]0.6475[/C][C]0.5923[/C][C]0.5923[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71336&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71336&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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417435.9938379.6114492.37630.25450.85940.99590.8594
134391447.6913354.2265541.15620.11730.74010.98670.8147
135419438.8378320.9768556.69880.37070.78680.70750.7132
136461428.5103297.2417559.77890.31380.55650.68630.6372
137472424.3841283.7852564.98290.25340.30490.52440.6065
138535426.2549276.8249575.68490.07690.27420.27420.6098
139622429.3833270.3615588.40520.00880.09650.07190.6181
140606430.8639261.9555599.77240.02110.01330.06850.618
141508430.5205252.2094608.83160.19720.02690.36050.6105
142461429.6096242.6759616.54330.3710.20560.59370.6018
143390429.0965234.1567624.03630.34710.37420.750.5957
144432429.1332226.5435631.72280.48890.64750.59230.5923







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1330.066-0.04360360.764500
1340.1065-0.12660.08513213.90771787.336142.2769
1350.137-0.04520.0718393.53771322.736636.3694
1360.15630.07580.07281055.57911255.947235.4393
1370.1690.11220.08072267.27681458.213138.1866
1380.17890.25510.109811825.49073186.092756.4455
1390.1890.44860.158237101.17758031.104889.6164
1400.20.40650.189230672.648310861.2978104.2176
1410.21130.180.18826003.077310321.4955101.5948
1420.2220.07310.1767985.35839387.881896.8911
1430.2318-0.09110.16891528.53968673.396193.1311
1440.24090.00670.15548.21877951.29889.1701

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
133 & 0.066 & -0.0436 & 0 & 360.7645 & 0 & 0 \tabularnewline
134 & 0.1065 & -0.1266 & 0.0851 & 3213.9077 & 1787.3361 & 42.2769 \tabularnewline
135 & 0.137 & -0.0452 & 0.0718 & 393.5377 & 1322.7366 & 36.3694 \tabularnewline
136 & 0.1563 & 0.0758 & 0.0728 & 1055.5791 & 1255.9472 & 35.4393 \tabularnewline
137 & 0.169 & 0.1122 & 0.0807 & 2267.2768 & 1458.2131 & 38.1866 \tabularnewline
138 & 0.1789 & 0.2551 & 0.1098 & 11825.4907 & 3186.0927 & 56.4455 \tabularnewline
139 & 0.189 & 0.4486 & 0.1582 & 37101.1775 & 8031.1048 & 89.6164 \tabularnewline
140 & 0.2 & 0.4065 & 0.1892 & 30672.6483 & 10861.2978 & 104.2176 \tabularnewline
141 & 0.2113 & 0.18 & 0.1882 & 6003.0773 & 10321.4955 & 101.5948 \tabularnewline
142 & 0.222 & 0.0731 & 0.1767 & 985.3583 & 9387.8818 & 96.8911 \tabularnewline
143 & 0.2318 & -0.0911 & 0.1689 & 1528.5396 & 8673.3961 & 93.1311 \tabularnewline
144 & 0.2409 & 0.0067 & 0.1554 & 8.2187 & 7951.298 & 89.1701 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71336&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]133[/C][C]0.066[/C][C]-0.0436[/C][C]0[/C][C]360.7645[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]134[/C][C]0.1065[/C][C]-0.1266[/C][C]0.0851[/C][C]3213.9077[/C][C]1787.3361[/C][C]42.2769[/C][/ROW]
[ROW][C]135[/C][C]0.137[/C][C]-0.0452[/C][C]0.0718[/C][C]393.5377[/C][C]1322.7366[/C][C]36.3694[/C][/ROW]
[ROW][C]136[/C][C]0.1563[/C][C]0.0758[/C][C]0.0728[/C][C]1055.5791[/C][C]1255.9472[/C][C]35.4393[/C][/ROW]
[ROW][C]137[/C][C]0.169[/C][C]0.1122[/C][C]0.0807[/C][C]2267.2768[/C][C]1458.2131[/C][C]38.1866[/C][/ROW]
[ROW][C]138[/C][C]0.1789[/C][C]0.2551[/C][C]0.1098[/C][C]11825.4907[/C][C]3186.0927[/C][C]56.4455[/C][/ROW]
[ROW][C]139[/C][C]0.189[/C][C]0.4486[/C][C]0.1582[/C][C]37101.1775[/C][C]8031.1048[/C][C]89.6164[/C][/ROW]
[ROW][C]140[/C][C]0.2[/C][C]0.4065[/C][C]0.1892[/C][C]30672.6483[/C][C]10861.2978[/C][C]104.2176[/C][/ROW]
[ROW][C]141[/C][C]0.2113[/C][C]0.18[/C][C]0.1882[/C][C]6003.0773[/C][C]10321.4955[/C][C]101.5948[/C][/ROW]
[ROW][C]142[/C][C]0.222[/C][C]0.0731[/C][C]0.1767[/C][C]985.3583[/C][C]9387.8818[/C][C]96.8911[/C][/ROW]
[ROW][C]143[/C][C]0.2318[/C][C]-0.0911[/C][C]0.1689[/C][C]1528.5396[/C][C]8673.3961[/C][C]93.1311[/C][/ROW]
[ROW][C]144[/C][C]0.2409[/C][C]0.0067[/C][C]0.1554[/C][C]8.2187[/C][C]7951.298[/C][C]89.1701[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71336&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71336&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
1330.066-0.04360360.764500
1340.1065-0.12660.08513213.90771787.336142.2769
1350.137-0.04520.0718393.53771322.736636.3694
1360.15630.07580.07281055.57911255.947235.4393
1370.1690.11220.08072267.27681458.213138.1866
1380.17890.25510.109811825.49073186.092756.4455
1390.1890.44860.158237101.17758031.104889.6164
1400.20.40650.189230672.648310861.2978104.2176
1410.21130.180.18826003.077310321.4955101.5948
1420.2220.07310.1767985.35839387.881896.8911
1430.2318-0.09110.16891528.53968673.396193.1311
1440.24090.00670.15548.21877951.29889.1701



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 = 0 ; 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,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')