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:16:29 -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/t1262010125rnqg1ud4u7lam6o.htm/, Retrieved Sun, 05 May 2024 07:22:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70977, Retrieved Sun, 05 May 2024 07:22:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordspaper
Estimated Impact131
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:16:29] [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 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=70977&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=70977&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70977&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[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.169108.8624109.47570.00540.909210.9092
157108.11108.7999108.2996109.30020.00340.546710.2653
158108.67109.1328108.4789109.78660.08270.998910.6977
159109.05109.786109.0043110.56770.03250.997410.9808
160109.43110.2632109.3708111.15570.03360.996110.9979
161109.62110.6628109.6717111.65390.01960.99260.99990.9996
162109.85110.8686109.7877111.94950.03240.98820.9990.9997
163109.34110.7311109.5673111.89490.00960.93110.99730.9986
164109.65110.8212109.58112.06240.03220.99030.99750.9984
165109.69111.1063109.7923112.42030.01730.98510.99580.9993
166109.91111.3079109.9249112.69090.02380.98910.9970.9996
167110.09111.2864109.8377112.73510.05280.96870.99920.9992

\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.169 & 108.8624 & 109.4757 & 0.0054 & 0.9092 & 1 & 0.9092 \tabularnewline
157 & 108.11 & 108.7999 & 108.2996 & 109.3002 & 0.0034 & 0.5467 & 1 & 0.2653 \tabularnewline
158 & 108.67 & 109.1328 & 108.4789 & 109.7866 & 0.0827 & 0.9989 & 1 & 0.6977 \tabularnewline
159 & 109.05 & 109.786 & 109.0043 & 110.5677 & 0.0325 & 0.9974 & 1 & 0.9808 \tabularnewline
160 & 109.43 & 110.2632 & 109.3708 & 111.1557 & 0.0336 & 0.9961 & 1 & 0.9979 \tabularnewline
161 & 109.62 & 110.6628 & 109.6717 & 111.6539 & 0.0196 & 0.9926 & 0.9999 & 0.9996 \tabularnewline
162 & 109.85 & 110.8686 & 109.7877 & 111.9495 & 0.0324 & 0.9882 & 0.999 & 0.9997 \tabularnewline
163 & 109.34 & 110.7311 & 109.5673 & 111.8949 & 0.0096 & 0.9311 & 0.9973 & 0.9986 \tabularnewline
164 & 109.65 & 110.8212 & 109.58 & 112.0624 & 0.0322 & 0.9903 & 0.9975 & 0.9984 \tabularnewline
165 & 109.69 & 111.1063 & 109.7923 & 112.4203 & 0.0173 & 0.9851 & 0.9958 & 0.9993 \tabularnewline
166 & 109.91 & 111.3079 & 109.9249 & 112.6909 & 0.0238 & 0.9891 & 0.997 & 0.9996 \tabularnewline
167 & 110.09 & 111.2864 & 109.8377 & 112.7351 & 0.0528 & 0.9687 & 0.9992 & 0.9992 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70977&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.169[/C][C]108.8624[/C][C]109.4757[/C][C]0.0054[/C][C]0.9092[/C][C]1[/C][C]0.9092[/C][/ROW]
[ROW][C]157[/C][C]108.11[/C][C]108.7999[/C][C]108.2996[/C][C]109.3002[/C][C]0.0034[/C][C]0.5467[/C][C]1[/C][C]0.2653[/C][/ROW]
[ROW][C]158[/C][C]108.67[/C][C]109.1328[/C][C]108.4789[/C][C]109.7866[/C][C]0.0827[/C][C]0.9989[/C][C]1[/C][C]0.6977[/C][/ROW]
[ROW][C]159[/C][C]109.05[/C][C]109.786[/C][C]109.0043[/C][C]110.5677[/C][C]0.0325[/C][C]0.9974[/C][C]1[/C][C]0.9808[/C][/ROW]
[ROW][C]160[/C][C]109.43[/C][C]110.2632[/C][C]109.3708[/C][C]111.1557[/C][C]0.0336[/C][C]0.9961[/C][C]1[/C][C]0.9979[/C][/ROW]
[ROW][C]161[/C][C]109.62[/C][C]110.6628[/C][C]109.6717[/C][C]111.6539[/C][C]0.0196[/C][C]0.9926[/C][C]0.9999[/C][C]0.9996[/C][/ROW]
[ROW][C]162[/C][C]109.85[/C][C]110.8686[/C][C]109.7877[/C][C]111.9495[/C][C]0.0324[/C][C]0.9882[/C][C]0.999[/C][C]0.9997[/C][/ROW]
[ROW][C]163[/C][C]109.34[/C][C]110.7311[/C][C]109.5673[/C][C]111.8949[/C][C]0.0096[/C][C]0.9311[/C][C]0.9973[/C][C]0.9986[/C][/ROW]
[ROW][C]164[/C][C]109.65[/C][C]110.8212[/C][C]109.58[/C][C]112.0624[/C][C]0.0322[/C][C]0.9903[/C][C]0.9975[/C][C]0.9984[/C][/ROW]
[ROW][C]165[/C][C]109.69[/C][C]111.1063[/C][C]109.7923[/C][C]112.4203[/C][C]0.0173[/C][C]0.9851[/C][C]0.9958[/C][C]0.9993[/C][/ROW]
[ROW][C]166[/C][C]109.91[/C][C]111.3079[/C][C]109.9249[/C][C]112.6909[/C][C]0.0238[/C][C]0.9891[/C][C]0.997[/C][C]0.9996[/C][/ROW]
[ROW][C]167[/C][C]110.09[/C][C]111.2864[/C][C]109.8377[/C][C]112.7351[/C][C]0.0528[/C][C]0.9687[/C][C]0.9992[/C][C]0.9992[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70977&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70977&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.169108.8624109.47570.00540.909210.9092
157108.11108.7999108.2996109.30020.00340.546710.2653
158108.67109.1328108.4789109.78660.08270.998910.6977
159109.05109.786109.0043110.56770.03250.997410.9808
160109.43110.2632109.3708111.15570.03360.996110.9979
161109.62110.6628109.6717111.65390.01960.99260.99990.9996
162109.85110.8686109.7877111.94950.03240.98820.9990.9997
163109.34110.7311109.5673111.89490.00960.93110.99730.9986
164109.65110.8212109.58112.06240.03220.99030.99750.9984
165109.69111.1063109.7923112.42030.01730.98510.99580.9993
166109.91111.3079109.9249112.69090.02380.98910.9970.9996
167110.09111.2864109.8377112.73510.05280.96870.99920.9992







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1560.0014-0.003700.159200
1570.0023-0.00630.0050.4760.31760.5636
1580.0031-0.00420.00470.21420.28310.5321
1590.0036-0.00670.00520.54170.34780.5897
1600.0041-0.00760.00570.69430.41710.6458
1610.0046-0.00940.00631.08750.52880.7272
1620.005-0.00920.00671.03750.60150.7755
1630.0054-0.01260.00751.93530.76820.8765
1640.0057-0.01060.00781.37170.83530.9139
1650.006-0.01270.00832.0060.95230.9759
1660.0063-0.01260.00871.95411.04341.0215
1670.0066-0.01080.00891.43141.07571.0372

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
156 & 0.0014 & -0.0037 & 0 & 0.1592 & 0 & 0 \tabularnewline
157 & 0.0023 & -0.0063 & 0.005 & 0.476 & 0.3176 & 0.5636 \tabularnewline
158 & 0.0031 & -0.0042 & 0.0047 & 0.2142 & 0.2831 & 0.5321 \tabularnewline
159 & 0.0036 & -0.0067 & 0.0052 & 0.5417 & 0.3478 & 0.5897 \tabularnewline
160 & 0.0041 & -0.0076 & 0.0057 & 0.6943 & 0.4171 & 0.6458 \tabularnewline
161 & 0.0046 & -0.0094 & 0.0063 & 1.0875 & 0.5288 & 0.7272 \tabularnewline
162 & 0.005 & -0.0092 & 0.0067 & 1.0375 & 0.6015 & 0.7755 \tabularnewline
163 & 0.0054 & -0.0126 & 0.0075 & 1.9353 & 0.7682 & 0.8765 \tabularnewline
164 & 0.0057 & -0.0106 & 0.0078 & 1.3717 & 0.8353 & 0.9139 \tabularnewline
165 & 0.006 & -0.0127 & 0.0083 & 2.006 & 0.9523 & 0.9759 \tabularnewline
166 & 0.0063 & -0.0126 & 0.0087 & 1.9541 & 1.0434 & 1.0215 \tabularnewline
167 & 0.0066 & -0.0108 & 0.0089 & 1.4314 & 1.0757 & 1.0372 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70977&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.0037[/C][C]0[/C][C]0.1592[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]157[/C][C]0.0023[/C][C]-0.0063[/C][C]0.005[/C][C]0.476[/C][C]0.3176[/C][C]0.5636[/C][/ROW]
[ROW][C]158[/C][C]0.0031[/C][C]-0.0042[/C][C]0.0047[/C][C]0.2142[/C][C]0.2831[/C][C]0.5321[/C][/ROW]
[ROW][C]159[/C][C]0.0036[/C][C]-0.0067[/C][C]0.0052[/C][C]0.5417[/C][C]0.3478[/C][C]0.5897[/C][/ROW]
[ROW][C]160[/C][C]0.0041[/C][C]-0.0076[/C][C]0.0057[/C][C]0.6943[/C][C]0.4171[/C][C]0.6458[/C][/ROW]
[ROW][C]161[/C][C]0.0046[/C][C]-0.0094[/C][C]0.0063[/C][C]1.0875[/C][C]0.5288[/C][C]0.7272[/C][/ROW]
[ROW][C]162[/C][C]0.005[/C][C]-0.0092[/C][C]0.0067[/C][C]1.0375[/C][C]0.6015[/C][C]0.7755[/C][/ROW]
[ROW][C]163[/C][C]0.0054[/C][C]-0.0126[/C][C]0.0075[/C][C]1.9353[/C][C]0.7682[/C][C]0.8765[/C][/ROW]
[ROW][C]164[/C][C]0.0057[/C][C]-0.0106[/C][C]0.0078[/C][C]1.3717[/C][C]0.8353[/C][C]0.9139[/C][/ROW]
[ROW][C]165[/C][C]0.006[/C][C]-0.0127[/C][C]0.0083[/C][C]2.006[/C][C]0.9523[/C][C]0.9759[/C][/ROW]
[ROW][C]166[/C][C]0.0063[/C][C]-0.0126[/C][C]0.0087[/C][C]1.9541[/C][C]1.0434[/C][C]1.0215[/C][/ROW]
[ROW][C]167[/C][C]0.0066[/C][C]-0.0108[/C][C]0.0089[/C][C]1.4314[/C][C]1.0757[/C][C]1.0372[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70977&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70977&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.003700.159200
1570.0023-0.00630.0050.4760.31760.5636
1580.0031-0.00420.00470.21420.28310.5321
1590.0036-0.00670.00520.54170.34780.5897
1600.0041-0.00760.00570.69430.41710.6458
1610.0046-0.00940.00631.08750.52880.7272
1620.005-0.00920.00671.03750.60150.7755
1630.0054-0.01260.00751.93530.76820.8765
1640.0057-0.01060.00781.37170.83530.9139
1650.006-0.01270.00832.0060.95230.9759
1660.0063-0.01260.00871.95411.04341.0215
1670.0066-0.01080.00891.43141.07571.0372



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