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 computationSun, 26 Dec 2010 15:20:37 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/26/t1293376696z6q3yrxy18xs0uh.htm/, Retrieved Mon, 06 May 2024 21:30:29 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=115658, Retrieved Mon, 06 May 2024 21:30:29 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact133
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [tijdreeks bevolki...] [2010-12-26 10:20:42] [efd13e24149aec704f3383e33c1e842a]
-   PD  [Univariate Data Series] [tijdreeks werkloo...] [2010-12-26 13:12:25] [efd13e24149aec704f3383e33c1e842a]
- RMPD      [ARIMA Forecasting] [tijdreeks werkloo...] [2010-12-26 15:20:37] [531024149246456e4f6d79ace2e85c12] [Current]
Feedback Forum

Post a new message
Dataseries X:
332
369
384
373
378
426
423
397
422
409
430
412
470
491
504
484
474
508
492
452
457
457
471
451
493
514
522
490
484
506
501
462
465
454
464
427
460
473
465
422
415
413
420
363
376
380
384
346
389
407
393
346
348
353
364
305
307
312
312
286
324
336
327
302
299
311
315
264
278
278
287
279
324
354
354
360
363
385
412
370
389
395
417
404
456
478
468
437
432
441
449
386
396
394




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115658&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]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115658&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115658&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'RServer@AstonUniversity' @ vre.aston.ac.uk







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[82])
70278-------
71287-------
72279-------
73324-------
74354-------
75354-------
76360-------
77363-------
78385-------
79412-------
80370-------
81389-------
82395-------
83417412.8346394.1608431.50830.3310.969410.9694
84404410.394384.4896436.29830.31430.308610.8779
85456462.7163427.7465497.68620.35330.999510.9999
86478498.2316454.2175542.24570.18380.9711
87468504.4507450.8853558.0160.09110.833411
88437513.436450.02576.8520.00910.919910.9999
89432522.5459448.9714596.12050.00790.988710.9997
90441549.7307465.7445633.71690.00560.9970.99990.9998
91449580.2834485.663674.90390.00330.9980.99980.9999
92386543.0798437.6355648.52420.00180.95980.99940.997
93396567.0726450.6425683.50270.0020.99880.99860.9981
94394577.9413450.3889705.49380.00240.99740.99750.9975

