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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70980&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.2113108.9057109.51690.00230.946510.9465
157108.11108.8519108.3628109.34090.00150.628610.3324
158108.67109.2064108.5859109.82680.04510.999710.7818
159109.05109.8581109.1296110.58670.01480.999310.9922
160109.43110.4322109.6097111.25480.00850.999510.9998
161109.62110.8632109.9563111.770.00360.99911
162109.85111.0859110.1019112.06980.00690.99820.99991
163109.34110.941109.8855111.99640.00150.97860.99970.9999
164109.65111.0336109.9112112.1560.00780.99840.99980.9999
165109.69111.2555110.0699112.44110.00480.9960.99920.9999
166109.91111.4538110.2082112.69930.00760.99720.99951
167110.09111.5095110.2068112.81230.01640.99190.99990.9999

\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.2113 & 108.9057 & 109.5169 & 0.0023 & 0.9465 & 1 & 0.9465 \tabularnewline
157 & 108.11 & 108.8519 & 108.3628 & 109.3409 & 0.0015 & 0.6286 & 1 & 0.3324 \tabularnewline
158 & 108.67 & 109.2064 & 108.5859 & 109.8268 & 0.0451 & 0.9997 & 1 & 0.7818 \tabularnewline
159 & 109.05 & 109.8581 & 109.1296 & 110.5867 & 0.0148 & 0.9993 & 1 & 0.9922 \tabularnewline
160 & 109.43 & 110.4322 & 109.6097 & 111.2548 & 0.0085 & 0.9995 & 1 & 0.9998 \tabularnewline
161 & 109.62 & 110.8632 & 109.9563 & 111.77 & 0.0036 & 0.999 & 1 & 1 \tabularnewline
162 & 109.85 & 111.0859 & 110.1019 & 112.0698 & 0.0069 & 0.9982 & 0.9999 & 1 \tabularnewline
163 & 109.34 & 110.941 & 109.8855 & 111.9964 & 0.0015 & 0.9786 & 0.9997 & 0.9999 \tabularnewline
164 & 109.65 & 111.0336 & 109.9112 & 112.156 & 0.0078 & 0.9984 & 0.9998 & 0.9999 \tabularnewline
165 & 109.69 & 111.2555 & 110.0699 & 112.4411 & 0.0048 & 0.996 & 0.9992 & 0.9999 \tabularnewline
166 & 109.91 & 111.4538 & 110.2082 & 112.6993 & 0.0076 & 0.9972 & 0.9995 & 1 \tabularnewline
167 & 110.09 & 111.5095 & 110.2068 & 112.8123 & 0.0164 & 0.9919 & 0.9999 & 0.9999 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70980&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.2113[/C][C]108.9057[/C][C]109.5169[/C][C]0.0023[/C][C]0.9465[/C][C]1[/C][C]0.9465[/C][/ROW]
[ROW][C]157[/C][C]108.11[/C][C]108.8519[/C][C]108.3628[/C][C]109.3409[/C][C]0.0015[/C][C]0.6286[/C][C]1[/C][C]0.3324[/C][/ROW]
[ROW][C]158[/C][C]108.67[/C][C]109.2064[/C][C]108.5859[/C][C]109.8268[/C][C]0.0451[/C][C]0.9997[/C][C]1[/C][C]0.7818[/C][/ROW]
[ROW][C]159[/C][C]109.05[/C][C]109.8581[/C][C]109.1296[/C][C]110.5867[/C][C]0.0148[/C][C]0.9993[/C][C]1[/C][C]0.9922[/C][/ROW]
[ROW][C]160[/C][C]109.43[/C][C]110.4322[/C][C]109.6097[/C][C]111.2548[/C][C]0.0085[/C][C]0.9995[/C][C]1[/C][C]0.9998[/C][/ROW]
[ROW][C]161[/C][C]109.62[/C][C]110.8632[/C][C]109.9563[/C][C]111.77[/C][C]0.0036[/C][C]0.999[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]162[/C][C]109.85[/C][C]111.0859[/C][C]110.1019[/C][C]112.0698[/C][C]0.0069[/C][C]0.9982[/C][C]0.9999[/C][C]1[/C][/ROW]
[ROW][C]163[/C][C]109.34[/C][C]110.941[/C][C]109.8855[/C][C]111.9964[/C][C]0.0015[/C][C]0.9786[/C][C]0.9997[/C][C]0.9999[/C][/ROW]
[ROW][C]164[/C][C]109.65[/C][C]111.0336[/C][C]109.9112[/C][C]112.156[/C][C]0.0078[/C][C]0.9984[/C][C]0.9998[/C][C]0.9999[/C][/ROW]
[ROW][C]165[/C][C]109.69[/C][C]111.2555[/C][C]110.0699[/C][C]112.4411[/C][C]0.0048[/C][C]0.996[/C][C]0.9992[/C][C]0.9999[/C][/ROW]
[ROW][C]166[/C][C]109.91[/C][C]111.4538[/C][C]110.2082[/C][C]112.6993[/C][C]0.0076[/C][C]0.9972[/C][C]0.9995[/C][C]1[/C][/ROW]
[ROW][C]167[/C][C]110.09[/C][C]111.5095[/C][C]110.2068[/C][C]112.8123[/C][C]0.0164[/C][C]0.9919[/C][C]0.9999[/C][C]0.9999[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70980&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70980&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.2113108.9057109.51690.00230.946510.9465
157108.11108.8519108.3628109.34090.00150.628610.3324
158108.67109.2064108.5859109.82680.04510.999710.7818
159109.05109.8581109.1296110.58670.01480.999310.9922
160109.43110.4322109.6097111.25480.00850.999510.9998
161109.62110.8632109.9563111.770.00360.99911
162109.85111.0859110.1019112.06980.00690.99820.99991
163109.34110.941109.8855111.99640.00150.97860.99970.9999
164109.65111.0336109.9112112.1560.00780.99840.99980.9999
165109.69111.2555110.0699112.44110.00480.9960.99920.9999
166109.91111.4538110.2082112.69930.00760.99720.99951
167110.09111.5095110.2068112.81230.01640.99190.99990.9999







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1560.0014-0.00400.194700
1570.0023-0.00680.00540.55040.37260.6104
1580.0029-0.00490.00530.28770.34430.5867
1590.0034-0.00740.00580.65310.42150.6492
1600.0038-0.00910.00641.00450.53810.7335
1610.0042-0.01120.00721.54550.7060.8402
1620.0045-0.01110.00781.52730.82330.9074
1630.0049-0.01440.00862.56311.04081.0202
1640.0052-0.01250.0091.91431.13781.0667
1650.0054-0.01410.00962.45081.26911.1266
1660.0057-0.01390.00992.38331.37041.1707
1670.006-0.01270.01022.01511.42411.1934

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
156 & 0.0014 & -0.004 & 0 & 0.1947 & 0 & 0 \tabularnewline
157 & 0.0023 & -0.0068 & 0.0054 & 0.5504 & 0.3726 & 0.6104 \tabularnewline
158 & 0.0029 & -0.0049 & 0.0053 & 0.2877 & 0.3443 & 0.5867 \tabularnewline
159 & 0.0034 & -0.0074 & 0.0058 & 0.6531 & 0.4215 & 0.6492 \tabularnewline
160 & 0.0038 & -0.0091 & 0.0064 & 1.0045 & 0.5381 & 0.7335 \tabularnewline
161 & 0.0042 & -0.0112 & 0.0072 & 1.5455 & 0.706 & 0.8402 \tabularnewline
162 & 0.0045 & -0.0111 & 0.0078 & 1.5273 & 0.8233 & 0.9074 \tabularnewline
163 & 0.0049 & -0.0144 & 0.0086 & 2.5631 & 1.0408 & 1.0202 \tabularnewline
164 & 0.0052 & -0.0125 & 0.009 & 1.9143 & 1.1378 & 1.0667 \tabularnewline
165 & 0.0054 & -0.0141 & 0.0096 & 2.4508 & 1.2691 & 1.1266 \tabularnewline
166 & 0.0057 & -0.0139 & 0.0099 & 2.3833 & 1.3704 & 1.1707 \tabularnewline
167 & 0.006 & -0.0127 & 0.0102 & 2.0151 & 1.4241 & 1.1934 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70980&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.004[/C][C]0[/C][C]0.1947[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]157[/C][C]0.0023[/C][C]-0.0068[/C][C]0.0054[/C][C]0.5504[/C][C]0.3726[/C][C]0.6104[/C][/ROW]
[ROW][C]158[/C][C]0.0029[/C][C]-0.0049[/C][C]0.0053[/C][C]0.2877[/C][C]0.3443[/C][C]0.5867[/C][/ROW]
[ROW][C]159[/C][C]0.0034[/C][C]-0.0074[/C][C]0.0058[/C][C]0.6531[/C][C]0.4215[/C][C]0.6492[/C][/ROW]
[ROW][C]160[/C][C]0.0038[/C][C]-0.0091[/C][C]0.0064[/C][C]1.0045[/C][C]0.5381[/C][C]0.7335[/C][/ROW]
[ROW][C]161[/C][C]0.0042[/C][C]-0.0112[/C][C]0.0072[/C][C]1.5455[/C][C]0.706[/C][C]0.8402[/C][/ROW]
[ROW][C]162[/C][C]0.0045[/C][C]-0.0111[/C][C]0.0078[/C][C]1.5273[/C][C]0.8233[/C][C]0.9074[/C][/ROW]
[ROW][C]163[/C][C]0.0049[/C][C]-0.0144[/C][C]0.0086[/C][C]2.5631[/C][C]1.0408[/C][C]1.0202[/C][/ROW]
[ROW][C]164[/C][C]0.0052[/C][C]-0.0125[/C][C]0.009[/C][C]1.9143[/C][C]1.1378[/C][C]1.0667[/C][/ROW]
[ROW][C]165[/C][C]0.0054[/C][C]-0.0141[/C][C]0.0096[/C][C]2.4508[/C][C]1.2691[/C][C]1.1266[/C][/ROW]
[ROW][C]166[/C][C]0.0057[/C][C]-0.0139[/C][C]0.0099[/C][C]2.3833[/C][C]1.3704[/C][C]1.1707[/C][/ROW]
[ROW][C]167[/C][C]0.006[/C][C]-0.0127[/C][C]0.0102[/C][C]2.0151[/C][C]1.4241[/C][C]1.1934[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70980&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70980&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.00400.194700
1570.0023-0.00680.00540.55040.37260.6104
1580.0029-0.00490.00530.28770.34430.5867
1590.0034-0.00740.00580.65310.42150.6492
1600.0038-0.00910.00641.00450.53810.7335
1610.0042-0.01120.00721.54550.7060.8402
1620.0045-0.01110.00781.52730.82330.9074
1630.0049-0.01440.00862.56311.04081.0202
1640.0052-0.01250.0091.91431.13781.0667
1650.0054-0.01410.00962.45081.26911.1266
1660.0057-0.01390.00992.38331.37041.1707
1670.006-0.01270.01022.01511.42411.1934



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