Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 20 Dec 2007 06:24:42 -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/2007/Dec/20/t11981562247jnl4182xtmq5rg.htm/, Retrieved Mon, 29 Apr 2024 16:08:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4713, Retrieved Mon, 29 Apr 2024 16:08:33 +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)
-     [ARIMA Forecasting] [PAPER, TIM, GIEL,...] [2007-12-13 17:38:59] [beddef6ae4019f3e51da5e10d233ec85]
- R PD    [ARIMA Forecasting] [Paper Tim, Giel, Rik] [2007-12-20 13:24:42] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
513
503
471
471
476
475
470
461
455
456
517
525
523
519
509
512
519
517
510
509
501
507
569
580
578
565
547
555
562
561
555
544
537
543
594
611
613
611
594
595
591
589
584
573
567
569
621
629
628
612
595
597
593
590
580
574
573
573
620
626
620





Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 4 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4713&T=0

[TABLE]
[ROW][C]Summary of compuational 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]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4713&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4713&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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[49])
37613-------
38611-------
39594-------
40595-------
41591-------
42589-------
43584-------
44573-------
45567-------
46569-------
47621-------
48629-------
49628-------
50612621.1833611.6217630.74490.02990.08120.98160.0812
51595602.3636587.7457616.98140.16170.09820.86893e-04
52597605.5166587.3041623.7290.17970.87110.87110.0078
53593609.4586588.6705630.24670.06040.87990.95910.0402
54590607.9307584.9564630.90510.0630.89860.94680.0434
55580602.1423577.1672627.11730.04110.82970.92270.0212
56574594.2402567.3857621.09460.06980.85070.93950.0069
57573587.4383558.8175616.05910.16140.82130.91920.0027
58573591.2607560.9725621.54890.11870.88130.92510.0087
59620647.9759616.0969679.85490.042710.95140.8903
60626659.3907625.9931692.78820.0250.98960.96280.9673
61620658.7511623.9213693.5810.01460.96730.95820.9582

