Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 13 Dec 2007 14:34:13 -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/13/t1197580745zqtb62g2u8at2ui.htm/, Retrieved Sun, 05 May 2024 15:28:19 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3744, Retrieved Sun, 05 May 2024 15:28:19 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsLise Swinnen Diesel
Estimated Impact188
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [paper diesel (for...] [2007-12-13 21:34:13] [a526d213baffe7453818dd375c9a7100] [Current]
Feedback Forum

Post a new message
Dataseries X:
0,76
0,77
0,76
0,77
0,78
0,79
0,78
0,76
0,78
0,76
0,74
0,73
0,72
0,71
0,73
0,75
0,75
0,72
0,72
0,72
0,74
0,78
0,74
0,74
0,75
0,78
0,81
0,75
0,7
0,71
0,71
0,73
0,74
0,74
0,75
0,74
0,74
0,73
0,76
0,8
0,83
0,81
0,83
0,88
0,89
0,93
0,91
0,9
0,86
0,88
0,93
0,98
0,97
1,03
1,06
1,06
1,08
1,09
1,04
1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3744&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])
360.74-------
370.74-------
380.73-------
390.76-------
400.8-------
410.83-------
420.81-------
430.83-------
440.88-------
450.89-------
460.93-------
470.91-------
480.9-------
490.860.90.84730.95740.0860.510.5
500.880.90250.8290.98550.29730.842410.5239
510.930.89510.80720.9970.25090.61420.99530.4624
520.980.88590.78691.00320.0580.23060.92430.4068
530.970.87950.77091.01070.08820.06660.770.3796
541.030.88370.7651.02990.02490.12360.83850.4135
551.060.87950.75311.03770.01270.03110.730.3996
561.060.86960.73751.03740.01310.01310.45170.3613
571.080.86770.72891.04660.010.01760.40370.3619
581.090.86060.71681.04830.00830.0110.23440.3405
591.040.86410.71341.06350.04190.01320.3260.3622
6010.86590.70891.07630.10580.05240.37540.3754