\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[82]) \tabularnewline
70 & 278 & - & - & - & - & - & - & - \tabularnewline
71 & 287 & - & - & - & - & - & - & - \tabularnewline
72 & 279 & - & - & - & - & - & - & - \tabularnewline
73 & 324 & - & - & - & - & - & - & - \tabularnewline
74 & 354 & - & - & - & - & - & - & - \tabularnewline
75 & 354 & - & - & - & - & - & - & - \tabularnewline
76 & 360 & - & - & - & - & - & - & - \tabularnewline
77 & 363 & - & - & - & - & - & - & - \tabularnewline
78 & 385 & - & - & - & - & - & - & - \tabularnewline
79 & 412 & - & - & - & - & - & - & - \tabularnewline
80 & 370 & - & - & - & - & - & - & - \tabularnewline
81 & 389 & - & - & - & - & - & - & - \tabularnewline
82 & 395 & - & - & - & - & - & - & - \tabularnewline
83 & 417 & 412.8346 & 394.1608 & 431.5083 & 0.331 & 0.9694 & 1 & 0.9694 \tabularnewline
84 & 404 & 410.394 & 384.4896 & 436.2983 & 0.3143 & 0.3086 & 1 & 0.8779 \tabularnewline
85 & 456 & 462.7163 & 427.7465 & 497.6862 & 0.3533 & 0.9995 & 1 & 0.9999 \tabularnewline
86 & 478 & 498.2316 & 454.2175 & 542.2457 & 0.1838 & 0.97 & 1 & 1 \tabularnewline
87 & 468 & 504.4507 & 450.8853 & 558.016 & 0.0911 & 0.8334 & 1 & 1 \tabularnewline
88 & 437 & 513.436 & 450.02 & 576.852 & 0.0091 & 0.9199 & 1 & 0.9999 \tabularnewline
89 & 432 & 522.5459 & 448.9714 & 596.1205 & 0.0079 & 0.9887 & 1 & 0.9997 \tabularnewline
90 & 441 & 549.7307 & 465.7445 & 633.7169 & 0.0056 & 0.997 & 0.9999 & 0.9998 \tabularnewline
91 & 449 & 580.2834 & 485.663 & 674.9039 & 0.0033 & 0.998 & 0.9998 & 0.9999 \tabularnewline
92 & 386 & 543.0798 & 437.6355 & 648.5242 & 0.0018 & 0.9598 & 0.9994 & 0.997 \tabularnewline
93 & 396 & 567.0726 & 450.6425 & 683.5027 & 0.002 & 0.9988 & 0.9986 & 0.9981 \tabularnewline
94 & 394 & 577.9413 & 450.3889 & 705.4938 & 0.0024 & 0.9974 & 0.9975 & 0.9975 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115658&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[82])[/C][/ROW]
[ROW][C]70[/C][C]278[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]287[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]279[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]324[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]354[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]354[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]360[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]363[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]385[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]412[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]370[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]389[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]395[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]417[/C][C]412.8346[/C][C]394.1608[/C][C]431.5083[/C][C]0.331[/C][C]0.9694[/C][C]1[/C][C]0.9694[/C][/ROW]
[ROW][C]84[/C][C]404[/C][C]410.394[/C][C]384.4896[/C][C]436.2983[/C][C]0.3143[/C][C]0.3086[/C][C]1[/C][C]0.8779[/C][/ROW]
[ROW][C]85[/C][C]456[/C][C]462.7163[/C][C]427.7465[/C][C]497.6862[/C][C]0.3533[/C][C]0.9995[/C][C]1[/C][C]0.9999[/C][/ROW]
[ROW][C]86[/C][C]478[/C][C]498.2316[/C][C]454.2175[/C][C]542.2457[/C][C]0.1838[/C][C]0.97[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]87[/C][C]468[/C][C]504.4507[/C][C]450.8853[/C][C]558.016[/C][C]0.0911[/C][C]0.8334[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]88[/C][C]437[/C][C]513.436[/C][C]450.02[/C][C]576.852[/C][C]0.0091[/C][C]0.9199[/C][C]1[/C][C]0.9999[/C][/ROW]
[ROW][C]89[/C][C]432[/C][C]522.5459[/C][C]448.9714[/C][C]596.1205[/C][C]0.0079[/C][C]0.9887[/C][C]1[/C][C]0.9997[/C][/ROW]
[ROW][C]90[/C][C]441[/C][C]549.7307[/C][C]465.7445[/C][C]633.7169[/C][C]0.0056[/C][C]0.997[/C][C]0.9999[/C][C]0.9998[/C][/ROW]
[ROW][C]91[/C][C]449[/C][C]580.2834[/C][C]485.663[/C][C]674.9039[/C][C]0.0033[/C][C]0.998[/C][C]0.9998[/C][C]0.9999[/C][/ROW]
[ROW][C]92[/C][C]386[/C][C]543.0798[/C][C]437.6355[/C][C]648.5242[/C][C]0.0018[/C][C]0.9598[/C][C]0.9994[/C][C]0.997[/C][/ROW]
[ROW][C]93[/C][C]396[/C][C]567.0726[/C][C]450.6425[/C][C]683.5027[/C][C]0.002[/C][C]0.9988[/C][C]0.9986[/C][C]0.9981[/C][/ROW]
[ROW][C]94[/C][C]394[/C][C]577.9413[/C][C]450.3889[/C][C]705.4938[/C][C]0.0024[/C][C]0.9974[/C][C]0.9975[/C][C]0.9975[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115658&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115658&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[82])
70278-------
71287-------
72279-------
73324-------
74354-------
75354-------
76360-------
77363-------
78385-------
79412-------
80370-------
81389-------
82395-------
83417412.8346394.1608431.50830.3310.969410.9694
84404410.394384.4896436.29830.31430.308610.8779
85456462.7163427.7465497.68620.35330.999510.9999
86478498.2316454.2175542.24570.18380.9711
87468504.4507450.8853558.0160.09110.833411
88437513.436450.02576.8520.00910.919910.9999
89432522.5459448.9714596.12050.00790.988710.9997
90441549.7307465.7445633.71690.00560.9970.99990.9998
91449580.2834485.663674.90390.00330.9980.99980.9999
92386543.0798437.6355648.52420.00180.95980.99940.997
93396567.0726450.6425683.50270.0020.99880.99860.9981
94394577.9413450.3889705.49380.00240.99740.99750.9975







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
830.02310.0101017.35100
840.0322-0.01560.012840.882729.11685.396
850.0386-0.01450.013445.109334.44775.8692
860.0451-0.04060.0202409.3181128.165311.321
870.0542-0.07230.03061328.6509368.262419.1902
880.063-0.14890.05035842.46781280.629935.7859
890.0718-0.17330.06798198.56352268.906247.633
900.0779-0.19780.084111822.36713463.088858.848
910.0832-0.22620.099917235.34144993.339170.6636
920.0991-0.28920.118824674.06576961.411783.4351
930.1048-0.30170.135529265.82618989.085894.8108
940.1126-0.31830.150733834.410811059.5295105.1643

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
83 & 0.0231 & 0.0101 & 0 & 17.351 & 0 & 0 \tabularnewline
84 & 0.0322 & -0.0156 & 0.0128 & 40.8827 & 29.1168 & 5.396 \tabularnewline
85 & 0.0386 & -0.0145 & 0.0134 & 45.1093 & 34.4477 & 5.8692 \tabularnewline
86 & 0.0451 & -0.0406 & 0.0202 & 409.3181 & 128.1653 & 11.321 \tabularnewline
87 & 0.0542 & -0.0723 & 0.0306 & 1328.6509 & 368.2624 & 19.1902 \tabularnewline
88 & 0.063 & -0.1489 & 0.0503 & 5842.4678 & 1280.6299 & 35.7859 \tabularnewline
89 & 0.0718 & -0.1733 & 0.0679 & 8198.5635 & 2268.9062 & 47.633 \tabularnewline
90 & 0.0779 & -0.1978 & 0.0841 & 11822.3671 & 3463.0888 & 58.848 \tabularnewline
91 & 0.0832 & -0.2262 & 0.0999 & 17235.3414 & 4993.3391 & 70.6636 \tabularnewline
92 & 0.0991 & -0.2892 & 0.1188 & 24674.0657 & 6961.4117 & 83.4351 \tabularnewline
93 & 0.1048 & -0.3017 & 0.1355 & 29265.8261 & 8989.0858 & 94.8108 \tabularnewline
94 & 0.1126 & -0.3183 & 0.1507 & 33834.4108 & 11059.5295 & 105.1643 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115658&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]83[/C][C]0.0231[/C][C]0.0101[/C][C]0[/C][C]17.351[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]84[/C][C]0.0322[/C][C]-0.0156[/C][C]0.0128[/C][C]40.8827[/C][C]29.1168[/C][C]5.396[/C][/ROW]
[ROW][C]85[/C][C]0.0386[/C][C]-0.0145[/C][C]0.0134[/C][C]45.1093[/C][C]34.4477[/C][C]5.8692[/C][/ROW]
[ROW][C]86[/C][C]0.0451[/C][C]-0.0406[/C][C]0.0202[/C][C]409.3181[/C][C]128.1653[/C][C]11.321[/C][/ROW]
[ROW][C]87[/C][C]0.0542[/C][C]-0.0723[/C][C]0.0306[/C][C]1328.6509[/C][C]368.2624[/C][C]19.1902[/C][/ROW]
[ROW][C]88[/C][C]0.063[/C][C]-0.1489[/C][C]0.0503[/C][C]5842.4678[/C][C]1280.6299[/C][C]35.7859[/C][/ROW]
[ROW][C]89[/C][C]0.0718[/C][C]-0.1733[/C][C]0.0679[/C][C]8198.5635[/C][C]2268.9062[/C][C]47.633[/C][/ROW]
[ROW][C]90[/C][C]0.0779[/C][C]-0.1978[/C][C]0.0841[/C][C]11822.3671[/C][C]3463.0888[/C][C]58.848[/C][/ROW]
[ROW][C]91[/C][C]0.0832[/C][C]-0.2262[/C][C]0.0999[/C][C]17235.3414[/C][C]4993.3391[/C][C]70.6636[/C][/ROW]
[ROW][C]92[/C][C]0.0991[/C][C]-0.2892[/C][C]0.1188[/C][C]24674.0657[/C][C]6961.4117[/C][C]83.4351[/C][/ROW]
[ROW][C]93[/C][C]0.1048[/C][C]-0.3017[/C][C]0.1355[/C][C]29265.8261[/C][C]8989.0858[/C][C]94.8108[/C][/ROW]
[ROW][C]94[/C][C]0.1126[/C][C]-0.3183[/C][C]0.1507[/C][C]33834.4108[/C][C]11059.5295[/C][C]105.1643[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115658&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115658&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
830.02310.0101017.35100
840.0322-0.01560.012840.882729.11685.396
850.0386-0.01450.013445.109334.44775.8692
860.0451-0.04060.0202409.3181128.165311.321
870.0542-0.07230.03061328.6509368.262419.1902
880.063-0.14890.05035842.46781280.629935.7859
890.0718-0.17330.06798198.56352268.906247.633
900.0779-0.19780.084111822.36713463.088858.848
910.0832-0.22620.099917235.34144993.339170.6636
920.0991-0.28920.118824674.06576961.411783.4351
930.1048-0.30170.135529265.82618989.085894.8108
940.1126-0.31830.150733834.410811059.5295105.1643



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