\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[49]) \tabularnewline
37 & 613 & - & - & - & - & - & - & - \tabularnewline
38 & 611 & - & - & - & - & - & - & - \tabularnewline
39 & 594 & - & - & - & - & - & - & - \tabularnewline
40 & 595 & - & - & - & - & - & - & - \tabularnewline
41 & 591 & - & - & - & - & - & - & - \tabularnewline
42 & 589 & - & - & - & - & - & - & - \tabularnewline
43 & 584 & - & - & - & - & - & - & - \tabularnewline
44 & 573 & - & - & - & - & - & - & - \tabularnewline
45 & 567 & - & - & - & - & - & - & - \tabularnewline
46 & 569 & - & - & - & - & - & - & - \tabularnewline
47 & 621 & - & - & - & - & - & - & - \tabularnewline
48 & 629 & - & - & - & - & - & - & - \tabularnewline
49 & 628 & - & - & - & - & - & - & - \tabularnewline
50 & 612 & 621.1833 & 611.6217 & 630.7449 & 0.0299 & 0.0812 & 0.9816 & 0.0812 \tabularnewline
51 & 595 & 602.3636 & 587.7457 & 616.9814 & 0.1617 & 0.0982 & 0.8689 & 3e-04 \tabularnewline
52 & 597 & 605.5166 & 587.3041 & 623.729 & 0.1797 & 0.8711 & 0.8711 & 0.0078 \tabularnewline
53 & 593 & 609.4586 & 588.6705 & 630.2467 & 0.0604 & 0.8799 & 0.9591 & 0.0402 \tabularnewline
54 & 590 & 607.9307 & 584.9564 & 630.9051 & 0.063 & 0.8986 & 0.9468 & 0.0434 \tabularnewline
55 & 580 & 602.1423 & 577.1672 & 627.1173 & 0.0411 & 0.8297 & 0.9227 & 0.0212 \tabularnewline
56 & 574 & 594.2402 & 567.3857 & 621.0946 & 0.0698 & 0.8507 & 0.9395 & 0.0069 \tabularnewline
57 & 573 & 587.4383 & 558.8175 & 616.0591 & 0.1614 & 0.8213 & 0.9192 & 0.0027 \tabularnewline
58 & 573 & 591.2607 & 560.9725 & 621.5489 & 0.1187 & 0.8813 & 0.9251 & 0.0087 \tabularnewline
59 & 620 & 647.9759 & 616.0969 & 679.8549 & 0.0427 & 1 & 0.9514 & 0.8903 \tabularnewline
60 & 626 & 659.3907 & 625.9931 & 692.7882 & 0.025 & 0.9896 & 0.9628 & 0.9673 \tabularnewline
61 & 620 & 658.7511 & 623.9213 & 693.581 & 0.0146 & 0.9673 & 0.9582 & 0.9582 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4713&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[49])[/C][/ROW]
[ROW][C]37[/C][C]613[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]611[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]594[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]595[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]591[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]589[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]584[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]573[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]567[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]569[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]621[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]629[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]628[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]612[/C][C]621.1833[/C][C]611.6217[/C][C]630.7449[/C][C]0.0299[/C][C]0.0812[/C][C]0.9816[/C][C]0.0812[/C][/ROW]
[ROW][C]51[/C][C]595[/C][C]602.3636[/C][C]587.7457[/C][C]616.9814[/C][C]0.1617[/C][C]0.0982[/C][C]0.8689[/C][C]3e-04[/C][/ROW]
[ROW][C]52[/C][C]597[/C][C]605.5166[/C][C]587.3041[/C][C]623.729[/C][C]0.1797[/C][C]0.8711[/C][C]0.8711[/C][C]0.0078[/C][/ROW]
[ROW][C]53[/C][C]593[/C][C]609.4586[/C][C]588.6705[/C][C]630.2467[/C][C]0.0604[/C][C]0.8799[/C][C]0.9591[/C][C]0.0402[/C][/ROW]
[ROW][C]54[/C][C]590[/C][C]607.9307[/C][C]584.9564[/C][C]630.9051[/C][C]0.063[/C][C]0.8986[/C][C]0.9468[/C][C]0.0434[/C][/ROW]
[ROW][C]55[/C][C]580[/C][C]602.1423[/C][C]577.1672[/C][C]627.1173[/C][C]0.0411[/C][C]0.8297[/C][C]0.9227[/C][C]0.0212[/C][/ROW]
[ROW][C]56[/C][C]574[/C][C]594.2402[/C][C]567.3857[/C][C]621.0946[/C][C]0.0698[/C][C]0.8507[/C][C]0.9395[/C][C]0.0069[/C][/ROW]
[ROW][C]57[/C][C]573[/C][C]587.4383[/C][C]558.8175[/C][C]616.0591[/C][C]0.1614[/C][C]0.8213[/C][C]0.9192[/C][C]0.0027[/C][/ROW]
[ROW][C]58[/C][C]573[/C][C]591.2607[/C][C]560.9725[/C][C]621.5489[/C][C]0.1187[/C][C]0.8813[/C][C]0.9251[/C][C]0.0087[/C][/ROW]
[ROW][C]59[/C][C]620[/C][C]647.9759[/C][C]616.0969[/C][C]679.8549[/C][C]0.0427[/C][C]1[/C][C]0.9514[/C][C]0.8903[/C][/ROW]
[ROW][C]60[/C][C]626[/C][C]659.3907[/C][C]625.9931[/C][C]692.7882[/C][C]0.025[/C][C]0.9896[/C][C]0.9628[/C][C]0.9673[/C][/ROW]
[ROW][C]61[/C][C]620[/C][C]658.7511[/C][C]623.9213[/C][C]693.581[/C][C]0.0146[/C][C]0.9673[/C][C]0.9582[/C][C]0.9582[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4713&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4713&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[49])
37613-------
38611-------
39594-------
40595-------
41591-------
42589-------
43584-------
44573-------
45567-------
46569-------
47621-------
48629-------
49628-------
50612621.1833611.6217630.74490.02990.08120.98160.0812
51595602.3636587.7457616.98140.16170.09820.86893e-04
52597605.5166587.3041623.7290.17970.87110.87110.0078
53593609.4586588.6705630.24670.06040.87990.95910.0402
54590607.9307584.9564630.90510.0630.89860.94680.0434
55580602.1423577.1672627.11730.04110.82970.92270.0212
56574594.2402567.3857621.09460.06980.85070.93950.0069
57573587.4383558.8175616.05910.16140.82130.91920.0027
58573591.2607560.9725621.54890.11870.88130.92510.0087
59620647.9759616.0969679.85490.042710.95140.8903
60626659.3907625.9931692.78820.0250.98960.96280.9673
61620658.7511623.9213693.5810.01460.96730.95820.9582







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0079-0.01480.001284.33337.02782.651
510.0124-0.01220.00154.22224.51852.1257
520.0153-0.01410.001272.53226.04432.4585
530.0174-0.0270.0023270.884122.57374.7512
540.0193-0.02950.0025321.511726.79265.1762
550.0212-0.03680.0031490.279840.85676.3919
560.0231-0.03410.0028409.664334.13875.8428
570.0249-0.02460.002208.464717.37214.168
580.0261-0.03090.0026333.453927.78785.2714
590.0251-0.04320.0036782.65165.22098.0759
600.0258-0.05060.00421114.938792.91169.6391
610.027-0.05880.00491501.6511125.137611.1865

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0079 & -0.0148 & 0.0012 & 84.3333 & 7.0278 & 2.651 \tabularnewline
51 & 0.0124 & -0.0122 & 0.001 & 54.2222 & 4.5185 & 2.1257 \tabularnewline
52 & 0.0153 & -0.0141 & 0.0012 & 72.5322 & 6.0443 & 2.4585 \tabularnewline
53 & 0.0174 & -0.027 & 0.0023 & 270.8841 & 22.5737 & 4.7512 \tabularnewline
54 & 0.0193 & -0.0295 & 0.0025 & 321.5117 & 26.7926 & 5.1762 \tabularnewline
55 & 0.0212 & -0.0368 & 0.0031 & 490.2798 & 40.8567 & 6.3919 \tabularnewline
56 & 0.0231 & -0.0341 & 0.0028 & 409.6643 & 34.1387 & 5.8428 \tabularnewline
57 & 0.0249 & -0.0246 & 0.002 & 208.4647 & 17.3721 & 4.168 \tabularnewline
58 & 0.0261 & -0.0309 & 0.0026 & 333.4539 & 27.7878 & 5.2714 \tabularnewline
59 & 0.0251 & -0.0432 & 0.0036 & 782.651 & 65.2209 & 8.0759 \tabularnewline
60 & 0.0258 & -0.0506 & 0.0042 & 1114.9387 & 92.9116 & 9.6391 \tabularnewline
61 & 0.027 & -0.0588 & 0.0049 & 1501.6511 & 125.1376 & 11.1865 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4713&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]50[/C][C]0.0079[/C][C]-0.0148[/C][C]0.0012[/C][C]84.3333[/C][C]7.0278[/C][C]2.651[/C][/ROW]
[ROW][C]51[/C][C]0.0124[/C][C]-0.0122[/C][C]0.001[/C][C]54.2222[/C][C]4.5185[/C][C]2.1257[/C][/ROW]
[ROW][C]52[/C][C]0.0153[/C][C]-0.0141[/C][C]0.0012[/C][C]72.5322[/C][C]6.0443[/C][C]2.4585[/C][/ROW]
[ROW][C]53[/C][C]0.0174[/C][C]-0.027[/C][C]0.0023[/C][C]270.8841[/C][C]22.5737[/C][C]4.7512[/C][/ROW]
[ROW][C]54[/C][C]0.0193[/C][C]-0.0295[/C][C]0.0025[/C][C]321.5117[/C][C]26.7926[/C][C]5.1762[/C][/ROW]
[ROW][C]55[/C][C]0.0212[/C][C]-0.0368[/C][C]0.0031[/C][C]490.2798[/C][C]40.8567[/C][C]6.3919[/C][/ROW]
[ROW][C]56[/C][C]0.0231[/C][C]-0.0341[/C][C]0.0028[/C][C]409.6643[/C][C]34.1387[/C][C]5.8428[/C][/ROW]
[ROW][C]57[/C][C]0.0249[/C][C]-0.0246[/C][C]0.002[/C][C]208.4647[/C][C]17.3721[/C][C]4.168[/C][/ROW]
[ROW][C]58[/C][C]0.0261[/C][C]-0.0309[/C][C]0.0026[/C][C]333.4539[/C][C]27.7878[/C][C]5.2714[/C][/ROW]
[ROW][C]59[/C][C]0.0251[/C][C]-0.0432[/C][C]0.0036[/C][C]782.651[/C][C]65.2209[/C][C]8.0759[/C][/ROW]
[ROW][C]60[/C][C]0.0258[/C][C]-0.0506[/C][C]0.0042[/C][C]1114.9387[/C][C]92.9116[/C][C]9.6391[/C][/ROW]
[ROW][C]61[/C][C]0.027[/C][C]-0.0588[/C][C]0.0049[/C][C]1501.6511[/C][C]125.1376[/C][C]11.1865[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4713&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4713&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
500.0079-0.01480.001284.33337.02782.651
510.0124-0.01220.00154.22224.51852.1257
520.0153-0.01410.001272.53226.04432.4585
530.0174-0.0270.0023270.884122.57374.7512
540.0193-0.02950.0025321.511726.79265.1762
550.0212-0.03680.0031490.279840.85676.3919
560.0231-0.03410.0028409.664334.13875.8428
570.0249-0.02460.002208.464717.37214.168
580.0261-0.03090.0026333.453927.78785.2714
590.0251-0.04320.0036782.65165.22098.0759
600.0258-0.05060.00421114.938792.91169.6391
610.027-0.05880.00491501.6511125.137611.1865



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