Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 20 Dec 2007 08:27: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/20/t1198163365heilkblepklvje4.htm/, Retrieved Mon, 29 Apr 2024 14:59:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4734, Retrieved Mon, 29 Apr 2024 14:59:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact206
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecast nt...] [2007-12-20 15:27:22] [7c5f7a910a5108d789a748f71ee8daf4] [Current]
Feedback Forum

Post a new message
Dataseries X:
108,1
105,4
114,6
106,9
115,9
109,8
101,8
114,2
110,8
108,4
127,5
128,6
116,6
127,4
105,0
108,3
125,0
111,6
106,5
130,3
115,0
116,1
134,0
126,5
125,8
136,4
114,9
110,9
125,5
116,8
116,8
125,5
104,2
115,1
132,8
123,3
124,8
122,0
117,4
117,9
137,4
114,6
124,7
129,6
109,4
120,9
134,9
136,3
133,2
127,2
122,7
120,5
137,8
119,1
124,3
134,4
121,1
121,0
127,0
133,4




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4734&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])
36123.3-------
37124.8-------
38122-------
39117.4-------
40117.9-------
41137.4-------
42114.6-------
43124.7-------
44129.6-------
45109.4-------
46120.9-------
47134.9-------
48136.3-------
49133.2128.0591115.0173139.89030.19720.08610.70540.0861
50127.2125.8172112.2981138.01840.41210.11780.73010.0461
51122.7122.45108.2905135.13390.48460.23150.78240.0162
52120.5124.3045110.1692136.9890.27830.59790.83880.0319
53137.8137.8296125.045149.52510.4980.99820.52870.6012
54119.1121.2106.2218134.52060.37870.00730.83430.0131
55124.3128.3107114.0721141.120.26970.92060.70970.1108
56134.4132.77118.8804145.33830.39970.90670.68950.291
57121.1119.7363103.9135133.69950.42410.01980.92660.01
58121126.4659111.4096139.91120.21280.7830.79140.0758
59127135.0084120.8454147.82060.11030.98390.50660.4217
60133.4136.3999122.2284149.23160.32340.92450.50610.5061

