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, 21 Dec 2009 07:44:24 -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/21/t1261406739oahok2b566gde1n.htm/, Retrieved Sun, 05 May 2024 13:36:09 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70211, Retrieved Sun, 05 May 2024 13:36:09 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact159
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] [] [2009-12-21 13:53:33] [fef2f8976fa1eef1b54e2cee317fe737]
-   P     [ARIMA Forecasting] [] [2009-12-21 14:04:55] [fef2f8976fa1eef1b54e2cee317fe737]
- R           [ARIMA Forecasting] [] [2009-12-21 14:44:24] [2ffc7e281e02b99889abd2ccc65ed6c3] [Current]
Feedback Forum

Post a new message
Dataseries X:
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
533
536
537
524
536
587
597
581




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70211&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[48])
36542-------
37527-------
38510-------
39514-------
40517-------
41508-------
42493-------
43490-------
44469-------
45478-------
46528-------
47534-------
48518-------
49506505.6403491.3193519.96130.48040.04540.00170.0454
50502486.213466.9903505.43570.05370.02180.00766e-04
51516490.1732465.0066515.33980.02210.17850.03180.0151
52528496.5978464.2873528.90830.02840.11960.10790.0971
53533487.8676450.2809525.45430.00930.01820.14690.0581
54536470.6959428.9071512.48460.00110.00170.14780.0133
55537468.6603421.7907515.52980.00210.00240.18610.0195
56524449.8415397.7304501.95260.00265e-040.23560.0052
57536457.9187401.7296514.10790.00320.01060.24180.0181
58587506.6052446.6098566.60060.00430.16850.24230.3548
59597513.9921449.6357578.34850.00570.01310.27110.4514
60581499.0125430.5582567.46680.00950.00250.29330.2933

