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, 20 Dec 2009 12:49:26 -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/20/t1261338645oj373kol6t6vlez.htm/, Retrieved Sat, 27 Apr 2024 07:31:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70005, Retrieved Sat, 27 Apr 2024 07:31:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact114
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
-   PD  [ARIMA Forecasting] [ARIMA forecasting] [2009-12-11 16:37:21] [9c2d53170eb755e9ae5fcf19d2174a32]
- R P       [ARIMA Forecasting] [Forecasting] [2009-12-20 19:49:26] [82f29a5d509ab8039aab37a0145f886d] [Current]
Feedback Forum

Post a new message
Dataseries X:
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
588
566
557
561
549
532
526
511
499
555
565
542
527
510
514
517
508
493
490
469
478
528
534
518
506
502
516
528




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=70005&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=70005&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70005&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[49])
37561-------
38549-------
39532-------
40526-------
41511-------
42499-------
43555-------
44565-------
45542-------
46527-------
47510-------
48514-------
49517-------
50508509.3232494.5188524.12760.43050.154700.1547
51493495.2118474.7601515.66340.41610.11022e-040.0184
52490490.0743463.703516.44550.49780.41390.00380.0227
53469474.9787442.0559507.90150.36090.18560.0160.0062
54478462.4242423.075501.77340.21890.37160.03420.0033
55528517.9929472.7716563.21410.33220.95850.05440.5172
56534527.7342477.3538578.11470.40370.49590.07360.6619
57518504.6811449.7485559.61370.31730.14780.09150.3301
58506489.7091430.6884548.72990.29430.17370.10780.1824
59502472.7713409.9839535.55870.18080.14980.12260.0837
60516476.8129410.4893543.13640.12340.22830.13590.1175
61528479.8351410.1482549.52210.08780.15450.14790.1479