\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 & 123.3 & - & - & - & - & - & - & - \tabularnewline
37 & 124.8 & - & - & - & - & - & - & - \tabularnewline
38 & 122 & - & - & - & - & - & - & - \tabularnewline
39 & 117.4 & - & - & - & - & - & - & - \tabularnewline
40 & 117.9 & - & - & - & - & - & - & - \tabularnewline
41 & 137.4 & - & - & - & - & - & - & - \tabularnewline
42 & 114.6 & - & - & - & - & - & - & - \tabularnewline
43 & 124.7 & - & - & - & - & - & - & - \tabularnewline
44 & 129.6 & - & - & - & - & - & - & - \tabularnewline
45 & 109.4 & - & - & - & - & - & - & - \tabularnewline
46 & 120.9 & - & - & - & - & - & - & - \tabularnewline
47 & 134.9 & - & - & - & - & - & - & - \tabularnewline
48 & 136.3 & - & - & - & - & - & - & - \tabularnewline
49 & 133.2 & 128.0591 & 115.0173 & 139.8903 & 0.1972 & 0.0861 & 0.7054 & 0.0861 \tabularnewline
50 & 127.2 & 125.8172 & 112.2981 & 138.0184 & 0.4121 & 0.1178 & 0.7301 & 0.0461 \tabularnewline
51 & 122.7 & 122.45 & 108.2905 & 135.1339 & 0.4846 & 0.2315 & 0.7824 & 0.0162 \tabularnewline
52 & 120.5 & 124.3045 & 110.1692 & 136.989 & 0.2783 & 0.5979 & 0.8388 & 0.0319 \tabularnewline
53 & 137.8 & 137.8296 & 125.045 & 149.5251 & 0.498 & 0.9982 & 0.5287 & 0.6012 \tabularnewline
54 & 119.1 & 121.2 & 106.2218 & 134.5206 & 0.3787 & 0.0073 & 0.8343 & 0.0131 \tabularnewline
55 & 124.3 & 128.3107 & 114.0721 & 141.12 & 0.2697 & 0.9206 & 0.7097 & 0.1108 \tabularnewline
56 & 134.4 & 132.77 & 118.8804 & 145.3383 & 0.3997 & 0.9067 & 0.6895 & 0.291 \tabularnewline
57 & 121.1 & 119.7363 & 103.9135 & 133.6995 & 0.4241 & 0.0198 & 0.9266 & 0.01 \tabularnewline
58 & 121 & 126.4659 & 111.4096 & 139.9112 & 0.2128 & 0.783 & 0.7914 & 0.0758 \tabularnewline
59 & 127 & 135.0084 & 120.8454 & 147.8206 & 0.1103 & 0.9839 & 0.5066 & 0.4217 \tabularnewline
60 & 133.4 & 136.3999 & 122.2284 & 149.2316 & 0.3234 & 0.9245 & 0.5061 & 0.5061 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4734&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]123.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]124.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]122[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]117.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]117.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]137.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]114.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]124.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]129.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]109.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]120.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]134.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]136.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]133.2[/C][C]128.0591[/C][C]115.0173[/C][C]139.8903[/C][C]0.1972[/C][C]0.0861[/C][C]0.7054[/C][C]0.0861[/C][/ROW]
[ROW][C]50[/C][C]127.2[/C][C]125.8172[/C][C]112.2981[/C][C]138.0184[/C][C]0.4121[/C][C]0.1178[/C][C]0.7301[/C][C]0.0461[/C][/ROW]
[ROW][C]51[/C][C]122.7[/C][C]122.45[/C][C]108.2905[/C][C]135.1339[/C][C]0.4846[/C][C]0.2315[/C][C]0.7824[/C][C]0.0162[/C][/ROW]
[ROW][C]52[/C][C]120.5[/C][C]124.3045[/C][C]110.1692[/C][C]136.989[/C][C]0.2783[/C][C]0.5979[/C][C]0.8388[/C][C]0.0319[/C][/ROW]
[ROW][C]53[/C][C]137.8[/C][C]137.8296[/C][C]125.045[/C][C]149.5251[/C][C]0.498[/C][C]0.9982[/C][C]0.5287[/C][C]0.6012[/C][/ROW]
[ROW][C]54[/C][C]119.1[/C][C]121.2[/C][C]106.2218[/C][C]134.5206[/C][C]0.3787[/C][C]0.0073[/C][C]0.8343[/C][C]0.0131[/C][/ROW]
[ROW][C]55[/C][C]124.3[/C][C]128.3107[/C][C]114.0721[/C][C]141.12[/C][C]0.2697[/C][C]0.9206[/C][C]0.7097[/C][C]0.1108[/C][/ROW]
[ROW][C]56[/C][C]134.4[/C][C]132.77[/C][C]118.8804[/C][C]145.3383[/C][C]0.3997[/C][C]0.9067[/C][C]0.6895[/C][C]0.291[/C][/ROW]
[ROW][C]57[/C][C]121.1[/C][C]119.7363[/C][C]103.9135[/C][C]133.6995[/C][C]0.4241[/C][C]0.0198[/C][C]0.9266[/C][C]0.01[/C][/ROW]
[ROW][C]58[/C][C]121[/C][C]126.4659[/C][C]111.4096[/C][C]139.9112[/C][C]0.2128[/C][C]0.783[/C][C]0.7914[/C][C]0.0758[/C][/ROW]
[ROW][C]59[/C][C]127[/C][C]135.0084[/C][C]120.8454[/C][C]147.8206[/C][C]0.1103[/C][C]0.9839[/C][C]0.5066[/C][C]0.4217[/C][/ROW]
[ROW][C]60[/C][C]133.4[/C][C]136.3999[/C][C]122.2284[/C][C]149.2316[/C][C]0.3234[/C][C]0.9245[/C][C]0.5061[/C][C]0.5061[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4734&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4734&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])
36123.3-------
37124.8-------
38122-------
39117.4-------
40117.9-------
41137.4-------
42114.6-------
43124.7-------
44129.6-------
45109.4-------
46120.9-------
47134.9-------
48136.3-------
49133.2128.0591115.0173139.89030.19720.08610.70540.0861
50127.2125.8172112.2981138.01840.41210.11780.73010.0461
51122.7122.45108.2905135.13390.48460.23150.78240.0162
52120.5124.3045110.1692136.9890.27830.59790.83880.0319
53137.8137.8296125.045149.52510.4980.99820.52870.6012
54119.1121.2106.2218134.52060.37870.00730.83430.0131
55124.3128.3107114.0721141.120.26970.92060.70970.1108
56134.4132.77118.8804145.33830.39970.90670.68950.291
57121.1119.7363103.9135133.69950.42410.01980.92660.01
58121126.4659111.4096139.91120.21280.7830.79140.0758
59127135.0084120.8454147.82060.11030.98390.50660.4217
60133.4136.3999122.2284149.23160.32340.92450.50610.5061







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.04710.04010.003326.4292.20241.4841
500.04950.0119e-041.9120.15930.3992
510.05280.0022e-040.06250.00520.0722
520.0521-0.03060.002614.47451.20621.0983
530.0433-2e-0409e-041e-040.0086
540.0561-0.01730.00144.40990.36750.6062
550.0509-0.03130.002616.0861.34051.1578
560.04830.01230.0012.65680.22140.4705
570.05950.01149e-041.85960.1550.3937
580.0542-0.04320.003629.87612.48971.5779
590.0484-0.05930.004964.13465.34462.3118
600.048-0.0220.00188.99940.74990.866

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0471 & 0.0401 & 0.0033 & 26.429 & 2.2024 & 1.4841 \tabularnewline
50 & 0.0495 & 0.011 & 9e-04 & 1.912 & 0.1593 & 0.3992 \tabularnewline
51 & 0.0528 & 0.002 & 2e-04 & 0.0625 & 0.0052 & 0.0722 \tabularnewline
52 & 0.0521 & -0.0306 & 0.0026 & 14.4745 & 1.2062 & 1.0983 \tabularnewline
53 & 0.0433 & -2e-04 & 0 & 9e-04 & 1e-04 & 0.0086 \tabularnewline
54 & 0.0561 & -0.0173 & 0.0014 & 4.4099 & 0.3675 & 0.6062 \tabularnewline
55 & 0.0509 & -0.0313 & 0.0026 & 16.086 & 1.3405 & 1.1578 \tabularnewline
56 & 0.0483 & 0.0123 & 0.001 & 2.6568 & 0.2214 & 0.4705 \tabularnewline
57 & 0.0595 & 0.0114 & 9e-04 & 1.8596 & 0.155 & 0.3937 \tabularnewline
58 & 0.0542 & -0.0432 & 0.0036 & 29.8761 & 2.4897 & 1.5779 \tabularnewline
59 & 0.0484 & -0.0593 & 0.0049 & 64.1346 & 5.3446 & 2.3118 \tabularnewline
60 & 0.048 & -0.022 & 0.0018 & 8.9994 & 0.7499 & 0.866 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4734&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.0471[/C][C]0.0401[/C][C]0.0033[/C][C]26.429[/C][C]2.2024[/C][C]1.4841[/C][/ROW]
[ROW][C]50[/C][C]0.0495[/C][C]0.011[/C][C]9e-04[/C][C]1.912[/C][C]0.1593[/C][C]0.3992[/C][/ROW]
[ROW][C]51[/C][C]0.0528[/C][C]0.002[/C][C]2e-04[/C][C]0.0625[/C][C]0.0052[/C][C]0.0722[/C][/ROW]
[ROW][C]52[/C][C]0.0521[/C][C]-0.0306[/C][C]0.0026[/C][C]14.4745[/C][C]1.2062[/C][C]1.0983[/C][/ROW]
[ROW][C]53[/C][C]0.0433[/C][C]-2e-04[/C][C]0[/C][C]9e-04[/C][C]1e-04[/C][C]0.0086[/C][/ROW]
[ROW][C]54[/C][C]0.0561[/C][C]-0.0173[/C][C]0.0014[/C][C]4.4099[/C][C]0.3675[/C][C]0.6062[/C][/ROW]
[ROW][C]55[/C][C]0.0509[/C][C]-0.0313[/C][C]0.0026[/C][C]16.086[/C][C]1.3405[/C][C]1.1578[/C][/ROW]
[ROW][C]56[/C][C]0.0483[/C][C]0.0123[/C][C]0.001[/C][C]2.6568[/C][C]0.2214[/C][C]0.4705[/C][/ROW]
[ROW][C]57[/C][C]0.0595[/C][C]0.0114[/C][C]9e-04[/C][C]1.8596[/C][C]0.155[/C][C]0.3937[/C][/ROW]
[ROW][C]58[/C][C]0.0542[/C][C]-0.0432[/C][C]0.0036[/C][C]29.8761[/C][C]2.4897[/C][C]1.5779[/C][/ROW]
[ROW][C]59[/C][C]0.0484[/C][C]-0.0593[/C][C]0.0049[/C][C]64.1346[/C][C]5.3446[/C][C]2.3118[/C][/ROW]
[ROW][C]60[/C][C]0.048[/C][C]-0.022[/C][C]0.0018[/C][C]8.9994[/C][C]0.7499[/C][C]0.866[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4734&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4734&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.04710.04010.003326.4292.20241.4841
500.04950.0119e-041.9120.15930.3992
510.05280.0022e-040.06250.00520.0722
520.0521-0.03060.002614.47451.20621.0983
530.0433-2e-0409e-041e-040.0086
540.0561-0.01730.00144.40990.36750.6062
550.0509-0.03130.002616.0861.34051.1578
560.04830.01230.0012.65680.22140.4705
570.05950.01149e-041.85960.1550.3937
580.0542-0.04320.003629.87612.48971.5779
590.0484-0.05930.004964.13465.34462.3118
600.048-0.0220.00188.99940.74990.866



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