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 computationTue, 16 Dec 2008 02:49:01 -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/2008/Dec/16/t12294209741ta0hrgr1z45ggb.htm/, Retrieved Wed, 15 May 2024 00:52:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33884, Retrieved Wed, 15 May 2024 00:52:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact218
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [(Partial) Autocor...] [2008-12-13 16:08:49] [d134696a922d84037f02d49ded84b0bd]
-   P   [(Partial) Autocorrelation Function] [(Partial) Autocor...] [2008-12-14 14:45:58] [d134696a922d84037f02d49ded84b0bd]
- RMP     [ARIMA Backward Selection] [Backward Selectio...] [2008-12-14 16:30:33] [d134696a922d84037f02d49ded84b0bd]
-   P       [ARIMA Backward Selection] [ARIMA Backward Se...] [2008-12-15 20:23:35] [d134696a922d84037f02d49ded84b0bd]
-   P         [ARIMA Backward Selection] [ARIMA Backward Se...] [2008-12-15 20:28:38] [d134696a922d84037f02d49ded84b0bd]
- RMP             [ARIMA Forecasting] [ARIMA Forecasting] [2008-12-16 09:49:01] [db9a5fd0f9c3e1245d8075d8bb09236d] [Current]
-                   [ARIMA Forecasting] [ARIMA Forecasting] [2008-12-16 09:51:44] [d134696a922d84037f02d49ded84b0bd]
Feedback Forum

Post a new message
Dataseries X:
205597
205471
211064
212856
217036
219302
219759
221388
220834
221788
222358
222972
224164
224915
226294
224690
227021
229284
229189
230032
229389
231053
232560
232681
231555
231428
232141
234939
235424
235471
236355
238693
236958
237060
239282
238252
241552
236230
238909
240723
242120
242100
243276
244677
243494
244902
245247
245578
243052
238121
241863
241203
243634
242351
245180
246126
244424
245166
247258
245094
246020
243082
245555
243685
247277
245029
246169
246778
244577
246048
245775
245328
245477
241903
243219
248088
248521
247389
249057
248916
249193
250768
253106
249829
249447
246755
250785
250140
255755
254671
253919
253741
252729
253810
256653
255231
258405
251061
254811
254895
258325
257608
258759
258621
257852
260560
262358
260812
261165
257164
260720
259581
264743
261845
262262
261631
258953
259966
262850
262204
263418
262752
266433
267722
266003
262971
265521
264676
270223
269508
268457
265814
266680
263018
269285
269829
270911
266844
271244
269907
271296
270157
271322
267179
264101
265518
269419
268714
272482
268351
268175
270674
272764
272599
270333
270846
270491
269160
274027
273784
276663
274525
271344
271115
270798
273911
273985
271917
273338
270601
273547
275363
281229
277793
279913
282500
280041
282166
290304
283519
287816
285226
287595
289741
289148
288301
290155
289648
288225
289351
294735
305333




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33884&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 time1 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[180])
168271917-------
169273338-------
170270601-------
171273547-------
172275363-------
173281229-------
174277793-------
175279913-------
176282500-------
177280041-------
178282166-------
179290304-------
180283519-------
181287816284578.8676280786.9061288370.82910.04710.708110.7081
182285226282396.3682277807.7317286985.00480.11340.010310.3158
183287595286259.3295280993.1924291525.46650.30960.649710.8461
184289741286755.3567280889.4541292621.25920.15920.38950.99990.8602
185289148290009.0343283599.2428296418.82580.39620.53270.99640.9764
186288301287331.7423280420.7337294242.7510.39170.30320.99660.8602
187290155288128.856280750.6005295507.11150.29520.48180.98550.8896
188289648288847.9502281030.3248296665.57570.42050.37160.94430.9092
189288225288741.0005280507.418296974.58310.45110.41450.98080.8931
190289351289946.9057281317.3927298576.41880.44620.65210.96140.9278
191294735292043.1617283035.1037301051.21970.2790.7210.64740.9682
192305333289279.9933279908.6689298651.31784e-040.1270.88590.8859

