Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationMon, 10 Dec 2007 11:49:22 -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/10/t1197311715bv9zm6ey9gmwq1n.htm/, Retrieved Mon, 06 May 2024 19:54:00 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3016, Retrieved Mon, 06 May 2024 19:54:00 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact214
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecasts 2] [2007-12-10 18:49:22] [6b5c00822e2ce0f7cf73539c28d95782] [Current]
Feedback Forum

Post a new message
Dataseries X:
106.22
106.31
107.38
109.31
110.82
111.22
110.66
110.76
110.69
111.08
110.97
110.24
112.51
111.52
112.13
112.23
112.92
111.89
111.99
111.51
112.33
112.04
112.09
111.41
112.61
113.14
113.65
114.26
114.4
114.93
114.86
114.95
116.17
114.6
114.62
113.82
115.02
115.18
115.59
116.6
117.07
116.96
116.66
116.07
116.04
115.81
116.22
115.85
116.43
117.39
119.17
119.24
120.03
119.34
118.49
118.59
117.5
117.56
118.25
118.01




Summary of compuational 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 compuational 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=3016&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]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=3016&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3016&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 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[48])
36113.82-------
37115.02-------
38115.18-------
39115.59-------
40116.6-------
41117.07-------
42116.96-------
43116.66-------
44116.07-------
45116.04-------
46115.81-------
47116.22-------
48115.85-------
49116.43117.3033115.8587118.74420.11750.9760.99910.976
50117.39117.6866115.7328119.6340.38260.8970.99420.9677
51119.17118.213115.6084120.80610.23470.7330.97630.963
52119.24119.2993116.3234122.26050.48430.53410.9630.9888
53120.03119.7906116.5025123.06080.4430.62930.94850.9909
54119.34119.6832116.2161123.13030.42260.42180.93920.9854
55118.49119.3619115.7728122.92960.3160.50480.93110.9732
56118.59118.7457115.0918122.37740.46650.55490.92560.941
57117.5118.6812114.9935122.34620.26380.51950.92110.935
58117.56118.4203114.7178122.09970.32340.6880.91780.9145
59118.25118.7994115.0952122.48060.3850.74530.91520.9418
60118.01118.4077114.7022122.09010.41620.53340.91330.9133

