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 computationSat, 19 Dec 2009 03:31:03 -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/19/t1261218693n4lfqlqsrp6njc6.htm/, Retrieved Fri, 03 May 2024 14:16:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69480, Retrieved Fri, 03 May 2024 14:16:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact148
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Multiple Regression] [Q1 The Seatbeltlaw] [2007-11-14 19:27:43] [8cd6641b921d30ebe00b648d1481bba0]
- RM D  [Multiple Regression] [Seatbelt] [2009-11-12 14:06:21] [b98453cac15ba1066b407e146608df68]
- R PD    [Multiple Regression] [] [2009-11-19 08:06:13] [639dd97b6eeebe46a3c92d62cb04fb95]
- RMPD      [ARIMA Forecasting] [] [2009-12-14 08:41:55] [639dd97b6eeebe46a3c92d62cb04fb95]
-   PD          [ARIMA Forecasting] [] [2009-12-19 10:31:03] [21edaefb91319406e70b6c03c71b58b3] [Current]
Feedback Forum

Post a new message
Dataseries X:
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
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
564
558




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69480&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[83])
71510-------
72514-------
73517-------
74508-------
75493-------
76490-------
77469-------
78478-------
79528-------
80534-------
81518-------
82506-------
83502-------
84516505.2365491.684519.16260.06490.67560.10870.6756
85528508.2246489.5699527.59020.02270.21570.18720.7357
86533499.3753477.2062522.57420.00220.00780.23310.4123
87536484.63459.9794510.60171e-041e-040.26380.095
88537481.681454.4422510.55241e-041e-040.28610.0839
89524461.0375432.6051491.3385000.30330.004
90536469.8847438.7021503.28371e-047e-040.3170.0297
91587519.0358482.3333558.53124e-040.19990.32820.8011
92597524.9339485.6772567.36384e-040.00210.33770.8553
93581509.2056469.1713552.6566e-0400.34580.6274
94564497.4093456.4937541.99230.00171e-040.35280.42
95558493.4772451.1762539.74430.00310.00140.3590.359