\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 & 0.74 & - & - & - & - & - & - & - \tabularnewline
37 & 0.74 & - & - & - & - & - & - & - \tabularnewline
38 & 0.73 & - & - & - & - & - & - & - \tabularnewline
39 & 0.76 & - & - & - & - & - & - & - \tabularnewline
40 & 0.8 & - & - & - & - & - & - & - \tabularnewline
41 & 0.83 & - & - & - & - & - & - & - \tabularnewline
42 & 0.81 & - & - & - & - & - & - & - \tabularnewline
43 & 0.83 & - & - & - & - & - & - & - \tabularnewline
44 & 0.88 & - & - & - & - & - & - & - \tabularnewline
45 & 0.89 & - & - & - & - & - & - & - \tabularnewline
46 & 0.93 & - & - & - & - & - & - & - \tabularnewline
47 & 0.91 & - & - & - & - & - & - & - \tabularnewline
48 & 0.9 & - & - & - & - & - & - & - \tabularnewline
49 & 0.86 & 0.9 & 0.8473 & 0.9574 & 0.086 & 0.5 & 1 & 0.5 \tabularnewline
50 & 0.88 & 0.9025 & 0.829 & 0.9855 & 0.2973 & 0.8424 & 1 & 0.5239 \tabularnewline
51 & 0.93 & 0.8951 & 0.8072 & 0.997 & 0.2509 & 0.6142 & 0.9953 & 0.4624 \tabularnewline
52 & 0.98 & 0.8859 & 0.7869 & 1.0032 & 0.058 & 0.2306 & 0.9243 & 0.4068 \tabularnewline
53 & 0.97 & 0.8795 & 0.7709 & 1.0107 & 0.0882 & 0.0666 & 0.77 & 0.3796 \tabularnewline
54 & 1.03 & 0.8837 & 0.765 & 1.0299 & 0.0249 & 0.1236 & 0.8385 & 0.4135 \tabularnewline
55 & 1.06 & 0.8795 & 0.7531 & 1.0377 & 0.0127 & 0.0311 & 0.73 & 0.3996 \tabularnewline
56 & 1.06 & 0.8696 & 0.7375 & 1.0374 & 0.0131 & 0.0131 & 0.4517 & 0.3613 \tabularnewline
57 & 1.08 & 0.8677 & 0.7289 & 1.0466 & 0.01 & 0.0176 & 0.4037 & 0.3619 \tabularnewline
58 & 1.09 & 0.8606 & 0.7168 & 1.0483 & 0.0083 & 0.011 & 0.2344 & 0.3405 \tabularnewline
59 & 1.04 & 0.8641 & 0.7134 & 1.0635 & 0.0419 & 0.0132 & 0.326 & 0.3622 \tabularnewline
60 & 1 & 0.8659 & 0.7089 & 1.0763 & 0.1058 & 0.0524 & 0.3754 & 0.3754 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3744&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]0.74[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]0.74[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]0.73[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]0.76[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]0.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]0.83[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]0.81[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]0.83[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]0.88[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]0.89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]0.93[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]0.91[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]0.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]0.86[/C][C]0.9[/C][C]0.8473[/C][C]0.9574[/C][C]0.086[/C][C]0.5[/C][C]1[/C][C]0.5[/C][/ROW]
[ROW][C]50[/C][C]0.88[/C][C]0.9025[/C][C]0.829[/C][C]0.9855[/C][C]0.2973[/C][C]0.8424[/C][C]1[/C][C]0.5239[/C][/ROW]
[ROW][C]51[/C][C]0.93[/C][C]0.8951[/C][C]0.8072[/C][C]0.997[/C][C]0.2509[/C][C]0.6142[/C][C]0.9953[/C][C]0.4624[/C][/ROW]
[ROW][C]52[/C][C]0.98[/C][C]0.8859[/C][C]0.7869[/C][C]1.0032[/C][C]0.058[/C][C]0.2306[/C][C]0.9243[/C][C]0.4068[/C][/ROW]
[ROW][C]53[/C][C]0.97[/C][C]0.8795[/C][C]0.7709[/C][C]1.0107[/C][C]0.0882[/C][C]0.0666[/C][C]0.77[/C][C]0.3796[/C][/ROW]
[ROW][C]54[/C][C]1.03[/C][C]0.8837[/C][C]0.765[/C][C]1.0299[/C][C]0.0249[/C][C]0.1236[/C][C]0.8385[/C][C]0.4135[/C][/ROW]
[ROW][C]55[/C][C]1.06[/C][C]0.8795[/C][C]0.7531[/C][C]1.0377[/C][C]0.0127[/C][C]0.0311[/C][C]0.73[/C][C]0.3996[/C][/ROW]
[ROW][C]56[/C][C]1.06[/C][C]0.8696[/C][C]0.7375[/C][C]1.0374[/C][C]0.0131[/C][C]0.0131[/C][C]0.4517[/C][C]0.3613[/C][/ROW]
[ROW][C]57[/C][C]1.08[/C][C]0.8677[/C][C]0.7289[/C][C]1.0466[/C][C]0.01[/C][C]0.0176[/C][C]0.4037[/C][C]0.3619[/C][/ROW]
[ROW][C]58[/C][C]1.09[/C][C]0.8606[/C][C]0.7168[/C][C]1.0483[/C][C]0.0083[/C][C]0.011[/C][C]0.2344[/C][C]0.3405[/C][/ROW]
[ROW][C]59[/C][C]1.04[/C][C]0.8641[/C][C]0.7134[/C][C]1.0635[/C][C]0.0419[/C][C]0.0132[/C][C]0.326[/C][C]0.3622[/C][/ROW]
[ROW][C]60[/C][C]1[/C][C]0.8659[/C][C]0.7089[/C][C]1.0763[/C][C]0.1058[/C][C]0.0524[/C][C]0.3754[/C][C]0.3754[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3744&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3744&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])
360.74-------
370.74-------
380.73-------
390.76-------
400.8-------
410.83-------
420.81-------
430.83-------
440.88-------
450.89-------
460.93-------
470.91-------
480.9-------
490.860.90.84730.95740.0860.510.5
500.880.90250.8290.98550.29730.842410.5239
510.930.89510.80720.9970.25090.61420.99530.4624
520.980.88590.78691.00320.0580.23060.92430.4068
530.970.87950.77091.01070.08820.06660.770.3796
541.030.88370.7651.02990.02490.12360.83850.4135
551.060.87950.75311.03770.01270.03110.730.3996
561.060.86960.73751.03740.01310.01310.45170.3613
571.080.86770.72891.04660.010.01760.40370.3619
581.090.86060.71681.04830.00830.0110.23440.3405
591.040.86410.71341.06350.04190.01320.3260.3622
6010.86590.70891.07630.10580.05240.37540.3754







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0325-0.04440.00370.00161e-040.0115
500.0469-0.0250.00215e-0400.0065
510.05810.0390.00330.00121e-040.0101
520.06760.10620.00890.00897e-040.0272
530.07610.10290.00860.00827e-040.0261
540.08440.16550.01380.02140.00180.0422
550.09180.20530.01710.03260.00270.0521
560.09840.21890.01820.03620.0030.055
570.10510.24460.02040.04510.00380.0613
580.11120.26650.02220.05260.00440.0662
590.11770.20350.0170.03090.00260.0508
600.12390.15480.01290.0180.00150.0387

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0325 & -0.0444 & 0.0037 & 0.0016 & 1e-04 & 0.0115 \tabularnewline
50 & 0.0469 & -0.025 & 0.0021 & 5e-04 & 0 & 0.0065 \tabularnewline
51 & 0.0581 & 0.039 & 0.0033 & 0.0012 & 1e-04 & 0.0101 \tabularnewline
52 & 0.0676 & 0.1062 & 0.0089 & 0.0089 & 7e-04 & 0.0272 \tabularnewline
53 & 0.0761 & 0.1029 & 0.0086 & 0.0082 & 7e-04 & 0.0261 \tabularnewline
54 & 0.0844 & 0.1655 & 0.0138 & 0.0214 & 0.0018 & 0.0422 \tabularnewline
55 & 0.0918 & 0.2053 & 0.0171 & 0.0326 & 0.0027 & 0.0521 \tabularnewline
56 & 0.0984 & 0.2189 & 0.0182 & 0.0362 & 0.003 & 0.055 \tabularnewline
57 & 0.1051 & 0.2446 & 0.0204 & 0.0451 & 0.0038 & 0.0613 \tabularnewline
58 & 0.1112 & 0.2665 & 0.0222 & 0.0526 & 0.0044 & 0.0662 \tabularnewline
59 & 0.1177 & 0.2035 & 0.017 & 0.0309 & 0.0026 & 0.0508 \tabularnewline
60 & 0.1239 & 0.1548 & 0.0129 & 0.018 & 0.0015 & 0.0387 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3744&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.0325[/C][C]-0.0444[/C][C]0.0037[/C][C]0.0016[/C][C]1e-04[/C][C]0.0115[/C][/ROW]
[ROW][C]50[/C][C]0.0469[/C][C]-0.025[/C][C]0.0021[/C][C]5e-04[/C][C]0[/C][C]0.0065[/C][/ROW]
[ROW][C]51[/C][C]0.0581[/C][C]0.039[/C][C]0.0033[/C][C]0.0012[/C][C]1e-04[/C][C]0.0101[/C][/ROW]
[ROW][C]52[/C][C]0.0676[/C][C]0.1062[/C][C]0.0089[/C][C]0.0089[/C][C]7e-04[/C][C]0.0272[/C][/ROW]
[ROW][C]53[/C][C]0.0761[/C][C]0.1029[/C][C]0.0086[/C][C]0.0082[/C][C]7e-04[/C][C]0.0261[/C][/ROW]
[ROW][C]54[/C][C]0.0844[/C][C]0.1655[/C][C]0.0138[/C][C]0.0214[/C][C]0.0018[/C][C]0.0422[/C][/ROW]
[ROW][C]55[/C][C]0.0918[/C][C]0.2053[/C][C]0.0171[/C][C]0.0326[/C][C]0.0027[/C][C]0.0521[/C][/ROW]
[ROW][C]56[/C][C]0.0984[/C][C]0.2189[/C][C]0.0182[/C][C]0.0362[/C][C]0.003[/C][C]0.055[/C][/ROW]
[ROW][C]57[/C][C]0.1051[/C][C]0.2446[/C][C]0.0204[/C][C]0.0451[/C][C]0.0038[/C][C]0.0613[/C][/ROW]
[ROW][C]58[/C][C]0.1112[/C][C]0.2665[/C][C]0.0222[/C][C]0.0526[/C][C]0.0044[/C][C]0.0662[/C][/ROW]
[ROW][C]59[/C][C]0.1177[/C][C]0.2035[/C][C]0.017[/C][C]0.0309[/C][C]0.0026[/C][C]0.0508[/C][/ROW]
[ROW][C]60[/C][C]0.1239[/C][C]0.1548[/C][C]0.0129[/C][C]0.018[/C][C]0.0015[/C][C]0.0387[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3744&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3744&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.0325-0.04440.00370.00161e-040.0115
500.0469-0.0250.00215e-0400.0065
510.05810.0390.00330.00121e-040.0101
520.06760.10620.00890.00897e-040.0272
530.07610.10290.00860.00827e-040.0261
540.08440.16550.01380.02140.00180.0422
550.09180.20530.01710.03260.00270.0521
560.09840.21890.01820.03620.0030.055
570.10510.24460.02040.04510.00380.0613
580.11120.26650.02220.05260.00440.0662
590.11770.20350.0170.03090.00260.0508
600.12390.15480.01290.0180.00150.0387



Parameters (Session):
par1 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = -0.4 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; 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,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)
}
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.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')