\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 & 113.82 & - & - & - & - & - & - & - \tabularnewline
37 & 115.02 & - & - & - & - & - & - & - \tabularnewline
38 & 115.18 & - & - & - & - & - & - & - \tabularnewline
39 & 115.59 & - & - & - & - & - & - & - \tabularnewline
40 & 116.6 & - & - & - & - & - & - & - \tabularnewline
41 & 117.07 & - & - & - & - & - & - & - \tabularnewline
42 & 116.96 & - & - & - & - & - & - & - \tabularnewline
43 & 116.66 & - & - & - & - & - & - & - \tabularnewline
44 & 116.07 & - & - & - & - & - & - & - \tabularnewline
45 & 116.04 & - & - & - & - & - & - & - \tabularnewline
46 & 115.81 & - & - & - & - & - & - & - \tabularnewline
47 & 116.22 & - & - & - & - & - & - & - \tabularnewline
48 & 115.85 & - & - & - & - & - & - & - \tabularnewline
49 & 116.43 & 117.3033 & 115.8587 & 118.7442 & 0.1175 & 0.976 & 0.9991 & 0.976 \tabularnewline
50 & 117.39 & 117.6866 & 115.7328 & 119.634 & 0.3826 & 0.897 & 0.9942 & 0.9677 \tabularnewline
51 & 119.17 & 118.213 & 115.6084 & 120.8061 & 0.2347 & 0.733 & 0.9763 & 0.963 \tabularnewline
52 & 119.24 & 119.2993 & 116.3234 & 122.2605 & 0.4843 & 0.5341 & 0.963 & 0.9888 \tabularnewline
53 & 120.03 & 119.7906 & 116.5025 & 123.0608 & 0.443 & 0.6293 & 0.9485 & 0.9909 \tabularnewline
54 & 119.34 & 119.6832 & 116.2161 & 123.1303 & 0.4226 & 0.4218 & 0.9392 & 0.9854 \tabularnewline
55 & 118.49 & 119.3619 & 115.7728 & 122.9296 & 0.316 & 0.5048 & 0.9311 & 0.9732 \tabularnewline
56 & 118.59 & 118.7457 & 115.0918 & 122.3774 & 0.4665 & 0.5549 & 0.9256 & 0.941 \tabularnewline
57 & 117.5 & 118.6812 & 114.9935 & 122.3462 & 0.2638 & 0.5195 & 0.9211 & 0.935 \tabularnewline
58 & 117.56 & 118.4203 & 114.7178 & 122.0997 & 0.3234 & 0.688 & 0.9178 & 0.9145 \tabularnewline
59 & 118.25 & 118.7994 & 115.0952 & 122.4806 & 0.385 & 0.7453 & 0.9152 & 0.9418 \tabularnewline
60 & 118.01 & 118.4077 & 114.7022 & 122.0901 & 0.4162 & 0.5334 & 0.9133 & 0.9133 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3016&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]113.82[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]115.02[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]115.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]115.59[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]116.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]117.07[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]116.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]116.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]116.07[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]116.04[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]115.81[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]116.22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]115.85[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]116.43[/C][C]117.3033[/C][C]115.8587[/C][C]118.7442[/C][C]0.1175[/C][C]0.976[/C][C]0.9991[/C][C]0.976[/C][/ROW]
[ROW][C]50[/C][C]117.39[/C][C]117.6866[/C][C]115.7328[/C][C]119.634[/C][C]0.3826[/C][C]0.897[/C][C]0.9942[/C][C]0.9677[/C][/ROW]
[ROW][C]51[/C][C]119.17[/C][C]118.213[/C][C]115.6084[/C][C]120.8061[/C][C]0.2347[/C][C]0.733[/C][C]0.9763[/C][C]0.963[/C][/ROW]
[ROW][C]52[/C][C]119.24[/C][C]119.2993[/C][C]116.3234[/C][C]122.2605[/C][C]0.4843[/C][C]0.5341[/C][C]0.963[/C][C]0.9888[/C][/ROW]
[ROW][C]53[/C][C]120.03[/C][C]119.7906[/C][C]116.5025[/C][C]123.0608[/C][C]0.443[/C][C]0.6293[/C][C]0.9485[/C][C]0.9909[/C][/ROW]
[ROW][C]54[/C][C]119.34[/C][C]119.6832[/C][C]116.2161[/C][C]123.1303[/C][C]0.4226[/C][C]0.4218[/C][C]0.9392[/C][C]0.9854[/C][/ROW]
[ROW][C]55[/C][C]118.49[/C][C]119.3619[/C][C]115.7728[/C][C]122.9296[/C][C]0.316[/C][C]0.5048[/C][C]0.9311[/C][C]0.9732[/C][/ROW]
[ROW][C]56[/C][C]118.59[/C][C]118.7457[/C][C]115.0918[/C][C]122.3774[/C][C]0.4665[/C][C]0.5549[/C][C]0.9256[/C][C]0.941[/C][/ROW]
[ROW][C]57[/C][C]117.5[/C][C]118.6812[/C][C]114.9935[/C][C]122.3462[/C][C]0.2638[/C][C]0.5195[/C][C]0.9211[/C][C]0.935[/C][/ROW]
[ROW][C]58[/C][C]117.56[/C][C]118.4203[/C][C]114.7178[/C][C]122.0997[/C][C]0.3234[/C][C]0.688[/C][C]0.9178[/C][C]0.9145[/C][/ROW]
[ROW][C]59[/C][C]118.25[/C][C]118.7994[/C][C]115.0952[/C][C]122.4806[/C][C]0.385[/C][C]0.7453[/C][C]0.9152[/C][C]0.9418[/C][/ROW]
[ROW][C]60[/C][C]118.01[/C][C]118.4077[/C][C]114.7022[/C][C]122.0901[/C][C]0.4162[/C][C]0.5334[/C][C]0.9133[/C][C]0.9133[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3016&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3016&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])
36113.82-------
37115.02-------
38115.18-------
39115.59-------
40116.6-------
41117.07-------
42116.96-------
43116.66-------
44116.07-------
45116.04-------
46115.81-------
47116.22-------
48115.85-------
49116.43117.3033115.8587118.74420.11750.9760.99910.976
50117.39117.6866115.7328119.6340.38260.8970.99420.9677
51119.17118.213115.6084120.80610.23470.7330.97630.963
52119.24119.2993116.3234122.26050.48430.53410.9630.9888
53120.03119.7906116.5025123.06080.4430.62930.94850.9909
54119.34119.6832116.2161123.13030.42260.42180.93920.9854
55118.49119.3619115.7728122.92960.3160.50480.93110.9732
56118.59118.7457115.0918122.37740.46650.55490.92560.941
57117.5118.6812114.9935122.34620.26380.51950.92110.935
58117.56118.4203114.7178122.09970.32340.6880.91780.9145
59118.25118.7994115.0952122.48060.3850.74530.91520.9418
60118.01118.4077114.7022122.09010.41620.53340.91330.9133







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0063-0.00746e-040.76260.06350.2521
500.0084-0.00252e-040.0880.00730.0856
510.01120.00817e-040.91590.07630.2763
520.0127-5e-0400.00353e-040.0171
530.01390.0022e-040.05730.00480.0691
540.0147-0.00292e-040.11780.00980.0991
550.0152-0.00736e-040.76030.06340.2517
560.0156-0.00131e-040.02430.0020.045
570.0158-0.018e-041.39530.11630.341
580.0159-0.00736e-040.74010.06170.2483
590.0158-0.00464e-040.30180.02510.1586
600.0159-0.00343e-040.15810.01320.1148

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0063 & -0.0074 & 6e-04 & 0.7626 & 0.0635 & 0.2521 \tabularnewline
50 & 0.0084 & -0.0025 & 2e-04 & 0.088 & 0.0073 & 0.0856 \tabularnewline
51 & 0.0112 & 0.0081 & 7e-04 & 0.9159 & 0.0763 & 0.2763 \tabularnewline
52 & 0.0127 & -5e-04 & 0 & 0.0035 & 3e-04 & 0.0171 \tabularnewline
53 & 0.0139 & 0.002 & 2e-04 & 0.0573 & 0.0048 & 0.0691 \tabularnewline
54 & 0.0147 & -0.0029 & 2e-04 & 0.1178 & 0.0098 & 0.0991 \tabularnewline
55 & 0.0152 & -0.0073 & 6e-04 & 0.7603 & 0.0634 & 0.2517 \tabularnewline
56 & 0.0156 & -0.0013 & 1e-04 & 0.0243 & 0.002 & 0.045 \tabularnewline
57 & 0.0158 & -0.01 & 8e-04 & 1.3953 & 0.1163 & 0.341 \tabularnewline
58 & 0.0159 & -0.0073 & 6e-04 & 0.7401 & 0.0617 & 0.2483 \tabularnewline
59 & 0.0158 & -0.0046 & 4e-04 & 0.3018 & 0.0251 & 0.1586 \tabularnewline
60 & 0.0159 & -0.0034 & 3e-04 & 0.1581 & 0.0132 & 0.1148 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3016&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.0063[/C][C]-0.0074[/C][C]6e-04[/C][C]0.7626[/C][C]0.0635[/C][C]0.2521[/C][/ROW]
[ROW][C]50[/C][C]0.0084[/C][C]-0.0025[/C][C]2e-04[/C][C]0.088[/C][C]0.0073[/C][C]0.0856[/C][/ROW]
[ROW][C]51[/C][C]0.0112[/C][C]0.0081[/C][C]7e-04[/C][C]0.9159[/C][C]0.0763[/C][C]0.2763[/C][/ROW]
[ROW][C]52[/C][C]0.0127[/C][C]-5e-04[/C][C]0[/C][C]0.0035[/C][C]3e-04[/C][C]0.0171[/C][/ROW]
[ROW][C]53[/C][C]0.0139[/C][C]0.002[/C][C]2e-04[/C][C]0.0573[/C][C]0.0048[/C][C]0.0691[/C][/ROW]
[ROW][C]54[/C][C]0.0147[/C][C]-0.0029[/C][C]2e-04[/C][C]0.1178[/C][C]0.0098[/C][C]0.0991[/C][/ROW]
[ROW][C]55[/C][C]0.0152[/C][C]-0.0073[/C][C]6e-04[/C][C]0.7603[/C][C]0.0634[/C][C]0.2517[/C][/ROW]
[ROW][C]56[/C][C]0.0156[/C][C]-0.0013[/C][C]1e-04[/C][C]0.0243[/C][C]0.002[/C][C]0.045[/C][/ROW]
[ROW][C]57[/C][C]0.0158[/C][C]-0.01[/C][C]8e-04[/C][C]1.3953[/C][C]0.1163[/C][C]0.341[/C][/ROW]
[ROW][C]58[/C][C]0.0159[/C][C]-0.0073[/C][C]6e-04[/C][C]0.7401[/C][C]0.0617[/C][C]0.2483[/C][/ROW]
[ROW][C]59[/C][C]0.0158[/C][C]-0.0046[/C][C]4e-04[/C][C]0.3018[/C][C]0.0251[/C][C]0.1586[/C][/ROW]
[ROW][C]60[/C][C]0.0159[/C][C]-0.0034[/C][C]3e-04[/C][C]0.1581[/C][C]0.0132[/C][C]0.1148[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3016&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3016&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.0063-0.00746e-040.76260.06350.2521
500.0084-0.00252e-040.0880.00730.0856
510.01120.00817e-040.91590.07630.2763
520.0127-5e-0400.00353e-040.0171
530.01390.0022e-040.05730.00480.0691
540.0147-0.00292e-040.11780.00980.0991
550.0152-0.00736e-040.76030.06340.2517
560.0156-0.00131e-040.02430.0020.045
570.0158-0.018e-041.39530.11630.341
580.0159-0.00736e-040.74010.06170.2483
590.0158-0.00464e-040.30180.02510.1586
600.0159-0.00343e-040.15810.01320.1148



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