Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 10 Dec 2009 09:12:08 -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/t1260461644yxcnrot043iay03.htm/, Retrieved Thu, 28 Mar 2024 23:06:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65542, Retrieved Thu, 28 Mar 2024 23:06:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact148
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 16:12:08] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
23
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=65542&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=65542&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65542&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[50])
3824-------
3917-------
4021-------
4119-------
4222-------
4322-------
4418-------
4516-------
4614-------
4712-------
4814-------
4916-------
508-------
5135.5-2.089313.08930.25930.25930.00150.2593
5205.5-5.232816.23290.15760.6760.00230.324
5357.7501-5.39520.89510.34090.87610.04670.4851
5419.5001-5.678524.67870.13620.71940.05330.5768
5518.5002-8.4725.47030.19320.80680.05950.523
5637.7502-10.839726.34010.30820.76170.13990.4895
5765.2503-14.829125.32970.47080.58690.1470.3942
5875.5003-15.965426.96610.44550.48180.21880.4097
5984.5004-18.267527.26830.38160.41480.25930.3816
60145.0005-18.99928.99990.23120.40320.23120.4032
61144.5006-20.670229.67140.22970.22970.18530.3926
62134.3006-21.945630.54680.2580.23440.39120.3912

\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[50]) \tabularnewline
38 & 24 & - & - & - & - & - & - & - \tabularnewline
39 & 17 & - & - & - & - & - & - & - \tabularnewline
40 & 21 & - & - & - & - & - & - & - \tabularnewline
41 & 19 & - & - & - & - & - & - & - \tabularnewline
42 & 22 & - & - & - & - & - & - & - \tabularnewline
43 & 22 & - & - & - & - & - & - & - \tabularnewline
44 & 18 & - & - & - & - & - & - & - \tabularnewline
45 & 16 & - & - & - & - & - & - & - \tabularnewline
46 & 14 & - & - & - & - & - & - & - \tabularnewline
47 & 12 & - & - & - & - & - & - & - \tabularnewline
48 & 14 & - & - & - & - & - & - & - \tabularnewline
49 & 16 & - & - & - & - & - & - & - \tabularnewline
50 & 8 & - & - & - & - & - & - & - \tabularnewline
51 & 3 & 5.5 & -2.0893 & 13.0893 & 0.2593 & 0.2593 & 0.0015 & 0.2593 \tabularnewline
52 & 0 & 5.5 & -5.2328 & 16.2329 & 0.1576 & 0.676 & 0.0023 & 0.324 \tabularnewline
53 & 5 & 7.7501 & -5.395 & 20.8951 & 0.3409 & 0.8761 & 0.0467 & 0.4851 \tabularnewline
54 & 1 & 9.5001 & -5.6785 & 24.6787 & 0.1362 & 0.7194 & 0.0533 & 0.5768 \tabularnewline
55 & 1 & 8.5002 & -8.47 & 25.4703 & 0.1932 & 0.8068 & 0.0595 & 0.523 \tabularnewline
56 & 3 & 7.7502 & -10.8397 & 26.3401 & 0.3082 & 0.7617 & 0.1399 & 0.4895 \tabularnewline
57 & 6 & 5.2503 & -14.8291 & 25.3297 & 0.4708 & 0.5869 & 0.147 & 0.3942 \tabularnewline
58 & 7 & 5.5003 & -15.9654 & 26.9661 & 0.4455 & 0.4818 & 0.2188 & 0.4097 \tabularnewline
59 & 8 & 4.5004 & -18.2675 & 27.2683 & 0.3816 & 0.4148 & 0.2593 & 0.3816 \tabularnewline
60 & 14 & 5.0005 & -18.999 & 28.9999 & 0.2312 & 0.4032 & 0.2312 & 0.4032 \tabularnewline
61 & 14 & 4.5006 & -20.6702 & 29.6714 & 0.2297 & 0.2297 & 0.1853 & 0.3926 \tabularnewline
62 & 13 & 4.3006 & -21.9456 & 30.5468 & 0.258 & 0.2344 & 0.3912 & 0.3912 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65542&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[50])[/C][/ROW]
[ROW][C]38[/C][C]24[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]19[/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]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]12[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]3[/C][C]5.5[/C][C]-2.0893[/C][C]13.0893[/C][C]0.2593[/C][C]0.2593[/C][C]0.0015[/C][C]0.2593[/C][/ROW]
[ROW][C]52[/C][C]0[/C][C]5.5[/C][C]-5.2328[/C][C]16.2329[/C][C]0.1576[/C][C]0.676[/C][C]0.0023[/C][C]0.324[/C][/ROW]
[ROW][C]53[/C][C]5[/C][C]7.7501[/C][C]-5.395[/C][C]20.8951[/C][C]0.3409[/C][C]0.8761[/C][C]0.0467[/C][C]0.4851[/C][/ROW]
[ROW][C]54[/C][C]1[/C][C]9.5001[/C][C]-5.6785[/C][C]24.6787[/C][C]0.1362[/C][C]0.7194[/C][C]0.0533[/C][C]0.5768[/C][/ROW]
[ROW][C]55[/C][C]1[/C][C]8.5002[/C][C]-8.47[/C][C]25.4703[/C][C]0.1932[/C][C]0.8068[/C][C]0.0595[/C][C]0.523[/C][/ROW]
[ROW][C]56[/C][C]3[/C][C]7.7502[/C][C]-10.8397[/C][C]26.3401[/C][C]0.3082[/C][C]0.7617[/C][C]0.1399[/C][C]0.4895[/C][/ROW]
[ROW][C]57[/C][C]6[/C][C]5.2503[/C][C]-14.8291[/C][C]25.3297[/C][C]0.4708[/C][C]0.5869[/C][C]0.147[/C][C]0.3942[/C][/ROW]
[ROW][C]58[/C][C]7[/C][C]5.5003[/C][C]-15.9654[/C][C]26.9661[/C][C]0.4455[/C][C]0.4818[/C][C]0.2188[/C][C]0.4097[/C][/ROW]
[ROW][C]59[/C][C]8[/C][C]4.5004[/C][C]-18.2675[/C][C]27.2683[/C][C]0.3816[/C][C]0.4148[/C][C]0.2593[/C][C]0.3816[/C][/ROW]
[ROW][C]60[/C][C]14[/C][C]5.0005[/C][C]-18.999[/C][C]28.9999[/C][C]0.2312[/C][C]0.4032[/C][C]0.2312[/C][C]0.4032[/C][/ROW]
[ROW][C]61[/C][C]14[/C][C]4.5006[/C][C]-20.6702[/C][C]29.6714[/C][C]0.2297[/C][C]0.2297[/C][C]0.1853[/C][C]0.3926[/C][/ROW]
[ROW][C]62[/C][C]13[/C][C]4.3006[/C][C]-21.9456[/C][C]30.5468[/C][C]0.258[/C][C]0.2344[/C][C]0.3912[/C][C]0.3912[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65542&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65542&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[50])
3824-------
3917-------
4021-------
4119-------
4222-------
4322-------
4418-------
4516-------
4614-------
4712-------
4814-------
4916-------
508-------
5135.5-2.089313.08930.25930.25930.00150.2593
5205.5-5.232816.23290.15760.6760.00230.324
5357.7501-5.39520.89510.34090.87610.04670.4851
5419.5001-5.678524.67870.13620.71940.05330.5768
5518.5002-8.4725.47030.19320.80680.05950.523
5637.7502-10.839726.34010.30820.76170.13990.4895
5765.2503-14.829125.32970.47080.58690.1470.3942
5875.5003-15.965426.96610.44550.48180.21880.4097
5984.5004-18.267527.26830.38160.41480.25930.3816
60145.0005-18.99928.99990.23120.40320.23120.4032
61144.5006-20.670229.67140.22970.22970.18530.3926
62134.3006-21.945630.54680.2580.23440.39120.3912







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
510.704-0.454506.250100
520.9956-10.727330.250518.25034.272
530.8654-0.35480.60317.562914.68783.8325
540.8152-0.89470.67672.25229.07895.3925
551.0186-0.88240.717356.252434.51365.8748
561.2238-0.61290.699922.564532.52215.7028
571.95120.14280.62030.562127.95645.2874
581.99110.27260.57692.24924.74294.9742
592.58120.77760.599212.247123.35454.8327
602.44871.79970.719280.991229.11825.3961
612.85352.11070.845790.239134.67465.8885
623.11372.02280.943875.679838.09176.1719

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
51 & 0.704 & -0.4545 & 0 & 6.2501 & 0 & 0 \tabularnewline
52 & 0.9956 & -1 & 0.7273 & 30.2505 & 18.2503 & 4.272 \tabularnewline
53 & 0.8654 & -0.3548 & 0.6031 & 7.5629 & 14.6878 & 3.8325 \tabularnewline
54 & 0.8152 & -0.8947 & 0.676 & 72.252 & 29.0789 & 5.3925 \tabularnewline
55 & 1.0186 & -0.8824 & 0.7173 & 56.2524 & 34.5136 & 5.8748 \tabularnewline
56 & 1.2238 & -0.6129 & 0.6999 & 22.5645 & 32.5221 & 5.7028 \tabularnewline
57 & 1.9512 & 0.1428 & 0.6203 & 0.5621 & 27.9564 & 5.2874 \tabularnewline
58 & 1.9911 & 0.2726 & 0.5769 & 2.249 & 24.7429 & 4.9742 \tabularnewline
59 & 2.5812 & 0.7776 & 0.5992 & 12.2471 & 23.3545 & 4.8327 \tabularnewline
60 & 2.4487 & 1.7997 & 0.7192 & 80.9912 & 29.1182 & 5.3961 \tabularnewline
61 & 2.8535 & 2.1107 & 0.8457 & 90.2391 & 34.6746 & 5.8885 \tabularnewline
62 & 3.1137 & 2.0228 & 0.9438 & 75.6798 & 38.0917 & 6.1719 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65542&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]51[/C][C]0.704[/C][C]-0.4545[/C][C]0[/C][C]6.2501[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]52[/C][C]0.9956[/C][C]-1[/C][C]0.7273[/C][C]30.2505[/C][C]18.2503[/C][C]4.272[/C][/ROW]
[ROW][C]53[/C][C]0.8654[/C][C]-0.3548[/C][C]0.6031[/C][C]7.5629[/C][C]14.6878[/C][C]3.8325[/C][/ROW]
[ROW][C]54[/C][C]0.8152[/C][C]-0.8947[/C][C]0.676[/C][C]72.252[/C][C]29.0789[/C][C]5.3925[/C][/ROW]
[ROW][C]55[/C][C]1.0186[/C][C]-0.8824[/C][C]0.7173[/C][C]56.2524[/C][C]34.5136[/C][C]5.8748[/C][/ROW]
[ROW][C]56[/C][C]1.2238[/C][C]-0.6129[/C][C]0.6999[/C][C]22.5645[/C][C]32.5221[/C][C]5.7028[/C][/ROW]
[ROW][C]57[/C][C]1.9512[/C][C]0.1428[/C][C]0.6203[/C][C]0.5621[/C][C]27.9564[/C][C]5.2874[/C][/ROW]
[ROW][C]58[/C][C]1.9911[/C][C]0.2726[/C][C]0.5769[/C][C]2.249[/C][C]24.7429[/C][C]4.9742[/C][/ROW]
[ROW][C]59[/C][C]2.5812[/C][C]0.7776[/C][C]0.5992[/C][C]12.2471[/C][C]23.3545[/C][C]4.8327[/C][/ROW]
[ROW][C]60[/C][C]2.4487[/C][C]1.7997[/C][C]0.7192[/C][C]80.9912[/C][C]29.1182[/C][C]5.3961[/C][/ROW]
[ROW][C]61[/C][C]2.8535[/C][C]2.1107[/C][C]0.8457[/C][C]90.2391[/C][C]34.6746[/C][C]5.8885[/C][/ROW]
[ROW][C]62[/C][C]3.1137[/C][C]2.0228[/C][C]0.9438[/C][C]75.6798[/C][C]38.0917[/C][C]6.1719[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65542&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65542&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
510.704-0.454506.250100
520.9956-10.727330.250518.25034.272
530.8654-0.35480.60317.562914.68783.8325
540.8152-0.89470.67672.25229.07895.3925
551.0186-0.88240.717356.252434.51365.8748
561.2238-0.61290.699922.564532.52215.7028
571.95120.14280.62030.562127.95645.2874
581.99110.27260.57692.24924.74294.9742
592.58120.77760.599212.247123.35454.8327
602.44871.79970.719280.991229.11825.3961
612.85352.11070.845790.239134.67465.8885
623.11372.02280.943875.679838.09176.1719



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