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 computationMon, 14 Dec 2009 16:34:49 -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/15/t12608337629e0iho6g7vwxew4.htm/, Retrieved Wed, 08 May 2024 22:21:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=67737, Retrieved Wed, 08 May 2024 22:21:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact152
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
F R PD  [ARIMA Forecasting] [forecasting] [2009-12-11 11:08:14] [a94022e7c2399c0f4d62eea578db3411]
- R PD      [ARIMA Forecasting] [WS10 - review for...] [2009-12-14 23:34:49] [0cc924834281808eda7297686c82928f] [Current]
Feedback Forum

Post a new message
Dataseries X:
10
9.2
9.2
9.5
9.6
9.5
9.1
8.9
9
10.1
10.3
10.2
9.6
9.2
9.3
9.4
9.4
9.2
9
9
9
9.8
10
9.8
9.3
9
9
9.1
9.1
9.1
9.2
8.8
8.3
8.4
8.1
7.7
7.9
7.9
8
7.9
7.6
7.1
6.8
6.5
6.9
8.2
8.7
8.3
7.9
7.5
7.8
8.3
8.4
8.2
7.7
7.2
7.3
8.1
8.5




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67737&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 time2 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[47])
358.1-------
367.7-------
377.9-------
387.9-------
398-------
407.9-------
417.6-------
427.1-------
436.8-------
446.5-------
456.9-------
468.2-------
478.7-------
488.38.25387.80928.69850.41930.02460.99270.0246
497.97.69596.77478.61710.33210.09930.33210.0163
507.56.91645.58638.24650.19490.07360.07360.0043
517.86.75295.19558.31030.09380.17360.05830.0071
528.36.82135.17318.46960.03930.12230.09980.0127
538.47.07465.39798.75120.06060.0760.26950.0287
548.27.03775.3398.73630.08990.0580.47130.0276
557.76.99445.25148.73740.21380.08760.58650.0276
567.26.49414.65518.33320.22590.09940.49750.0094
577.36.42814.46018.39610.19260.2210.31920.0118
588.17.16475.0749.25530.19030.44950.16590.075
598.57.47865.30499.65240.17850.28760.13540.1354

