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:38:28 -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/t1262014791r81nli25x9pb0ax.htm/, Retrieved Sun, 05 May 2024 14:03:44 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70999, Retrieved Sun, 05 May 2024 14:03:44 +0000
QR Codes:

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70999&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.3824108.9118109.86110.00610.958110.9581
157108.11109.0012108.2813109.74060.00910.7310.5435
158108.67109.538108.617110.4910.03710.998310.8827
159109.05110.3619109.2552111.5150.01290.99810.9914
160109.43110.9878109.7159112.32080.0110.997810.9986
161109.62111.4737110.0523112.97150.00760.99630.99980.9995
162109.85111.6452110.0984113.28290.01580.99230.99850.9993
163109.34111.4248109.7826113.16980.00960.96150.99580.9972
164109.65111.638109.8828113.51110.01870.99190.99670.9975
165109.69112.1331110.2508114.15080.00880.99210.99670.999
166109.91112.3616110.3723114.50250.01240.99280.99690.9991
167110.09112.4244110.3431114.67210.02090.98580.99870.9987

\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.3824 & 108.9118 & 109.8611 & 0.0061 & 0.9581 & 1 & 0.9581 \tabularnewline
157 & 108.11 & 109.0012 & 108.2813 & 109.7406 & 0.0091 & 0.73 & 1 & 0.5435 \tabularnewline
158 & 108.67 & 109.538 & 108.617 & 110.491 & 0.0371 & 0.9983 & 1 & 0.8827 \tabularnewline
159 & 109.05 & 110.3619 & 109.2552 & 111.515 & 0.0129 & 0.998 & 1 & 0.9914 \tabularnewline
160 & 109.43 & 110.9878 & 109.7159 & 112.3208 & 0.011 & 0.9978 & 1 & 0.9986 \tabularnewline
161 & 109.62 & 111.4737 & 110.0523 & 112.9715 & 0.0076 & 0.9963 & 0.9998 & 0.9995 \tabularnewline
162 & 109.85 & 111.6452 & 110.0984 & 113.2829 & 0.0158 & 0.9923 & 0.9985 & 0.9993 \tabularnewline
163 & 109.34 & 111.4248 & 109.7826 & 113.1698 & 0.0096 & 0.9615 & 0.9958 & 0.9972 \tabularnewline
164 & 109.65 & 111.638 & 109.8828 & 113.5111 & 0.0187 & 0.9919 & 0.9967 & 0.9975 \tabularnewline
165 & 109.69 & 112.1331 & 110.2508 & 114.1508 & 0.0088 & 0.9921 & 0.9967 & 0.999 \tabularnewline
166 & 109.91 & 112.3616 & 110.3723 & 114.5025 & 0.0124 & 0.9928 & 0.9969 & 0.9991 \tabularnewline
167 & 110.09 & 112.4244 & 110.3431 & 114.6721 & 0.0209 & 0.9858 & 0.9987 & 0.9987 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70999&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.3824[/C][C]108.9118[/C][C]109.8611[/C][C]0.0061[/C][C]0.9581[/C][C]1[/C][C]0.9581[/C][/ROW]
[ROW][C]157[/C][C]108.11[/C][C]109.0012[/C][C]108.2813[/C][C]109.7406[/C][C]0.0091[/C][C]0.73[/C][C]1[/C][C]0.5435[/C][/ROW]
[ROW][C]158[/C][C]108.67[/C][C]109.538[/C][C]108.617[/C][C]110.491[/C][C]0.0371[/C][C]0.9983[/C][C]1[/C][C]0.8827[/C][/ROW]
[ROW][C]159[/C][C]109.05[/C][C]110.3619[/C][C]109.2552[/C][C]111.515[/C][C]0.0129[/C][C]0.998[/C][C]1[/C][C]0.9914[/C][/ROW]
[ROW][C]160[/C][C]109.43[/C][C]110.9878[/C][C]109.7159[/C][C]112.3208[/C][C]0.011[/C][C]0.9978[/C][C]1[/C][C]0.9986[/C][/ROW]
[ROW][C]161[/C][C]109.62[/C][C]111.4737[/C][C]110.0523[/C][C]112.9715[/C][C]0.0076[/C][C]0.9963[/C][C]0.9998[/C][C]0.9995[/C][/ROW]
[ROW][C]162[/C][C]109.85[/C][C]111.6452[/C][C]110.0984[/C][C]113.2829[/C][C]0.0158[/C][C]0.9923[/C][C]0.9985[/C][C]0.9993[/C][/ROW]
[ROW][C]163[/C][C]109.34[/C][C]111.4248[/C][C]109.7826[/C][C]113.1698[/C][C]0.0096[/C][C]0.9615[/C][C]0.9958[/C][C]0.9972[/C][/ROW]
[ROW][C]164[/C][C]109.65[/C][C]111.638[/C][C]109.8828[/C][C]113.5111[/C][C]0.0187[/C][C]0.9919[/C][C]0.9967[/C][C]0.9975[/C][/ROW]
[ROW][C]165[/C][C]109.69[/C][C]112.1331[/C][C]110.2508[/C][C]114.1508[/C][C]0.0088[/C][C]0.9921[/C][C]0.9967[/C][C]0.999[/C][/ROW]
[ROW][C]166[/C][C]109.91[/C][C]112.3616[/C][C]110.3723[/C][C]114.5025[/C][C]0.0124[/C][C]0.9928[/C][C]0.9969[/C][C]0.9991[/C][/ROW]
[ROW][C]167[/C][C]110.09[/C][C]112.4244[/C][C]110.3431[/C][C]114.6721[/C][C]0.0209[/C][C]0.9858[/C][C]0.9987[/C][C]0.9987[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70999&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70999&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.3824108.9118109.86110.00610.958110.9581
157108.11109.0012108.2813109.74060.00910.7310.5435
158108.67109.538108.617110.4910.03710.998310.8827
159109.05110.3619109.2552111.5150.01290.99810.9914
160109.43110.9878109.7159112.32080.0110.997810.9986
161109.62111.4737110.0523112.97150.00760.99630.99980.9995
162109.85111.6452110.0984113.28290.01580.99230.99850.9993
163109.34111.4248109.7826113.16980.00960.96150.99580.9972
164109.65111.638109.8828113.51110.01870.99190.99670.9975
165109.69112.1331110.2508114.15080.00880.99210.99670.999
166109.91112.3616110.3723114.50250.01240.99280.99690.9991
167110.09112.4244110.3431114.67210.02090.98580.99870.9987







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1560.0022-0.005600.37500
1570.0035-0.00820.00690.79420.58460.7646
1580.0044-0.00790.00720.75340.64090.8005
1590.0053-0.01190.00841.72120.91090.9544
1600.0061-0.0140.00952.42671.21411.1019
1610.0069-0.01660.01073.43621.58451.2588
1620.0075-0.01610.01153.22291.81851.3485
1630.008-0.01870.01244.34622.13451.461
1640.0086-0.01780.0133.95232.33651.5285
1650.0092-0.02180.01395.96852.69971.6431
1660.0097-0.02180.01466.01023.00061.7322
1670.0102-0.02080.01515.44933.20471.7902

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
156 & 0.0022 & -0.0056 & 0 & 0.375 & 0 & 0 \tabularnewline
157 & 0.0035 & -0.0082 & 0.0069 & 0.7942 & 0.5846 & 0.7646 \tabularnewline
158 & 0.0044 & -0.0079 & 0.0072 & 0.7534 & 0.6409 & 0.8005 \tabularnewline
159 & 0.0053 & -0.0119 & 0.0084 & 1.7212 & 0.9109 & 0.9544 \tabularnewline
160 & 0.0061 & -0.014 & 0.0095 & 2.4267 & 1.2141 & 1.1019 \tabularnewline
161 & 0.0069 & -0.0166 & 0.0107 & 3.4362 & 1.5845 & 1.2588 \tabularnewline
162 & 0.0075 & -0.0161 & 0.0115 & 3.2229 & 1.8185 & 1.3485 \tabularnewline
163 & 0.008 & -0.0187 & 0.0124 & 4.3462 & 2.1345 & 1.461 \tabularnewline
164 & 0.0086 & -0.0178 & 0.013 & 3.9523 & 2.3365 & 1.5285 \tabularnewline
165 & 0.0092 & -0.0218 & 0.0139 & 5.9685 & 2.6997 & 1.6431 \tabularnewline
166 & 0.0097 & -0.0218 & 0.0146 & 6.0102 & 3.0006 & 1.7322 \tabularnewline
167 & 0.0102 & -0.0208 & 0.0151 & 5.4493 & 3.2047 & 1.7902 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70999&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.0022[/C][C]-0.0056[/C][C]0[/C][C]0.375[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]157[/C][C]0.0035[/C][C]-0.0082[/C][C]0.0069[/C][C]0.7942[/C][C]0.5846[/C][C]0.7646[/C][/ROW]
[ROW][C]158[/C][C]0.0044[/C][C]-0.0079[/C][C]0.0072[/C][C]0.7534[/C][C]0.6409[/C][C]0.8005[/C][/ROW]
[ROW][C]159[/C][C]0.0053[/C][C]-0.0119[/C][C]0.0084[/C][C]1.7212[/C][C]0.9109[/C][C]0.9544[/C][/ROW]
[ROW][C]160[/C][C]0.0061[/C][C]-0.014[/C][C]0.0095[/C][C]2.4267[/C][C]1.2141[/C][C]1.1019[/C][/ROW]
[ROW][C]161[/C][C]0.0069[/C][C]-0.0166[/C][C]0.0107[/C][C]3.4362[/C][C]1.5845[/C][C]1.2588[/C][/ROW]
[ROW][C]162[/C][C]0.0075[/C][C]-0.0161[/C][C]0.0115[/C][C]3.2229[/C][C]1.8185[/C][C]1.3485[/C][/ROW]
[ROW][C]163[/C][C]0.008[/C][C]-0.0187[/C][C]0.0124[/C][C]4.3462[/C][C]2.1345[/C][C]1.461[/C][/ROW]
[ROW][C]164[/C][C]0.0086[/C][C]-0.0178[/C][C]0.013[/C][C]3.9523[/C][C]2.3365[/C][C]1.5285[/C][/ROW]
[ROW][C]165[/C][C]0.0092[/C][C]-0.0218[/C][C]0.0139[/C][C]5.9685[/C][C]2.6997[/C][C]1.6431[/C][/ROW]
[ROW][C]166[/C][C]0.0097[/C][C]-0.0218[/C][C]0.0146[/C][C]6.0102[/C][C]3.0006[/C][C]1.7322[/C][/ROW]
[ROW][C]167[/C][C]0.0102[/C][C]-0.0208[/C][C]0.0151[/C][C]5.4493[/C][C]3.2047[/C][C]1.7902[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70999&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70999&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.0022-0.005600.37500
1570.0035-0.00820.00690.79420.58460.7646
1580.0044-0.00790.00720.75340.64090.8005
1590.0053-0.01190.00841.72120.91090.9544
1600.0061-0.0140.00952.42671.21411.1019
1610.0069-0.01660.01073.43621.58451.2588
1620.0075-0.01610.01153.22291.81851.3485
1630.008-0.01870.01244.34622.13451.461
1640.0086-0.01780.0133.95232.33651.5285
1650.0092-0.02180.01395.96852.69971.6431
1660.0097-0.02180.01466.01023.00061.7322
1670.0102-0.02080.01515.44933.20471.7902



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