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 08:34:08 -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/t1262014530iwofq97zasp7rm1.htm/, Retrieved Sat, 04 May 2024 21:04:29 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70997, Retrieved Sat, 04 May 2024 21:04:29 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordspaper
Estimated Impact138
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 15:34:08] [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=70997&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=70997&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70997&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.3258108.9115109.74480.00470.956410.9564
157108.11108.9499108.3195109.59150.00510.708710.4877
158108.67109.3909108.5836110.21640.04350.998810.8468
159109.05110.1261109.1601111.11830.01680.99810.9894
160109.43110.6827109.5766111.8230.01570.997510.9985
161109.62111.1048109.8728112.37930.01120.9950.99990.9995
162109.85111.2703109.929112.66190.02270.98990.99850.9994
163109.34111.0864109.6562112.57410.01070.94830.99590.9975
164109.65111.2537109.7276112.84540.02410.99080.99680.9976
165109.69111.6541110.0264113.35610.01190.98950.99610.999
166109.91111.8751110.1568113.67640.01630.99130.99680.9992
167110.09111.9077110.1106113.79580.02960.9810.99890.9989

\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.3258 & 108.9115 & 109.7448 & 0.0047 & 0.9564 & 1 & 0.9564 \tabularnewline
157 & 108.11 & 108.9499 & 108.3195 & 109.5915 & 0.0051 & 0.7087 & 1 & 0.4877 \tabularnewline
158 & 108.67 & 109.3909 & 108.5836 & 110.2164 & 0.0435 & 0.9988 & 1 & 0.8468 \tabularnewline
159 & 109.05 & 110.1261 & 109.1601 & 111.1183 & 0.0168 & 0.998 & 1 & 0.9894 \tabularnewline
160 & 109.43 & 110.6827 & 109.5766 & 111.823 & 0.0157 & 0.9975 & 1 & 0.9985 \tabularnewline
161 & 109.62 & 111.1048 & 109.8728 & 112.3793 & 0.0112 & 0.995 & 0.9999 & 0.9995 \tabularnewline
162 & 109.85 & 111.2703 & 109.929 & 112.6619 & 0.0227 & 0.9899 & 0.9985 & 0.9994 \tabularnewline
163 & 109.34 & 111.0864 & 109.6562 & 112.5741 & 0.0107 & 0.9483 & 0.9959 & 0.9975 \tabularnewline
164 & 109.65 & 111.2537 & 109.7276 & 112.8454 & 0.0241 & 0.9908 & 0.9968 & 0.9976 \tabularnewline
165 & 109.69 & 111.6541 & 110.0264 & 113.3561 & 0.0119 & 0.9895 & 0.9961 & 0.999 \tabularnewline
166 & 109.91 & 111.8751 & 110.1568 & 113.6764 & 0.0163 & 0.9913 & 0.9968 & 0.9992 \tabularnewline
167 & 110.09 & 111.9077 & 110.1106 & 113.7958 & 0.0296 & 0.981 & 0.9989 & 0.9989 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70997&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.3258[/C][C]108.9115[/C][C]109.7448[/C][C]0.0047[/C][C]0.9564[/C][C]1[/C][C]0.9564[/C][/ROW]
[ROW][C]157[/C][C]108.11[/C][C]108.9499[/C][C]108.3195[/C][C]109.5915[/C][C]0.0051[/C][C]0.7087[/C][C]1[/C][C]0.4877[/C][/ROW]
[ROW][C]158[/C][C]108.67[/C][C]109.3909[/C][C]108.5836[/C][C]110.2164[/C][C]0.0435[/C][C]0.9988[/C][C]1[/C][C]0.8468[/C][/ROW]
[ROW][C]159[/C][C]109.05[/C][C]110.1261[/C][C]109.1601[/C][C]111.1183[/C][C]0.0168[/C][C]0.998[/C][C]1[/C][C]0.9894[/C][/ROW]
[ROW][C]160[/C][C]109.43[/C][C]110.6827[/C][C]109.5766[/C][C]111.823[/C][C]0.0157[/C][C]0.9975[/C][C]1[/C][C]0.9985[/C][/ROW]
[ROW][C]161[/C][C]109.62[/C][C]111.1048[/C][C]109.8728[/C][C]112.3793[/C][C]0.0112[/C][C]0.995[/C][C]0.9999[/C][C]0.9995[/C][/ROW]
[ROW][C]162[/C][C]109.85[/C][C]111.2703[/C][C]109.929[/C][C]112.6619[/C][C]0.0227[/C][C]0.9899[/C][C]0.9985[/C][C]0.9994[/C][/ROW]
[ROW][C]163[/C][C]109.34[/C][C]111.0864[/C][C]109.6562[/C][C]112.5741[/C][C]0.0107[/C][C]0.9483[/C][C]0.9959[/C][C]0.9975[/C][/ROW]
[ROW][C]164[/C][C]109.65[/C][C]111.2537[/C][C]109.7276[/C][C]112.8454[/C][C]0.0241[/C][C]0.9908[/C][C]0.9968[/C][C]0.9976[/C][/ROW]
[ROW][C]165[/C][C]109.69[/C][C]111.6541[/C][C]110.0264[/C][C]113.3561[/C][C]0.0119[/C][C]0.9895[/C][C]0.9961[/C][C]0.999[/C][/ROW]
[ROW][C]166[/C][C]109.91[/C][C]111.8751[/C][C]110.1568[/C][C]113.6764[/C][C]0.0163[/C][C]0.9913[/C][C]0.9968[/C][C]0.9992[/C][/ROW]
[ROW][C]167[/C][C]110.09[/C][C]111.9077[/C][C]110.1106[/C][C]113.7958[/C][C]0.0296[/C][C]0.981[/C][C]0.9989[/C][C]0.9989[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70997&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70997&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.3258108.9115109.74480.00470.956410.9564
157108.11108.9499108.3195109.59150.00510.708710.4877
158108.67109.3909108.5836110.21640.04350.998810.8468
159109.05110.1261109.1601111.11830.01680.99810.9894
160109.43110.6827109.5766111.8230.01570.997510.9985
161109.62111.1048109.8728112.37930.01120.9950.99990.9995
162109.85111.2703109.929112.66190.02270.98990.99850.9994
163109.34111.0864109.6562112.57410.01070.94830.99590.9975
164109.65111.2537109.7276112.84540.02410.99080.99680.9976
165109.69111.6541110.0264113.35610.01190.98950.99610.999
166109.91111.8751110.1568113.67640.01630.99130.99680.9992
167110.09111.9077110.1106113.79580.02960.9810.99890.9989







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1560.002-0.005100.308900
1570.003-0.00770.00640.70550.50720.7122
1580.0039-0.00660.00650.51970.51140.7151
1590.0046-0.00980.00731.15810.6730.8204
1600.0053-0.01130.00811.56920.85230.9232
1610.0059-0.01340.0092.20481.07771.0381
1620.0064-0.01280.00952.01711.21191.1009
1630.0068-0.01570.01033.04991.44161.2007
1640.0073-0.01440.01072.5721.56721.2519
1650.0078-0.01760.01143.85751.79631.3402
1660.0082-0.01760.0123.86151.9841.4085
1670.0086-0.01620.01233.30422.0941.4471

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
156 & 0.002 & -0.0051 & 0 & 0.3089 & 0 & 0 \tabularnewline
157 & 0.003 & -0.0077 & 0.0064 & 0.7055 & 0.5072 & 0.7122 \tabularnewline
158 & 0.0039 & -0.0066 & 0.0065 & 0.5197 & 0.5114 & 0.7151 \tabularnewline
159 & 0.0046 & -0.0098 & 0.0073 & 1.1581 & 0.673 & 0.8204 \tabularnewline
160 & 0.0053 & -0.0113 & 0.0081 & 1.5692 & 0.8523 & 0.9232 \tabularnewline
161 & 0.0059 & -0.0134 & 0.009 & 2.2048 & 1.0777 & 1.0381 \tabularnewline
162 & 0.0064 & -0.0128 & 0.0095 & 2.0171 & 1.2119 & 1.1009 \tabularnewline
163 & 0.0068 & -0.0157 & 0.0103 & 3.0499 & 1.4416 & 1.2007 \tabularnewline
164 & 0.0073 & -0.0144 & 0.0107 & 2.572 & 1.5672 & 1.2519 \tabularnewline
165 & 0.0078 & -0.0176 & 0.0114 & 3.8575 & 1.7963 & 1.3402 \tabularnewline
166 & 0.0082 & -0.0176 & 0.012 & 3.8615 & 1.984 & 1.4085 \tabularnewline
167 & 0.0086 & -0.0162 & 0.0123 & 3.3042 & 2.094 & 1.4471 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70997&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.002[/C][C]-0.0051[/C][C]0[/C][C]0.3089[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]157[/C][C]0.003[/C][C]-0.0077[/C][C]0.0064[/C][C]0.7055[/C][C]0.5072[/C][C]0.7122[/C][/ROW]
[ROW][C]158[/C][C]0.0039[/C][C]-0.0066[/C][C]0.0065[/C][C]0.5197[/C][C]0.5114[/C][C]0.7151[/C][/ROW]
[ROW][C]159[/C][C]0.0046[/C][C]-0.0098[/C][C]0.0073[/C][C]1.1581[/C][C]0.673[/C][C]0.8204[/C][/ROW]
[ROW][C]160[/C][C]0.0053[/C][C]-0.0113[/C][C]0.0081[/C][C]1.5692[/C][C]0.8523[/C][C]0.9232[/C][/ROW]
[ROW][C]161[/C][C]0.0059[/C][C]-0.0134[/C][C]0.009[/C][C]2.2048[/C][C]1.0777[/C][C]1.0381[/C][/ROW]
[ROW][C]162[/C][C]0.0064[/C][C]-0.0128[/C][C]0.0095[/C][C]2.0171[/C][C]1.2119[/C][C]1.1009[/C][/ROW]
[ROW][C]163[/C][C]0.0068[/C][C]-0.0157[/C][C]0.0103[/C][C]3.0499[/C][C]1.4416[/C][C]1.2007[/C][/ROW]
[ROW][C]164[/C][C]0.0073[/C][C]-0.0144[/C][C]0.0107[/C][C]2.572[/C][C]1.5672[/C][C]1.2519[/C][/ROW]
[ROW][C]165[/C][C]0.0078[/C][C]-0.0176[/C][C]0.0114[/C][C]3.8575[/C][C]1.7963[/C][C]1.3402[/C][/ROW]
[ROW][C]166[/C][C]0.0082[/C][C]-0.0176[/C][C]0.012[/C][C]3.8615[/C][C]1.984[/C][C]1.4085[/C][/ROW]
[ROW][C]167[/C][C]0.0086[/C][C]-0.0162[/C][C]0.0123[/C][C]3.3042[/C][C]2.094[/C][C]1.4471[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70997&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70997&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.002-0.005100.308900
1570.003-0.00770.00640.70550.50720.7122
1580.0039-0.00660.00650.51970.51140.7151
1590.0046-0.00980.00731.15810.6730.8204
1600.0053-0.01130.00811.56920.85230.9232
1610.0059-0.01340.0092.20481.07771.0381
1620.0064-0.01280.00952.01711.21191.1009
1630.0068-0.01570.01033.04991.44161.2007
1640.0073-0.01440.01072.5721.56721.2519
1650.0078-0.01760.01143.85751.79631.3402
1660.0082-0.01760.0123.86151.9841.4085
1670.0086-0.01620.01233.30422.0941.4471



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