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, 28 Dec 2009 07:34:54 -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/28/t1262010983yyhkidl8s45lzvm.htm/, Retrieved Sat, 04 May 2024 21:26:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70982, Retrieved Sat, 04 May 2024 21:26:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact136
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Variance Reduction Matrix] [VRM] [2009-12-23 10:57:13] [5e6d255681a7853beaa91b62357037a7]
- RMP     [ARIMA Forecasting] [ARIMA forecast L=...] [2009-12-28 14:34:54] [b08f24ccf7d7e0757793cda532be96b3] [Current]
Feedback Forum

Post a new message
Dataseries X:
83.87
84.23
84.61
84.82
85.04
85.06
84.93
84.98
85.23
85.30
85.33
85.55
85.70
85.88
86.04
86.07
86.31
86.38
86.35
86.55
86.70
86.74
86.85
86.95
86.80
87.01
87.17
87.43
87.66
87.68
87.59
87.65
87.72
87.70
87.71
87.80
87.62
87.84
88.17
88.47
88.58
88.57
88.55
88.68
88.79
88.85
88.95
89.27
89.09
89.42
89.72
89.85
89.96
90.25
90.20
90.27
90.78
90.79
90.98
91.25
90.75
91.01
91.50
92.09
92.56
92.66
92.38
92.38
92.66
92.69
92.59
92.98
92.98
93.15
93.65
94.06
94.24
94.24
94.11
94.16
94.43
94.67
94.60
95.00
94.84
95.26
95.81
95.92
95.85
95.90
95.80
96.00
96.34
96.43
96.48
96.75
96.51
96.69
97.28
97.69
98.08
98.09
97.92
98.06
98.23
98.57
98.53
98.92
98.42
98.73
99.32
99.73
100.00
100.08
100.02
100.26
100.71
100.95
100.75
101.03
100.64
100.93
101.41
102.07
102.42
102.53
102.43
102.60
102.65
102.74
102.82
103.21
102.75
103.09
103.71
104.30
104.58
104.71
104.44
104.57
104.95
105.49
106.03
106.48
106.25
106.70
107.60
108.05
108.72
109.17
109.08
109.04
109.34
109.37
108.96
108.77
108.11
108.67
109.05
109.43
109.62
109.85
109.34
109.65
109.69
109.91
110.09




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70982&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 time4 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[155])
143106.03-------
144106.48-------
145106.25-------
146106.7-------
147107.6-------
148108.05-------
149108.72-------
150109.17-------
151109.08-------
152109.04-------
153109.34-------
154109.37-------
155108.96-------
156108.77109.2002108.8999109.50040.00250.941610.9416
157108.11108.8037108.3192109.28820.00250.554310.2636
158108.67109.1296108.5003109.7590.07620.999310.7013
159109.05109.7836109.0339110.53330.02760.998210.9844
160109.43110.3035109.4495111.15740.02250.99810.999
161109.62110.7061109.7591111.6530.01230.995910.9998
162109.85110.8818109.8501111.91350.0250.99170.99940.9999
163109.34110.7602109.6503111.87020.00610.9460.99850.9993
164109.65110.8915109.7085112.07460.01980.99490.99890.9993
165109.69111.1374109.8855112.38930.01170.99010.99760.9997
166109.91111.3437110.0265112.66090.01640.99310.99830.9998
167110.09111.2952109.9159112.67460.04340.97550.99950.9995