\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[47]) \tabularnewline
35 & 8.1 & - & - & - & - & - & - & - \tabularnewline
36 & 7.7 & - & - & - & - & - & - & - \tabularnewline
37 & 7.9 & - & - & - & - & - & - & - \tabularnewline
38 & 7.9 & - & - & - & - & - & - & - \tabularnewline
39 & 8 & - & - & - & - & - & - & - \tabularnewline
40 & 7.9 & - & - & - & - & - & - & - \tabularnewline
41 & 7.6 & - & - & - & - & - & - & - \tabularnewline
42 & 7.1 & - & - & - & - & - & - & - \tabularnewline
43 & 6.8 & - & - & - & - & - & - & - \tabularnewline
44 & 6.5 & - & - & - & - & - & - & - \tabularnewline
45 & 6.9 & - & - & - & - & - & - & - \tabularnewline
46 & 8.2 & - & - & - & - & - & - & - \tabularnewline
47 & 8.7 & - & - & - & - & - & - & - \tabularnewline
48 & 8.3 & 8.2538 & 7.8092 & 8.6985 & 0.4193 & 0.0246 & 0.9927 & 0.0246 \tabularnewline
49 & 7.9 & 7.6959 & 6.7747 & 8.6171 & 0.3321 & 0.0993 & 0.3321 & 0.0163 \tabularnewline
50 & 7.5 & 6.9164 & 5.5863 & 8.2465 & 0.1949 & 0.0736 & 0.0736 & 0.0043 \tabularnewline
51 & 7.8 & 6.7529 & 5.1955 & 8.3103 & 0.0938 & 0.1736 & 0.0583 & 0.0071 \tabularnewline
52 & 8.3 & 6.8213 & 5.1731 & 8.4696 & 0.0393 & 0.1223 & 0.0998 & 0.0127 \tabularnewline
53 & 8.4 & 7.0746 & 5.3979 & 8.7512 & 0.0606 & 0.076 & 0.2695 & 0.0287 \tabularnewline
54 & 8.2 & 7.0377 & 5.339 & 8.7363 & 0.0899 & 0.058 & 0.4713 & 0.0276 \tabularnewline
55 & 7.7 & 6.9944 & 5.2514 & 8.7374 & 0.2138 & 0.0876 & 0.5865 & 0.0276 \tabularnewline
56 & 7.2 & 6.4941 & 4.6551 & 8.3332 & 0.2259 & 0.0994 & 0.4975 & 0.0094 \tabularnewline
57 & 7.3 & 6.4281 & 4.4601 & 8.3961 & 0.1926 & 0.221 & 0.3192 & 0.0118 \tabularnewline
58 & 8.1 & 7.1647 & 5.074 & 9.2553 & 0.1903 & 0.4495 & 0.1659 & 0.075 \tabularnewline
59 & 8.5 & 7.4786 & 5.3049 & 9.6524 & 0.1785 & 0.2876 & 0.1354 & 0.1354 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67737&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[47])[/C][/ROW]
[ROW][C]35[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]7.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]7.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]7.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]6.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]6.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]6.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]8.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]8.3[/C][C]8.2538[/C][C]7.8092[/C][C]8.6985[/C][C]0.4193[/C][C]0.0246[/C][C]0.9927[/C][C]0.0246[/C][/ROW]
[ROW][C]49[/C][C]7.9[/C][C]7.6959[/C][C]6.7747[/C][C]8.6171[/C][C]0.3321[/C][C]0.0993[/C][C]0.3321[/C][C]0.0163[/C][/ROW]
[ROW][C]50[/C][C]7.5[/C][C]6.9164[/C][C]5.5863[/C][C]8.2465[/C][C]0.1949[/C][C]0.0736[/C][C]0.0736[/C][C]0.0043[/C][/ROW]
[ROW][C]51[/C][C]7.8[/C][C]6.7529[/C][C]5.1955[/C][C]8.3103[/C][C]0.0938[/C][C]0.1736[/C][C]0.0583[/C][C]0.0071[/C][/ROW]
[ROW][C]52[/C][C]8.3[/C][C]6.8213[/C][C]5.1731[/C][C]8.4696[/C][C]0.0393[/C][C]0.1223[/C][C]0.0998[/C][C]0.0127[/C][/ROW]
[ROW][C]53[/C][C]8.4[/C][C]7.0746[/C][C]5.3979[/C][C]8.7512[/C][C]0.0606[/C][C]0.076[/C][C]0.2695[/C][C]0.0287[/C][/ROW]
[ROW][C]54[/C][C]8.2[/C][C]7.0377[/C][C]5.339[/C][C]8.7363[/C][C]0.0899[/C][C]0.058[/C][C]0.4713[/C][C]0.0276[/C][/ROW]
[ROW][C]55[/C][C]7.7[/C][C]6.9944[/C][C]5.2514[/C][C]8.7374[/C][C]0.2138[/C][C]0.0876[/C][C]0.5865[/C][C]0.0276[/C][/ROW]
[ROW][C]56[/C][C]7.2[/C][C]6.4941[/C][C]4.6551[/C][C]8.3332[/C][C]0.2259[/C][C]0.0994[/C][C]0.4975[/C][C]0.0094[/C][/ROW]
[ROW][C]57[/C][C]7.3[/C][C]6.4281[/C][C]4.4601[/C][C]8.3961[/C][C]0.1926[/C][C]0.221[/C][C]0.3192[/C][C]0.0118[/C][/ROW]
[ROW][C]58[/C][C]8.1[/C][C]7.1647[/C][C]5.074[/C][C]9.2553[/C][C]0.1903[/C][C]0.4495[/C][C]0.1659[/C][C]0.075[/C][/ROW]
[ROW][C]59[/C][C]8.5[/C][C]7.4786[/C][C]5.3049[/C][C]9.6524[/C][C]0.1785[/C][C]0.2876[/C][C]0.1354[/C][C]0.1354[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67737&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67737&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[47])
358.1-------
367.7-------
377.9-------
387.9-------
398-------
407.9-------
417.6-------
427.1-------
436.8-------
446.5-------
456.9-------
468.2-------
478.7-------
488.38.25387.80928.69850.41930.02460.99270.0246
497.97.69596.77478.61710.33210.09930.33210.0163
507.56.91645.58638.24650.19490.07360.07360.0043
517.86.75295.19558.31030.09380.17360.05830.0071
528.36.82135.17318.46960.03930.12230.09980.0127
538.47.07465.39798.75120.06060.0760.26950.0287
548.27.03775.3398.73630.08990.0580.47130.0276
557.76.99445.25148.73740.21380.08760.58650.0276
567.26.49414.65518.33320.22590.09940.49750.0094
577.36.42814.46018.39610.19260.2210.31920.0118
588.17.16475.0749.25530.19030.44950.16590.075
598.57.47865.30499.65240.17850.28760.13540.1354







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
480.02750.005600.002100
490.06110.02650.01610.04160.02190.148
500.09810.08440.03880.34060.12810.3579
510.11770.15510.06791.09640.37020.6084
520.12330.21680.09772.18640.73340.8564
530.12090.18740.11261.75680.9040.9508
540.12310.16520.12011.3510.96790.9838
550.12710.10090.11770.49790.90910.9535
560.14450.10870.11670.49830.86350.9292
570.15620.13560.11860.76020.85310.9237
580.14890.13050.11970.87490.85510.9247
590.14830.13660.12111.04320.87080.9332

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
48 & 0.0275 & 0.0056 & 0 & 0.0021 & 0 & 0 \tabularnewline
49 & 0.0611 & 0.0265 & 0.0161 & 0.0416 & 0.0219 & 0.148 \tabularnewline
50 & 0.0981 & 0.0844 & 0.0388 & 0.3406 & 0.1281 & 0.3579 \tabularnewline
51 & 0.1177 & 0.1551 & 0.0679 & 1.0964 & 0.3702 & 0.6084 \tabularnewline
52 & 0.1233 & 0.2168 & 0.0977 & 2.1864 & 0.7334 & 0.8564 \tabularnewline
53 & 0.1209 & 0.1874 & 0.1126 & 1.7568 & 0.904 & 0.9508 \tabularnewline
54 & 0.1231 & 0.1652 & 0.1201 & 1.351 & 0.9679 & 0.9838 \tabularnewline
55 & 0.1271 & 0.1009 & 0.1177 & 0.4979 & 0.9091 & 0.9535 \tabularnewline
56 & 0.1445 & 0.1087 & 0.1167 & 0.4983 & 0.8635 & 0.9292 \tabularnewline
57 & 0.1562 & 0.1356 & 0.1186 & 0.7602 & 0.8531 & 0.9237 \tabularnewline
58 & 0.1489 & 0.1305 & 0.1197 & 0.8749 & 0.8551 & 0.9247 \tabularnewline
59 & 0.1483 & 0.1366 & 0.1211 & 1.0432 & 0.8708 & 0.9332 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67737&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]48[/C][C]0.0275[/C][C]0.0056[/C][C]0[/C][C]0.0021[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]49[/C][C]0.0611[/C][C]0.0265[/C][C]0.0161[/C][C]0.0416[/C][C]0.0219[/C][C]0.148[/C][/ROW]
[ROW][C]50[/C][C]0.0981[/C][C]0.0844[/C][C]0.0388[/C][C]0.3406[/C][C]0.1281[/C][C]0.3579[/C][/ROW]
[ROW][C]51[/C][C]0.1177[/C][C]0.1551[/C][C]0.0679[/C][C]1.0964[/C][C]0.3702[/C][C]0.6084[/C][/ROW]
[ROW][C]52[/C][C]0.1233[/C][C]0.2168[/C][C]0.0977[/C][C]2.1864[/C][C]0.7334[/C][C]0.8564[/C][/ROW]
[ROW][C]53[/C][C]0.1209[/C][C]0.1874[/C][C]0.1126[/C][C]1.7568[/C][C]0.904[/C][C]0.9508[/C][/ROW]
[ROW][C]54[/C][C]0.1231[/C][C]0.1652[/C][C]0.1201[/C][C]1.351[/C][C]0.9679[/C][C]0.9838[/C][/ROW]
[ROW][C]55[/C][C]0.1271[/C][C]0.1009[/C][C]0.1177[/C][C]0.4979[/C][C]0.9091[/C][C]0.9535[/C][/ROW]
[ROW][C]56[/C][C]0.1445[/C][C]0.1087[/C][C]0.1167[/C][C]0.4983[/C][C]0.8635[/C][C]0.9292[/C][/ROW]
[ROW][C]57[/C][C]0.1562[/C][C]0.1356[/C][C]0.1186[/C][C]0.7602[/C][C]0.8531[/C][C]0.9237[/C][/ROW]
[ROW][C]58[/C][C]0.1489[/C][C]0.1305[/C][C]0.1197[/C][C]0.8749[/C][C]0.8551[/C][C]0.9247[/C][/ROW]
[ROW][C]59[/C][C]0.1483[/C][C]0.1366[/C][C]0.1211[/C][C]1.0432[/C][C]0.8708[/C][C]0.9332[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67737&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67737&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
480.02750.005600.002100
490.06110.02650.01610.04160.02190.148
500.09810.08440.03880.34060.12810.3579
510.11770.15510.06791.09640.37020.6084
520.12330.21680.09772.18640.73340.8564
530.12090.18740.11261.75680.9040.9508
540.12310.16520.12011.3510.96790.9838
550.12710.10090.11770.49790.90910.9535
560.14450.10870.11670.49830.86350.9292
570.15620.13560.11860.76020.85310.9237
580.14890.13050.11970.87490.85510.9247
590.14830.13660.12111.04320.87080.9332



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