\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[83]) \tabularnewline
71 & 510 & - & - & - & - & - & - & - \tabularnewline
72 & 514 & - & - & - & - & - & - & - \tabularnewline
73 & 517 & - & - & - & - & - & - & - \tabularnewline
74 & 508 & - & - & - & - & - & - & - \tabularnewline
75 & 493 & - & - & - & - & - & - & - \tabularnewline
76 & 490 & - & - & - & - & - & - & - \tabularnewline
77 & 469 & - & - & - & - & - & - & - \tabularnewline
78 & 478 & - & - & - & - & - & - & - \tabularnewline
79 & 528 & - & - & - & - & - & - & - \tabularnewline
80 & 534 & - & - & - & - & - & - & - \tabularnewline
81 & 518 & - & - & - & - & - & - & - \tabularnewline
82 & 506 & - & - & - & - & - & - & - \tabularnewline
83 & 502 & - & - & - & - & - & - & - \tabularnewline
84 & 516 & 505.2365 & 491.684 & 519.1626 & 0.0649 & 0.6756 & 0.1087 & 0.6756 \tabularnewline
85 & 528 & 508.2246 & 489.5699 & 527.5902 & 0.0227 & 0.2157 & 0.1872 & 0.7357 \tabularnewline
86 & 533 & 499.3753 & 477.2062 & 522.5742 & 0.0022 & 0.0078 & 0.2331 & 0.4123 \tabularnewline
87 & 536 & 484.63 & 459.9794 & 510.6017 & 1e-04 & 1e-04 & 0.2638 & 0.095 \tabularnewline
88 & 537 & 481.681 & 454.4422 & 510.5524 & 1e-04 & 1e-04 & 0.2861 & 0.0839 \tabularnewline
89 & 524 & 461.0375 & 432.6051 & 491.3385 & 0 & 0 & 0.3033 & 0.004 \tabularnewline
90 & 536 & 469.8847 & 438.7021 & 503.2837 & 1e-04 & 7e-04 & 0.317 & 0.0297 \tabularnewline
91 & 587 & 519.0358 & 482.3333 & 558.5312 & 4e-04 & 0.1999 & 0.3282 & 0.8011 \tabularnewline
92 & 597 & 524.9339 & 485.6772 & 567.3638 & 4e-04 & 0.0021 & 0.3377 & 0.8553 \tabularnewline
93 & 581 & 509.2056 & 469.1713 & 552.656 & 6e-04 & 0 & 0.3458 & 0.6274 \tabularnewline
94 & 564 & 497.4093 & 456.4937 & 541.9923 & 0.0017 & 1e-04 & 0.3528 & 0.42 \tabularnewline
95 & 558 & 493.4772 & 451.1762 & 539.7443 & 0.0031 & 0.0014 & 0.359 & 0.359 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69480&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[83])[/C][/ROW]
[ROW][C]71[/C][C]510[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]514[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]517[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]508[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]493[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]490[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]469[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]478[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]528[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]534[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]518[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]506[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]502[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]516[/C][C]505.2365[/C][C]491.684[/C][C]519.1626[/C][C]0.0649[/C][C]0.6756[/C][C]0.1087[/C][C]0.6756[/C][/ROW]
[ROW][C]85[/C][C]528[/C][C]508.2246[/C][C]489.5699[/C][C]527.5902[/C][C]0.0227[/C][C]0.2157[/C][C]0.1872[/C][C]0.7357[/C][/ROW]
[ROW][C]86[/C][C]533[/C][C]499.3753[/C][C]477.2062[/C][C]522.5742[/C][C]0.0022[/C][C]0.0078[/C][C]0.2331[/C][C]0.4123[/C][/ROW]
[ROW][C]87[/C][C]536[/C][C]484.63[/C][C]459.9794[/C][C]510.6017[/C][C]1e-04[/C][C]1e-04[/C][C]0.2638[/C][C]0.095[/C][/ROW]
[ROW][C]88[/C][C]537[/C][C]481.681[/C][C]454.4422[/C][C]510.5524[/C][C]1e-04[/C][C]1e-04[/C][C]0.2861[/C][C]0.0839[/C][/ROW]
[ROW][C]89[/C][C]524[/C][C]461.0375[/C][C]432.6051[/C][C]491.3385[/C][C]0[/C][C]0[/C][C]0.3033[/C][C]0.004[/C][/ROW]
[ROW][C]90[/C][C]536[/C][C]469.8847[/C][C]438.7021[/C][C]503.2837[/C][C]1e-04[/C][C]7e-04[/C][C]0.317[/C][C]0.0297[/C][/ROW]
[ROW][C]91[/C][C]587[/C][C]519.0358[/C][C]482.3333[/C][C]558.5312[/C][C]4e-04[/C][C]0.1999[/C][C]0.3282[/C][C]0.8011[/C][/ROW]
[ROW][C]92[/C][C]597[/C][C]524.9339[/C][C]485.6772[/C][C]567.3638[/C][C]4e-04[/C][C]0.0021[/C][C]0.3377[/C][C]0.8553[/C][/ROW]
[ROW][C]93[/C][C]581[/C][C]509.2056[/C][C]469.1713[/C][C]552.656[/C][C]6e-04[/C][C]0[/C][C]0.3458[/C][C]0.6274[/C][/ROW]
[ROW][C]94[/C][C]564[/C][C]497.4093[/C][C]456.4937[/C][C]541.9923[/C][C]0.0017[/C][C]1e-04[/C][C]0.3528[/C][C]0.42[/C][/ROW]
[ROW][C]95[/C][C]558[/C][C]493.4772[/C][C]451.1762[/C][C]539.7443[/C][C]0.0031[/C][C]0.0014[/C][C]0.359[/C][C]0.359[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69480&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69480&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[83])
71510-------
72514-------
73517-------
74508-------
75493-------
76490-------
77469-------
78478-------
79528-------
80534-------
81518-------
82506-------
83502-------
84516505.2365491.684519.16260.06490.67560.10870.6756
85528508.2246489.5699527.59020.02270.21570.18720.7357
86533499.3753477.2062522.57420.00220.00780.23310.4123
87536484.63459.9794510.60171e-041e-040.26380.095
88537481.681454.4422510.55241e-041e-040.28610.0839
89524461.0375432.6051491.3385000.30330.004
90536469.8847438.7021503.28371e-047e-040.3170.0297
91587519.0358482.3333558.53124e-040.19990.32820.8011
92597524.9339485.6772567.36384e-040.00210.33770.8553
93581509.2056469.1713552.6566e-0400.34580.6274
94564497.4093456.4937541.99230.00171e-040.35280.42
95558493.4772451.1762539.74430.00310.00140.3590.359







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
840.01410.02130115.852700
850.01940.03890.0301391.0648253.458815.9204
860.02370.06730.04251130.6237545.847123.3634
870.02730.1060.05842638.87321069.103632.6971
880.03060.11480.06973060.19591467.322138.3056
890.03350.13660.08083964.27731883.481343.3991
900.03630.14070.08944371.23362238.874547.3167
910.03880.13090.09464619.13072536.406550.3627
920.04120.13730.09935193.5162831.640953.2132
930.04350.1410.10355154.43743063.920555.3527
940.04570.13390.10634434.31863188.502256.4668
950.04780.13080.10834163.18773269.72657.1815

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
84 & 0.0141 & 0.0213 & 0 & 115.8527 & 0 & 0 \tabularnewline
85 & 0.0194 & 0.0389 & 0.0301 & 391.0648 & 253.4588 & 15.9204 \tabularnewline
86 & 0.0237 & 0.0673 & 0.0425 & 1130.6237 & 545.8471 & 23.3634 \tabularnewline
87 & 0.0273 & 0.106 & 0.0584 & 2638.8732 & 1069.1036 & 32.6971 \tabularnewline
88 & 0.0306 & 0.1148 & 0.0697 & 3060.1959 & 1467.3221 & 38.3056 \tabularnewline
89 & 0.0335 & 0.1366 & 0.0808 & 3964.2773 & 1883.4813 & 43.3991 \tabularnewline
90 & 0.0363 & 0.1407 & 0.0894 & 4371.2336 & 2238.8745 & 47.3167 \tabularnewline
91 & 0.0388 & 0.1309 & 0.0946 & 4619.1307 & 2536.4065 & 50.3627 \tabularnewline
92 & 0.0412 & 0.1373 & 0.0993 & 5193.516 & 2831.6409 & 53.2132 \tabularnewline
93 & 0.0435 & 0.141 & 0.1035 & 5154.4374 & 3063.9205 & 55.3527 \tabularnewline
94 & 0.0457 & 0.1339 & 0.1063 & 4434.3186 & 3188.5022 & 56.4668 \tabularnewline
95 & 0.0478 & 0.1308 & 0.1083 & 4163.1877 & 3269.726 & 57.1815 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69480&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]84[/C][C]0.0141[/C][C]0.0213[/C][C]0[/C][C]115.8527[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]85[/C][C]0.0194[/C][C]0.0389[/C][C]0.0301[/C][C]391.0648[/C][C]253.4588[/C][C]15.9204[/C][/ROW]
[ROW][C]86[/C][C]0.0237[/C][C]0.0673[/C][C]0.0425[/C][C]1130.6237[/C][C]545.8471[/C][C]23.3634[/C][/ROW]
[ROW][C]87[/C][C]0.0273[/C][C]0.106[/C][C]0.0584[/C][C]2638.8732[/C][C]1069.1036[/C][C]32.6971[/C][/ROW]
[ROW][C]88[/C][C]0.0306[/C][C]0.1148[/C][C]0.0697[/C][C]3060.1959[/C][C]1467.3221[/C][C]38.3056[/C][/ROW]
[ROW][C]89[/C][C]0.0335[/C][C]0.1366[/C][C]0.0808[/C][C]3964.2773[/C][C]1883.4813[/C][C]43.3991[/C][/ROW]
[ROW][C]90[/C][C]0.0363[/C][C]0.1407[/C][C]0.0894[/C][C]4371.2336[/C][C]2238.8745[/C][C]47.3167[/C][/ROW]
[ROW][C]91[/C][C]0.0388[/C][C]0.1309[/C][C]0.0946[/C][C]4619.1307[/C][C]2536.4065[/C][C]50.3627[/C][/ROW]
[ROW][C]92[/C][C]0.0412[/C][C]0.1373[/C][C]0.0993[/C][C]5193.516[/C][C]2831.6409[/C][C]53.2132[/C][/ROW]
[ROW][C]93[/C][C]0.0435[/C][C]0.141[/C][C]0.1035[/C][C]5154.4374[/C][C]3063.9205[/C][C]55.3527[/C][/ROW]
[ROW][C]94[/C][C]0.0457[/C][C]0.1339[/C][C]0.1063[/C][C]4434.3186[/C][C]3188.5022[/C][C]56.4668[/C][/ROW]
[ROW][C]95[/C][C]0.0478[/C][C]0.1308[/C][C]0.1083[/C][C]4163.1877[/C][C]3269.726[/C][C]57.1815[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69480&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69480&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
840.01410.02130115.852700
850.01940.03890.0301391.0648253.458815.9204
860.02370.06730.04251130.6237545.847123.3634
870.02730.1060.05842638.87321069.103632.6971
880.03060.11480.06973060.19591467.322138.3056
890.03350.13660.08083964.27731883.481343.3991
900.03630.14070.08944371.23362238.874547.3167
910.03880.13090.09464619.13072536.406550.3627
920.04120.13730.09935193.5162831.640953.2132
930.04350.1410.10355154.43743063.920555.3527
940.04570.13390.10634434.31863188.502256.4668
950.04780.13080.10834163.18773269.72657.1815



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