\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[155]) \tabularnewline
143 & 106.03 & - & - & - & - & - & - & - \tabularnewline
144 & 106.48 & - & - & - & - & - & - & - \tabularnewline
145 & 106.25 & - & - & - & - & - & - & - \tabularnewline
146 & 106.7 & - & - & - & - & - & - & - \tabularnewline
147 & 107.6 & - & - & - & - & - & - & - \tabularnewline
148 & 108.05 & - & - & - & - & - & - & - \tabularnewline
149 & 108.72 & - & - & - & - & - & - & - \tabularnewline
150 & 109.17 & - & - & - & - & - & - & - \tabularnewline
151 & 109.08 & - & - & - & - & - & - & - \tabularnewline
152 & 109.04 & - & - & - & - & - & - & - \tabularnewline
153 & 109.34 & - & - & - & - & - & - & - \tabularnewline
154 & 109.37 & - & - & - & - & - & - & - \tabularnewline
155 & 108.96 & - & - & - & - & - & - & - \tabularnewline
156 & 108.77 & 109.2002 & 108.8999 & 109.5004 & 0.0025 & 0.9416 & 1 & 0.9416 \tabularnewline
157 & 108.11 & 108.8037 & 108.3192 & 109.2882 & 0.0025 & 0.5543 & 1 & 0.2636 \tabularnewline
158 & 108.67 & 109.1296 & 108.5003 & 109.759 & 0.0762 & 0.9993 & 1 & 0.7013 \tabularnewline
159 & 109.05 & 109.7836 & 109.0339 & 110.5333 & 0.0276 & 0.9982 & 1 & 0.9844 \tabularnewline
160 & 109.43 & 110.3035 & 109.4495 & 111.1574 & 0.0225 & 0.998 & 1 & 0.999 \tabularnewline
161 & 109.62 & 110.7061 & 109.7591 & 111.653 & 0.0123 & 0.9959 & 1 & 0.9998 \tabularnewline
162 & 109.85 & 110.8818 & 109.8501 & 111.9135 & 0.025 & 0.9917 & 0.9994 & 0.9999 \tabularnewline
163 & 109.34 & 110.7602 & 109.6503 & 111.8702 & 0.0061 & 0.946 & 0.9985 & 0.9993 \tabularnewline
164 & 109.65 & 110.8915 & 109.7085 & 112.0746 & 0.0198 & 0.9949 & 0.9989 & 0.9993 \tabularnewline
165 & 109.69 & 111.1374 & 109.8855 & 112.3893 & 0.0117 & 0.9901 & 0.9976 & 0.9997 \tabularnewline
166 & 109.91 & 111.3437 & 110.0265 & 112.6609 & 0.0164 & 0.9931 & 0.9983 & 0.9998 \tabularnewline
167 & 110.09 & 111.2952 & 109.9159 & 112.6746 & 0.0434 & 0.9755 & 0.9995 & 0.9995 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70982&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[155])[/C][/ROW]
[ROW][C]143[/C][C]106.03[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]144[/C][C]106.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]145[/C][C]106.25[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]146[/C][C]106.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]147[/C][C]107.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]148[/C][C]108.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]149[/C][C]108.72[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]150[/C][C]109.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]151[/C][C]109.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]152[/C][C]109.04[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]153[/C][C]109.34[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]154[/C][C]109.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]155[/C][C]108.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]156[/C][C]108.77[/C][C]109.2002[/C][C]108.8999[/C][C]109.5004[/C][C]0.0025[/C][C]0.9416[/C][C]1[/C][C]0.9416[/C][/ROW]
[ROW][C]157[/C][C]108.11[/C][C]108.8037[/C][C]108.3192[/C][C]109.2882[/C][C]0.0025[/C][C]0.5543[/C][C]1[/C][C]0.2636[/C][/ROW]
[ROW][C]158[/C][C]108.67[/C][C]109.1296[/C][C]108.5003[/C][C]109.759[/C][C]0.0762[/C][C]0.9993[/C][C]1[/C][C]0.7013[/C][/ROW]
[ROW][C]159[/C][C]109.05[/C][C]109.7836[/C][C]109.0339[/C][C]110.5333[/C][C]0.0276[/C][C]0.9982[/C][C]1[/C][C]0.9844[/C][/ROW]
[ROW][C]160[/C][C]109.43[/C][C]110.3035[/C][C]109.4495[/C][C]111.1574[/C][C]0.0225[/C][C]0.998[/C][C]1[/C][C]0.999[/C][/ROW]
[ROW][C]161[/C][C]109.62[/C][C]110.7061[/C][C]109.7591[/C][C]111.653[/C][C]0.0123[/C][C]0.9959[/C][C]1[/C][C]0.9998[/C][/ROW]
[ROW][C]162[/C][C]109.85[/C][C]110.8818[/C][C]109.8501[/C][C]111.9135[/C][C]0.025[/C][C]0.9917[/C][C]0.9994[/C][C]0.9999[/C][/ROW]
[ROW][C]163[/C][C]109.34[/C][C]110.7602[/C][C]109.6503[/C][C]111.8702[/C][C]0.0061[/C][C]0.946[/C][C]0.9985[/C][C]0.9993[/C][/ROW]
[ROW][C]164[/C][C]109.65[/C][C]110.8915[/C][C]109.7085[/C][C]112.0746[/C][C]0.0198[/C][C]0.9949[/C][C]0.9989[/C][C]0.9993[/C][/ROW]
[ROW][C]165[/C][C]109.69[/C][C]111.1374[/C][C]109.8855[/C][C]112.3893[/C][C]0.0117[/C][C]0.9901[/C][C]0.9976[/C][C]0.9997[/C][/ROW]
[ROW][C]166[/C][C]109.91[/C][C]111.3437[/C][C]110.0265[/C][C]112.6609[/C][C]0.0164[/C][C]0.9931[/C][C]0.9983[/C][C]0.9998[/C][/ROW]
[ROW][C]167[/C][C]110.09[/C][C]111.2952[/C][C]109.9159[/C][C]112.6746[/C][C]0.0434[/C][C]0.9755[/C][C]0.9995[/C][C]0.9995[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70982&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70982&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[155])
143106.03-------
144106.48-------
145106.25-------
146106.7-------
147107.6-------
148108.05-------
149108.72-------
150109.17-------
151109.08-------
152109.04-------
153109.34-------
154109.37-------
155108.96-------
156108.77109.2002108.8999109.50040.00250.941610.9416
157108.11108.8037108.3192109.28820.00250.554310.2636
158108.67109.1296108.5003109.7590.07620.999310.7013
159109.05109.7836109.0339110.53330.02760.998210.9844
160109.43110.3035109.4495111.15740.02250.99810.999
161109.62110.7061109.7591111.6530.01230.995910.9998
162109.85110.8818109.8501111.91350.0250.99170.99940.9999
163109.34110.7602109.6503111.87020.00610.9460.99850.9993
164109.65110.8915109.7085112.07460.01980.99490.99890.9993
165109.69111.1374109.8855112.38930.01170.99010.99760.9997
166109.91111.3437110.0265112.66090.01640.99310.99830.9998
167110.09111.2952109.9159112.67460.04340.97550.99950.9995







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1560.0014-0.003900.18500
1570.0023-0.00640.00520.48130.33310.5772
1580.0029-0.00420.00480.21120.29250.5408
1590.0035-0.00670.00530.53820.35390.5949
1600.0039-0.00790.00580.76290.43570.6601
1610.0044-0.00980.00651.17950.55970.7481
1620.0047-0.00930.00691.06470.63180.7949
1630.0051-0.01280.00762.01710.8050.8972
1640.0054-0.01120.0081.54140.88680.9417
1650.0057-0.0130.00852.0951.00761.0038
1660.006-0.01290.00892.05551.10291.0502
1670.0063-0.01080.00911.45251.1321.064

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
156 & 0.0014 & -0.0039 & 0 & 0.185 & 0 & 0 \tabularnewline
157 & 0.0023 & -0.0064 & 0.0052 & 0.4813 & 0.3331 & 0.5772 \tabularnewline
158 & 0.0029 & -0.0042 & 0.0048 & 0.2112 & 0.2925 & 0.5408 \tabularnewline
159 & 0.0035 & -0.0067 & 0.0053 & 0.5382 & 0.3539 & 0.5949 \tabularnewline
160 & 0.0039 & -0.0079 & 0.0058 & 0.7629 & 0.4357 & 0.6601 \tabularnewline
161 & 0.0044 & -0.0098 & 0.0065 & 1.1795 & 0.5597 & 0.7481 \tabularnewline
162 & 0.0047 & -0.0093 & 0.0069 & 1.0647 & 0.6318 & 0.7949 \tabularnewline
163 & 0.0051 & -0.0128 & 0.0076 & 2.0171 & 0.805 & 0.8972 \tabularnewline
164 & 0.0054 & -0.0112 & 0.008 & 1.5414 & 0.8868 & 0.9417 \tabularnewline
165 & 0.0057 & -0.013 & 0.0085 & 2.095 & 1.0076 & 1.0038 \tabularnewline
166 & 0.006 & -0.0129 & 0.0089 & 2.0555 & 1.1029 & 1.0502 \tabularnewline
167 & 0.0063 & -0.0108 & 0.0091 & 1.4525 & 1.132 & 1.064 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70982&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]156[/C][C]0.0014[/C][C]-0.0039[/C][C]0[/C][C]0.185[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]157[/C][C]0.0023[/C][C]-0.0064[/C][C]0.0052[/C][C]0.4813[/C][C]0.3331[/C][C]0.5772[/C][/ROW]
[ROW][C]158[/C][C]0.0029[/C][C]-0.0042[/C][C]0.0048[/C][C]0.2112[/C][C]0.2925[/C][C]0.5408[/C][/ROW]
[ROW][C]159[/C][C]0.0035[/C][C]-0.0067[/C][C]0.0053[/C][C]0.5382[/C][C]0.3539[/C][C]0.5949[/C][/ROW]
[ROW][C]160[/C][C]0.0039[/C][C]-0.0079[/C][C]0.0058[/C][C]0.7629[/C][C]0.4357[/C][C]0.6601[/C][/ROW]
[ROW][C]161[/C][C]0.0044[/C][C]-0.0098[/C][C]0.0065[/C][C]1.1795[/C][C]0.5597[/C][C]0.7481[/C][/ROW]
[ROW][C]162[/C][C]0.0047[/C][C]-0.0093[/C][C]0.0069[/C][C]1.0647[/C][C]0.6318[/C][C]0.7949[/C][/ROW]
[ROW][C]163[/C][C]0.0051[/C][C]-0.0128[/C][C]0.0076[/C][C]2.0171[/C][C]0.805[/C][C]0.8972[/C][/ROW]
[ROW][C]164[/C][C]0.0054[/C][C]-0.0112[/C][C]0.008[/C][C]1.5414[/C][C]0.8868[/C][C]0.9417[/C][/ROW]
[ROW][C]165[/C][C]0.0057[/C][C]-0.013[/C][C]0.0085[/C][C]2.095[/C][C]1.0076[/C][C]1.0038[/C][/ROW]
[ROW][C]166[/C][C]0.006[/C][C]-0.0129[/C][C]0.0089[/C][C]2.0555[/C][C]1.1029[/C][C]1.0502[/C][/ROW]
[ROW][C]167[/C][C]0.0063[/C][C]-0.0108[/C][C]0.0091[/C][C]1.4525[/C][C]1.132[/C][C]1.064[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70982&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70982&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
1560.0014-0.003900.18500
1570.0023-0.00640.00520.48130.33310.5772
1580.0029-0.00420.00480.21120.29250.5408
1590.0035-0.00670.00530.53820.35390.5949
1600.0039-0.00790.00580.76290.43570.6601
1610.0044-0.00980.00651.17950.55970.7481
1620.0047-0.00930.00691.06470.63180.7949
1630.0051-0.01280.00762.01710.8050.8972
1640.0054-0.01120.0081.54140.88680.9417
1650.0057-0.0130.00852.0951.00761.0038
1660.006-0.01290.00892.05551.10291.0502
1670.0063-0.01080.00911.45251.1321.064



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