\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 & 561 & - & - & - & - & - & - & - \tabularnewline
38 & 549 & - & - & - & - & - & - & - \tabularnewline
39 & 532 & - & - & - & - & - & - & - \tabularnewline
40 & 526 & - & - & - & - & - & - & - \tabularnewline
41 & 511 & - & - & - & - & - & - & - \tabularnewline
42 & 499 & - & - & - & - & - & - & - \tabularnewline
43 & 555 & - & - & - & - & - & - & - \tabularnewline
44 & 565 & - & - & - & - & - & - & - \tabularnewline
45 & 542 & - & - & - & - & - & - & - \tabularnewline
46 & 527 & - & - & - & - & - & - & - \tabularnewline
47 & 510 & - & - & - & - & - & - & - \tabularnewline
48 & 514 & - & - & - & - & - & - & - \tabularnewline
49 & 517 & - & - & - & - & - & - & - \tabularnewline
50 & 508 & 509.3232 & 494.5188 & 524.1276 & 0.4305 & 0.1547 & 0 & 0.1547 \tabularnewline
51 & 493 & 495.2118 & 474.7601 & 515.6634 & 0.4161 & 0.1102 & 2e-04 & 0.0184 \tabularnewline
52 & 490 & 490.0743 & 463.703 & 516.4455 & 0.4978 & 0.4139 & 0.0038 & 0.0227 \tabularnewline
53 & 469 & 474.9787 & 442.0559 & 507.9015 & 0.3609 & 0.1856 & 0.016 & 0.0062 \tabularnewline
54 & 478 & 462.4242 & 423.075 & 501.7734 & 0.2189 & 0.3716 & 0.0342 & 0.0033 \tabularnewline
55 & 528 & 517.9929 & 472.7716 & 563.2141 & 0.3322 & 0.9585 & 0.0544 & 0.5172 \tabularnewline
56 & 534 & 527.7342 & 477.3538 & 578.1147 & 0.4037 & 0.4959 & 0.0736 & 0.6619 \tabularnewline
57 & 518 & 504.6811 & 449.7485 & 559.6137 & 0.3173 & 0.1478 & 0.0915 & 0.3301 \tabularnewline
58 & 506 & 489.7091 & 430.6884 & 548.7299 & 0.2943 & 0.1737 & 0.1078 & 0.1824 \tabularnewline
59 & 502 & 472.7713 & 409.9839 & 535.5587 & 0.1808 & 0.1498 & 0.1226 & 0.0837 \tabularnewline
60 & 516 & 476.8129 & 410.4893 & 543.1364 & 0.1234 & 0.2283 & 0.1359 & 0.1175 \tabularnewline
61 & 528 & 479.8351 & 410.1482 & 549.5221 & 0.0878 & 0.1545 & 0.1479 & 0.1479 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70005&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]561[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]549[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]532[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]526[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]511[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]499[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]555[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]565[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]542[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]527[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]510[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]514[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]517[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]508[/C][C]509.3232[/C][C]494.5188[/C][C]524.1276[/C][C]0.4305[/C][C]0.1547[/C][C]0[/C][C]0.1547[/C][/ROW]
[ROW][C]51[/C][C]493[/C][C]495.2118[/C][C]474.7601[/C][C]515.6634[/C][C]0.4161[/C][C]0.1102[/C][C]2e-04[/C][C]0.0184[/C][/ROW]
[ROW][C]52[/C][C]490[/C][C]490.0743[/C][C]463.703[/C][C]516.4455[/C][C]0.4978[/C][C]0.4139[/C][C]0.0038[/C][C]0.0227[/C][/ROW]
[ROW][C]53[/C][C]469[/C][C]474.9787[/C][C]442.0559[/C][C]507.9015[/C][C]0.3609[/C][C]0.1856[/C][C]0.016[/C][C]0.0062[/C][/ROW]
[ROW][C]54[/C][C]478[/C][C]462.4242[/C][C]423.075[/C][C]501.7734[/C][C]0.2189[/C][C]0.3716[/C][C]0.0342[/C][C]0.0033[/C][/ROW]
[ROW][C]55[/C][C]528[/C][C]517.9929[/C][C]472.7716[/C][C]563.2141[/C][C]0.3322[/C][C]0.9585[/C][C]0.0544[/C][C]0.5172[/C][/ROW]
[ROW][C]56[/C][C]534[/C][C]527.7342[/C][C]477.3538[/C][C]578.1147[/C][C]0.4037[/C][C]0.4959[/C][C]0.0736[/C][C]0.6619[/C][/ROW]
[ROW][C]57[/C][C]518[/C][C]504.6811[/C][C]449.7485[/C][C]559.6137[/C][C]0.3173[/C][C]0.1478[/C][C]0.0915[/C][C]0.3301[/C][/ROW]
[ROW][C]58[/C][C]506[/C][C]489.7091[/C][C]430.6884[/C][C]548.7299[/C][C]0.2943[/C][C]0.1737[/C][C]0.1078[/C][C]0.1824[/C][/ROW]
[ROW][C]59[/C][C]502[/C][C]472.7713[/C][C]409.9839[/C][C]535.5587[/C][C]0.1808[/C][C]0.1498[/C][C]0.1226[/C][C]0.0837[/C][/ROW]
[ROW][C]60[/C][C]516[/C][C]476.8129[/C][C]410.4893[/C][C]543.1364[/C][C]0.1234[/C][C]0.2283[/C][C]0.1359[/C][C]0.1175[/C][/ROW]
[ROW][C]61[/C][C]528[/C][C]479.8351[/C][C]410.1482[/C][C]549.5221[/C][C]0.0878[/C][C]0.1545[/C][C]0.1479[/C][C]0.1479[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70005&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70005&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])
37561-------
38549-------
39532-------
40526-------
41511-------
42499-------
43555-------
44565-------
45542-------
46527-------
47510-------
48514-------
49517-------
50508509.3232494.5188524.12760.43050.154700.1547
51493495.2118474.7601515.66340.41610.11022e-040.0184
52490490.0743463.703516.44550.49780.41390.00380.0227
53469474.9787442.0559507.90150.36090.18560.0160.0062
54478462.4242423.075501.77340.21890.37160.03420.0033
55528517.9929472.7716563.21410.33220.95850.05440.5172
56534527.7342477.3538578.11470.40370.49590.07360.6619
57518504.6811449.7485559.61370.31730.14780.09150.3301
58506489.7091430.6884548.72990.29430.17370.10780.1824
59502472.7713409.9839535.55870.18080.14980.12260.0837
60516476.8129410.4893543.13640.12340.22830.13590.1175
61528479.8351410.1482549.52210.08780.15450.14790.1479







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0148-0.002601.750900
510.0211-0.00450.00354.89193.32141.8225
520.0275-2e-040.00240.00552.21611.4887
530.0354-0.01260.00535.744610.59823.2555
540.04340.03370.0107242.604856.99957.5498
550.04450.01930.0121100.142864.19018.0119
560.04870.01190.012139.259860.62867.7864
570.05550.02640.0139177.392775.22418.6732
580.06150.03330.016265.392496.35399.816
590.06780.06180.0206854.316172.150113.1206
600.0710.08220.02621535.6319296.10317.2076
610.07410.10040.03242319.8531464.748921.558

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0148 & -0.0026 & 0 & 1.7509 & 0 & 0 \tabularnewline
51 & 0.0211 & -0.0045 & 0.0035 & 4.8919 & 3.3214 & 1.8225 \tabularnewline
52 & 0.0275 & -2e-04 & 0.0024 & 0.0055 & 2.2161 & 1.4887 \tabularnewline
53 & 0.0354 & -0.0126 & 0.005 & 35.7446 & 10.5982 & 3.2555 \tabularnewline
54 & 0.0434 & 0.0337 & 0.0107 & 242.6048 & 56.9995 & 7.5498 \tabularnewline
55 & 0.0445 & 0.0193 & 0.0121 & 100.1428 & 64.1901 & 8.0119 \tabularnewline
56 & 0.0487 & 0.0119 & 0.0121 & 39.2598 & 60.6286 & 7.7864 \tabularnewline
57 & 0.0555 & 0.0264 & 0.0139 & 177.3927 & 75.2241 & 8.6732 \tabularnewline
58 & 0.0615 & 0.0333 & 0.016 & 265.3924 & 96.3539 & 9.816 \tabularnewline
59 & 0.0678 & 0.0618 & 0.0206 & 854.316 & 172.1501 & 13.1206 \tabularnewline
60 & 0.071 & 0.0822 & 0.0262 & 1535.6319 & 296.103 & 17.2076 \tabularnewline
61 & 0.0741 & 0.1004 & 0.0324 & 2319.8531 & 464.7489 & 21.558 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70005&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.0148[/C][C]-0.0026[/C][C]0[/C][C]1.7509[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0211[/C][C]-0.0045[/C][C]0.0035[/C][C]4.8919[/C][C]3.3214[/C][C]1.8225[/C][/ROW]
[ROW][C]52[/C][C]0.0275[/C][C]-2e-04[/C][C]0.0024[/C][C]0.0055[/C][C]2.2161[/C][C]1.4887[/C][/ROW]
[ROW][C]53[/C][C]0.0354[/C][C]-0.0126[/C][C]0.005[/C][C]35.7446[/C][C]10.5982[/C][C]3.2555[/C][/ROW]
[ROW][C]54[/C][C]0.0434[/C][C]0.0337[/C][C]0.0107[/C][C]242.6048[/C][C]56.9995[/C][C]7.5498[/C][/ROW]
[ROW][C]55[/C][C]0.0445[/C][C]0.0193[/C][C]0.0121[/C][C]100.1428[/C][C]64.1901[/C][C]8.0119[/C][/ROW]
[ROW][C]56[/C][C]0.0487[/C][C]0.0119[/C][C]0.0121[/C][C]39.2598[/C][C]60.6286[/C][C]7.7864[/C][/ROW]
[ROW][C]57[/C][C]0.0555[/C][C]0.0264[/C][C]0.0139[/C][C]177.3927[/C][C]75.2241[/C][C]8.6732[/C][/ROW]
[ROW][C]58[/C][C]0.0615[/C][C]0.0333[/C][C]0.016[/C][C]265.3924[/C][C]96.3539[/C][C]9.816[/C][/ROW]
[ROW][C]59[/C][C]0.0678[/C][C]0.0618[/C][C]0.0206[/C][C]854.316[/C][C]172.1501[/C][C]13.1206[/C][/ROW]
[ROW][C]60[/C][C]0.071[/C][C]0.0822[/C][C]0.0262[/C][C]1535.6319[/C][C]296.103[/C][C]17.2076[/C][/ROW]
[ROW][C]61[/C][C]0.0741[/C][C]0.1004[/C][C]0.0324[/C][C]2319.8531[/C][C]464.7489[/C][C]21.558[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70005&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70005&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.0148-0.002601.750900
510.0211-0.00450.00354.89193.32141.8225
520.0275-2e-040.00240.00552.21611.4887
530.0354-0.01260.00535.744610.59823.2555
540.04340.03370.0107242.604856.99957.5498
550.04450.01930.0121100.142864.19018.0119
560.04870.01190.012139.259860.62867.7864
570.05550.02640.0139177.392775.22418.6732
580.06150.03330.016265.392496.35399.816
590.06780.06180.0206854.316172.150113.1206
600.0710.08220.02621535.6319296.10317.2076
610.07410.10040.03242319.8531464.748921.558



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