\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[180]) \tabularnewline
168 & 271917 & - & - & - & - & - & - & - \tabularnewline
169 & 273338 & - & - & - & - & - & - & - \tabularnewline
170 & 270601 & - & - & - & - & - & - & - \tabularnewline
171 & 273547 & - & - & - & - & - & - & - \tabularnewline
172 & 275363 & - & - & - & - & - & - & - \tabularnewline
173 & 281229 & - & - & - & - & - & - & - \tabularnewline
174 & 277793 & - & - & - & - & - & - & - \tabularnewline
175 & 279913 & - & - & - & - & - & - & - \tabularnewline
176 & 282500 & - & - & - & - & - & - & - \tabularnewline
177 & 280041 & - & - & - & - & - & - & - \tabularnewline
178 & 282166 & - & - & - & - & - & - & - \tabularnewline
179 & 290304 & - & - & - & - & - & - & - \tabularnewline
180 & 283519 & - & - & - & - & - & - & - \tabularnewline
181 & 287816 & 284578.8676 & 280786.9061 & 288370.8291 & 0.0471 & 0.7081 & 1 & 0.7081 \tabularnewline
182 & 285226 & 282396.3682 & 277807.7317 & 286985.0048 & 0.1134 & 0.0103 & 1 & 0.3158 \tabularnewline
183 & 287595 & 286259.3295 & 280993.1924 & 291525.4665 & 0.3096 & 0.6497 & 1 & 0.8461 \tabularnewline
184 & 289741 & 286755.3567 & 280889.4541 & 292621.2592 & 0.1592 & 0.3895 & 0.9999 & 0.8602 \tabularnewline
185 & 289148 & 290009.0343 & 283599.2428 & 296418.8258 & 0.3962 & 0.5327 & 0.9964 & 0.9764 \tabularnewline
186 & 288301 & 287331.7423 & 280420.7337 & 294242.751 & 0.3917 & 0.3032 & 0.9966 & 0.8602 \tabularnewline
187 & 290155 & 288128.856 & 280750.6005 & 295507.1115 & 0.2952 & 0.4818 & 0.9855 & 0.8896 \tabularnewline
188 & 289648 & 288847.9502 & 281030.3248 & 296665.5757 & 0.4205 & 0.3716 & 0.9443 & 0.9092 \tabularnewline
189 & 288225 & 288741.0005 & 280507.418 & 296974.5831 & 0.4511 & 0.4145 & 0.9808 & 0.8931 \tabularnewline
190 & 289351 & 289946.9057 & 281317.3927 & 298576.4188 & 0.4462 & 0.6521 & 0.9614 & 0.9278 \tabularnewline
191 & 294735 & 292043.1617 & 283035.1037 & 301051.2197 & 0.279 & 0.721 & 0.6474 & 0.9682 \tabularnewline
192 & 305333 & 289279.9933 & 279908.6689 & 298651.3178 & 4e-04 & 0.127 & 0.8859 & 0.8859 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33884&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[180])[/C][/ROW]
[ROW][C]168[/C][C]271917[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]169[/C][C]273338[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]170[/C][C]270601[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]171[/C][C]273547[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]172[/C][C]275363[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]173[/C][C]281229[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]174[/C][C]277793[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]175[/C][C]279913[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]176[/C][C]282500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]177[/C][C]280041[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]178[/C][C]282166[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]179[/C][C]290304[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]180[/C][C]283519[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]181[/C][C]287816[/C][C]284578.8676[/C][C]280786.9061[/C][C]288370.8291[/C][C]0.0471[/C][C]0.7081[/C][C]1[/C][C]0.7081[/C][/ROW]
[ROW][C]182[/C][C]285226[/C][C]282396.3682[/C][C]277807.7317[/C][C]286985.0048[/C][C]0.1134[/C][C]0.0103[/C][C]1[/C][C]0.3158[/C][/ROW]
[ROW][C]183[/C][C]287595[/C][C]286259.3295[/C][C]280993.1924[/C][C]291525.4665[/C][C]0.3096[/C][C]0.6497[/C][C]1[/C][C]0.8461[/C][/ROW]
[ROW][C]184[/C][C]289741[/C][C]286755.3567[/C][C]280889.4541[/C][C]292621.2592[/C][C]0.1592[/C][C]0.3895[/C][C]0.9999[/C][C]0.8602[/C][/ROW]
[ROW][C]185[/C][C]289148[/C][C]290009.0343[/C][C]283599.2428[/C][C]296418.8258[/C][C]0.3962[/C][C]0.5327[/C][C]0.9964[/C][C]0.9764[/C][/ROW]
[ROW][C]186[/C][C]288301[/C][C]287331.7423[/C][C]280420.7337[/C][C]294242.751[/C][C]0.3917[/C][C]0.3032[/C][C]0.9966[/C][C]0.8602[/C][/ROW]
[ROW][C]187[/C][C]290155[/C][C]288128.856[/C][C]280750.6005[/C][C]295507.1115[/C][C]0.2952[/C][C]0.4818[/C][C]0.9855[/C][C]0.8896[/C][/ROW]
[ROW][C]188[/C][C]289648[/C][C]288847.9502[/C][C]281030.3248[/C][C]296665.5757[/C][C]0.4205[/C][C]0.3716[/C][C]0.9443[/C][C]0.9092[/C][/ROW]
[ROW][C]189[/C][C]288225[/C][C]288741.0005[/C][C]280507.418[/C][C]296974.5831[/C][C]0.4511[/C][C]0.4145[/C][C]0.9808[/C][C]0.8931[/C][/ROW]
[ROW][C]190[/C][C]289351[/C][C]289946.9057[/C][C]281317.3927[/C][C]298576.4188[/C][C]0.4462[/C][C]0.6521[/C][C]0.9614[/C][C]0.9278[/C][/ROW]
[ROW][C]191[/C][C]294735[/C][C]292043.1617[/C][C]283035.1037[/C][C]301051.2197[/C][C]0.279[/C][C]0.721[/C][C]0.6474[/C][C]0.9682[/C][/ROW]
[ROW][C]192[/C][C]305333[/C][C]289279.9933[/C][C]279908.6689[/C][C]298651.3178[/C][C]4e-04[/C][C]0.127[/C][C]0.8859[/C][C]0.8859[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33884&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33884&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[180])
168271917-------
169273338-------
170270601-------
171273547-------
172275363-------
173281229-------
174277793-------
175279913-------
176282500-------
177280041-------
178282166-------
179290304-------
180283519-------
181287816284578.8676280786.9061288370.82910.04710.708110.7081
182285226282396.3682277807.7317286985.00480.11340.010310.3158
183287595286259.3295280993.1924291525.46650.30960.649710.8461
184289741286755.3567280889.4541292621.25920.15920.38950.99990.8602
185289148290009.0343283599.2428296418.82580.39620.53270.99640.9764
186288301287331.7423280420.7337294242.7510.39170.30320.99660.8602
187290155288128.856280750.6005295507.11150.29520.48180.98550.8896
188289648288847.9502281030.3248296665.57570.42050.37160.94430.9092
189288225288741.0005280507.418296974.58310.45110.41450.98080.8931
190289351289946.9057281317.3927298576.41880.44620.65210.96140.9278
191294735292043.1617283035.1037301051.21970.2790.7210.64740.9682
192305333289279.9933279908.6689298651.31784e-040.1270.88590.8859







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1810.00680.01149e-0410479026.2497873252.1875934.4796
1820.00830.018e-048006815.8538667234.6545816.8443
1830.00940.00474e-041784015.7962148667.983385.5749
1840.01040.01049e-048914066.1528742838.8461861.881
1850.0113-0.0032e-04741380.036861781.6697248.5592
1860.01230.00343e-04939460.447978288.3707279.8006
1870.01310.0076e-044105259.5295342104.9608584.8974
1880.01380.00282e-04640079.632853339.9694230.9545
1890.0145-0.00181e-04266256.56622188.0472148.9565
1900.0152-0.00212e-04355103.658229591.9715172.0232
1910.01570.00928e-047245993.4015603832.7835777.0668
1920.01650.05550.0046257699023.306121474918.60884634.1039

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
181 & 0.0068 & 0.0114 & 9e-04 & 10479026.2497 & 873252.1875 & 934.4796 \tabularnewline
182 & 0.0083 & 0.01 & 8e-04 & 8006815.8538 & 667234.6545 & 816.8443 \tabularnewline
183 & 0.0094 & 0.0047 & 4e-04 & 1784015.7962 & 148667.983 & 385.5749 \tabularnewline
184 & 0.0104 & 0.0104 & 9e-04 & 8914066.1528 & 742838.8461 & 861.881 \tabularnewline
185 & 0.0113 & -0.003 & 2e-04 & 741380.0368 & 61781.6697 & 248.5592 \tabularnewline
186 & 0.0123 & 0.0034 & 3e-04 & 939460.4479 & 78288.3707 & 279.8006 \tabularnewline
187 & 0.0131 & 0.007 & 6e-04 & 4105259.5295 & 342104.9608 & 584.8974 \tabularnewline
188 & 0.0138 & 0.0028 & 2e-04 & 640079.6328 & 53339.9694 & 230.9545 \tabularnewline
189 & 0.0145 & -0.0018 & 1e-04 & 266256.566 & 22188.0472 & 148.9565 \tabularnewline
190 & 0.0152 & -0.0021 & 2e-04 & 355103.6582 & 29591.9715 & 172.0232 \tabularnewline
191 & 0.0157 & 0.0092 & 8e-04 & 7245993.4015 & 603832.7835 & 777.0668 \tabularnewline
192 & 0.0165 & 0.0555 & 0.0046 & 257699023.3061 & 21474918.6088 & 4634.1039 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33884&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]181[/C][C]0.0068[/C][C]0.0114[/C][C]9e-04[/C][C]10479026.2497[/C][C]873252.1875[/C][C]934.4796[/C][/ROW]
[ROW][C]182[/C][C]0.0083[/C][C]0.01[/C][C]8e-04[/C][C]8006815.8538[/C][C]667234.6545[/C][C]816.8443[/C][/ROW]
[ROW][C]183[/C][C]0.0094[/C][C]0.0047[/C][C]4e-04[/C][C]1784015.7962[/C][C]148667.983[/C][C]385.5749[/C][/ROW]
[ROW][C]184[/C][C]0.0104[/C][C]0.0104[/C][C]9e-04[/C][C]8914066.1528[/C][C]742838.8461[/C][C]861.881[/C][/ROW]
[ROW][C]185[/C][C]0.0113[/C][C]-0.003[/C][C]2e-04[/C][C]741380.0368[/C][C]61781.6697[/C][C]248.5592[/C][/ROW]
[ROW][C]186[/C][C]0.0123[/C][C]0.0034[/C][C]3e-04[/C][C]939460.4479[/C][C]78288.3707[/C][C]279.8006[/C][/ROW]
[ROW][C]187[/C][C]0.0131[/C][C]0.007[/C][C]6e-04[/C][C]4105259.5295[/C][C]342104.9608[/C][C]584.8974[/C][/ROW]
[ROW][C]188[/C][C]0.0138[/C][C]0.0028[/C][C]2e-04[/C][C]640079.6328[/C][C]53339.9694[/C][C]230.9545[/C][/ROW]
[ROW][C]189[/C][C]0.0145[/C][C]-0.0018[/C][C]1e-04[/C][C]266256.566[/C][C]22188.0472[/C][C]148.9565[/C][/ROW]
[ROW][C]190[/C][C]0.0152[/C][C]-0.0021[/C][C]2e-04[/C][C]355103.6582[/C][C]29591.9715[/C][C]172.0232[/C][/ROW]
[ROW][C]191[/C][C]0.0157[/C][C]0.0092[/C][C]8e-04[/C][C]7245993.4015[/C][C]603832.7835[/C][C]777.0668[/C][/ROW]
[ROW][C]192[/C][C]0.0165[/C][C]0.0555[/C][C]0.0046[/C][C]257699023.3061[/C][C]21474918.6088[/C][C]4634.1039[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33884&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33884&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
1810.00680.01149e-0410479026.2497873252.1875934.4796
1820.00830.018e-048006815.8538667234.6545816.8443
1830.00940.00474e-041784015.7962148667.983385.5749
1840.01040.01049e-048914066.1528742838.8461861.881
1850.0113-0.0032e-04741380.036861781.6697248.5592
1860.01230.00343e-04939460.447978288.3707279.8006
1870.01310.0076e-044105259.5295342104.9608584.8974
1880.01380.00282e-04640079.632853339.9694230.9545
1890.0145-0.00181e-04266256.56622188.0472148.9565
1900.0152-0.00212e-04355103.658229591.9715172.0232
1910.01570.00928e-047245993.4015603832.7835777.0668
1920.01650.05550.0046257699023.306121474918.60884634.1039



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; 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(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,fx))
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')