\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[48]) \tabularnewline
36 & 542 & - & - & - & - & - & - & - \tabularnewline
37 & 527 & - & - & - & - & - & - & - \tabularnewline
38 & 510 & - & - & - & - & - & - & - \tabularnewline
39 & 514 & - & - & - & - & - & - & - \tabularnewline
40 & 517 & - & - & - & - & - & - & - \tabularnewline
41 & 508 & - & - & - & - & - & - & - \tabularnewline
42 & 493 & - & - & - & - & - & - & - \tabularnewline
43 & 490 & - & - & - & - & - & - & - \tabularnewline
44 & 469 & - & - & - & - & - & - & - \tabularnewline
45 & 478 & - & - & - & - & - & - & - \tabularnewline
46 & 528 & - & - & - & - & - & - & - \tabularnewline
47 & 534 & - & - & - & - & - & - & - \tabularnewline
48 & 518 & - & - & - & - & - & - & - \tabularnewline
49 & 506 & 505.6403 & 491.3193 & 519.9613 & 0.4804 & 0.0454 & 0.0017 & 0.0454 \tabularnewline
50 & 502 & 486.213 & 466.9903 & 505.4357 & 0.0537 & 0.0218 & 0.0076 & 6e-04 \tabularnewline
51 & 516 & 490.1732 & 465.0066 & 515.3398 & 0.0221 & 0.1785 & 0.0318 & 0.0151 \tabularnewline
52 & 528 & 496.5978 & 464.2873 & 528.9083 & 0.0284 & 0.1196 & 0.1079 & 0.0971 \tabularnewline
53 & 533 & 487.8676 & 450.2809 & 525.4543 & 0.0093 & 0.0182 & 0.1469 & 0.0581 \tabularnewline
54 & 536 & 470.6959 & 428.9071 & 512.4846 & 0.0011 & 0.0017 & 0.1478 & 0.0133 \tabularnewline
55 & 537 & 468.6603 & 421.7907 & 515.5298 & 0.0021 & 0.0024 & 0.1861 & 0.0195 \tabularnewline
56 & 524 & 449.8415 & 397.7304 & 501.9526 & 0.0026 & 5e-04 & 0.2356 & 0.0052 \tabularnewline
57 & 536 & 457.9187 & 401.7296 & 514.1079 & 0.0032 & 0.0106 & 0.2418 & 0.0181 \tabularnewline
58 & 587 & 506.6052 & 446.6098 & 566.6006 & 0.0043 & 0.1685 & 0.2423 & 0.3548 \tabularnewline
59 & 597 & 513.9921 & 449.6357 & 578.3485 & 0.0057 & 0.0131 & 0.2711 & 0.4514 \tabularnewline
60 & 581 & 499.0125 & 430.5582 & 567.4668 & 0.0095 & 0.0025 & 0.2933 & 0.2933 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70211&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[48])[/C][/ROW]
[ROW][C]36[/C][C]542[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]527[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]510[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]514[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]517[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]508[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]493[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]490[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]469[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]478[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]528[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]534[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]518[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]506[/C][C]505.6403[/C][C]491.3193[/C][C]519.9613[/C][C]0.4804[/C][C]0.0454[/C][C]0.0017[/C][C]0.0454[/C][/ROW]
[ROW][C]50[/C][C]502[/C][C]486.213[/C][C]466.9903[/C][C]505.4357[/C][C]0.0537[/C][C]0.0218[/C][C]0.0076[/C][C]6e-04[/C][/ROW]
[ROW][C]51[/C][C]516[/C][C]490.1732[/C][C]465.0066[/C][C]515.3398[/C][C]0.0221[/C][C]0.1785[/C][C]0.0318[/C][C]0.0151[/C][/ROW]
[ROW][C]52[/C][C]528[/C][C]496.5978[/C][C]464.2873[/C][C]528.9083[/C][C]0.0284[/C][C]0.1196[/C][C]0.1079[/C][C]0.0971[/C][/ROW]
[ROW][C]53[/C][C]533[/C][C]487.8676[/C][C]450.2809[/C][C]525.4543[/C][C]0.0093[/C][C]0.0182[/C][C]0.1469[/C][C]0.0581[/C][/ROW]
[ROW][C]54[/C][C]536[/C][C]470.6959[/C][C]428.9071[/C][C]512.4846[/C][C]0.0011[/C][C]0.0017[/C][C]0.1478[/C][C]0.0133[/C][/ROW]
[ROW][C]55[/C][C]537[/C][C]468.6603[/C][C]421.7907[/C][C]515.5298[/C][C]0.0021[/C][C]0.0024[/C][C]0.1861[/C][C]0.0195[/C][/ROW]
[ROW][C]56[/C][C]524[/C][C]449.8415[/C][C]397.7304[/C][C]501.9526[/C][C]0.0026[/C][C]5e-04[/C][C]0.2356[/C][C]0.0052[/C][/ROW]
[ROW][C]57[/C][C]536[/C][C]457.9187[/C][C]401.7296[/C][C]514.1079[/C][C]0.0032[/C][C]0.0106[/C][C]0.2418[/C][C]0.0181[/C][/ROW]
[ROW][C]58[/C][C]587[/C][C]506.6052[/C][C]446.6098[/C][C]566.6006[/C][C]0.0043[/C][C]0.1685[/C][C]0.2423[/C][C]0.3548[/C][/ROW]
[ROW][C]59[/C][C]597[/C][C]513.9921[/C][C]449.6357[/C][C]578.3485[/C][C]0.0057[/C][C]0.0131[/C][C]0.2711[/C][C]0.4514[/C][/ROW]
[ROW][C]60[/C][C]581[/C][C]499.0125[/C][C]430.5582[/C][C]567.4668[/C][C]0.0095[/C][C]0.0025[/C][C]0.2933[/C][C]0.2933[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70211&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70211&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[48])
36542-------
37527-------
38510-------
39514-------
40517-------
41508-------
42493-------
43490-------
44469-------
45478-------
46528-------
47534-------
48518-------
49506505.6403491.3193519.96130.48040.04540.00170.0454
50502486.213466.9903505.43570.05370.02180.00766e-04
51516490.1732465.0066515.33980.02210.17850.03180.0151
52528496.5978464.2873528.90830.02840.11960.10790.0971
53533487.8676450.2809525.45430.00930.01820.14690.0581
54536470.6959428.9071512.48460.00110.00170.14780.0133
55537468.6603421.7907515.52980.00210.00240.18610.0195
56524449.8415397.7304501.95260.00265e-040.23560.0052
57536457.9187401.7296514.10790.00320.01060.24180.0181
58587506.6052446.6098566.60060.00430.16850.24230.3548
59597513.9921449.6357578.34850.00570.01310.27110.4514
60581499.0125430.5582567.46680.00950.00250.29330.2933







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.01457e-0400.129400
500.02020.03250.0166249.2288124.679111.166
510.02620.05270.0286667.0222305.460117.4774
520.03320.06320.0373986.1005475.620221.8087
530.03930.09250.04832036.9338787.882928.0693
540.04530.13870.06344264.62711367.340336.9776
550.0510.14580.07524670.31811839.194342.8858
560.05910.16490.08645499.48632296.730847.9242
570.06260.17050.09576096.68632718.94852.1435
580.06040.15870.1026463.32913093.386155.6182
590.06390.16150.10746890.31513438.561558.6392
600.070.16430.11226721.94873712.177160.9276

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0145 & 7e-04 & 0 & 0.1294 & 0 & 0 \tabularnewline
50 & 0.0202 & 0.0325 & 0.0166 & 249.2288 & 124.6791 & 11.166 \tabularnewline
51 & 0.0262 & 0.0527 & 0.0286 & 667.0222 & 305.4601 & 17.4774 \tabularnewline
52 & 0.0332 & 0.0632 & 0.0373 & 986.1005 & 475.6202 & 21.8087 \tabularnewline
53 & 0.0393 & 0.0925 & 0.0483 & 2036.9338 & 787.8829 & 28.0693 \tabularnewline
54 & 0.0453 & 0.1387 & 0.0634 & 4264.6271 & 1367.3403 & 36.9776 \tabularnewline
55 & 0.051 & 0.1458 & 0.0752 & 4670.3181 & 1839.1943 & 42.8858 \tabularnewline
56 & 0.0591 & 0.1649 & 0.0864 & 5499.4863 & 2296.7308 & 47.9242 \tabularnewline
57 & 0.0626 & 0.1705 & 0.0957 & 6096.6863 & 2718.948 & 52.1435 \tabularnewline
58 & 0.0604 & 0.1587 & 0.102 & 6463.3291 & 3093.3861 & 55.6182 \tabularnewline
59 & 0.0639 & 0.1615 & 0.1074 & 6890.3151 & 3438.5615 & 58.6392 \tabularnewline
60 & 0.07 & 0.1643 & 0.1122 & 6721.9487 & 3712.1771 & 60.9276 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70211&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]49[/C][C]0.0145[/C][C]7e-04[/C][C]0[/C][C]0.1294[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0202[/C][C]0.0325[/C][C]0.0166[/C][C]249.2288[/C][C]124.6791[/C][C]11.166[/C][/ROW]
[ROW][C]51[/C][C]0.0262[/C][C]0.0527[/C][C]0.0286[/C][C]667.0222[/C][C]305.4601[/C][C]17.4774[/C][/ROW]
[ROW][C]52[/C][C]0.0332[/C][C]0.0632[/C][C]0.0373[/C][C]986.1005[/C][C]475.6202[/C][C]21.8087[/C][/ROW]
[ROW][C]53[/C][C]0.0393[/C][C]0.0925[/C][C]0.0483[/C][C]2036.9338[/C][C]787.8829[/C][C]28.0693[/C][/ROW]
[ROW][C]54[/C][C]0.0453[/C][C]0.1387[/C][C]0.0634[/C][C]4264.6271[/C][C]1367.3403[/C][C]36.9776[/C][/ROW]
[ROW][C]55[/C][C]0.051[/C][C]0.1458[/C][C]0.0752[/C][C]4670.3181[/C][C]1839.1943[/C][C]42.8858[/C][/ROW]
[ROW][C]56[/C][C]0.0591[/C][C]0.1649[/C][C]0.0864[/C][C]5499.4863[/C][C]2296.7308[/C][C]47.9242[/C][/ROW]
[ROW][C]57[/C][C]0.0626[/C][C]0.1705[/C][C]0.0957[/C][C]6096.6863[/C][C]2718.948[/C][C]52.1435[/C][/ROW]
[ROW][C]58[/C][C]0.0604[/C][C]0.1587[/C][C]0.102[/C][C]6463.3291[/C][C]3093.3861[/C][C]55.6182[/C][/ROW]
[ROW][C]59[/C][C]0.0639[/C][C]0.1615[/C][C]0.1074[/C][C]6890.3151[/C][C]3438.5615[/C][C]58.6392[/C][/ROW]
[ROW][C]60[/C][C]0.07[/C][C]0.1643[/C][C]0.1122[/C][C]6721.9487[/C][C]3712.1771[/C][C]60.9276[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70211&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70211&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
490.01457e-0400.129400
500.02020.03250.0166249.2288124.679111.166
510.02620.05270.0286667.0222305.460117.4774
520.03320.06320.0373986.1005475.620221.8087
530.03930.09250.04832036.9338787.882928.0693
540.04530.13870.06344264.62711367.340336.9776
550.0510.14580.07524670.31811839.194342.8858
560.05910.16490.08645499.48632296.730847.9242
570.06260.17050.09576096.68632718.94852.1435
580.06040.15870.1026463.32913093.386155.6182
590.06390.16150.10746890.31513438.561558.6392
600.070.16430.11226721.94873712.177160.9276



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