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 computationWed, 22 Dec 2010 17:00:49 +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/22/t1293037123leszxej7yzv3lm2.htm/, Retrieved Mon, 06 May 2024 02:11:53 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114408, Retrieved Mon, 06 May 2024 02:11:53 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact110
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Paper: ARIMA Fore...] [2010-12-22 17:00:49] [6f3869f9d1e39c73f93153f1f7803f84] [Current]
-   PD    [ARIMA Forecasting] [Paper: ARIMA Fore...] [2010-12-24 17:41:29] [48146708a479232c43a8f6e52fbf83b4]
Feedback Forum

Post a new message
Dataseries X:
608
651
691
627
634
731
475
337
803
722
590
724
627
696
825
677
656
785
412
352
839
729
696
641
695
638
762
635
721
854
418
367
824
687
601
676
740
691
683
594
729
731
386
331
706
715
657
653
642
643
718
654
632
731
392
344
792
852
649
629
685
617
715
715
629
916
531
357
917
828
708
858
775
785
1006
789
734
906
532
387
991
841
892
782




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 3 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114408&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114408&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114408&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 time3 seconds
R Server'George Udny Yule' @ 72.249.76.132







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[72])
60629-------
61685-------
62617-------
63715-------
64715-------
65629-------
66916-------
67531-------
68357-------
69917-------
70828-------
71708-------
72858-------
73775777.2061661.9781892.43410.4850.08470.94160.0847
74785700.8281583.0221818.63420.08070.10860.91840.0045
751006717.1721596.8552837.48900.13460.51410.0109
76789668.409547.7338789.08430.025100.22460.001
77734688.2212567.3939809.04850.22890.0510.83160.0029
78906839.2661718.4055960.12680.13960.95610.10670.3806
79532469.3506348.4791590.22210.154800.15870
80387345.2949224.4206466.16910.24940.00120.42470
81991817.2479696.3728938.12290.002410.05290.2544
82841765.0576644.1823885.93290.10911e-040.15370.0659
83892686.9204566.045807.79574e-040.00620.36620.0028
84782771.9565651.0811892.83180.43530.02580.08150.0815

\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[72]) \tabularnewline
60 & 629 & - & - & - & - & - & - & - \tabularnewline
61 & 685 & - & - & - & - & - & - & - \tabularnewline
62 & 617 & - & - & - & - & - & - & - \tabularnewline
63 & 715 & - & - & - & - & - & - & - \tabularnewline
64 & 715 & - & - & - & - & - & - & - \tabularnewline
65 & 629 & - & - & - & - & - & - & - \tabularnewline
66 & 916 & - & - & - & - & - & - & - \tabularnewline
67 & 531 & - & - & - & - & - & - & - \tabularnewline
68 & 357 & - & - & - & - & - & - & - \tabularnewline
69 & 917 & - & - & - & - & - & - & - \tabularnewline
70 & 828 & - & - & - & - & - & - & - \tabularnewline
71 & 708 & - & - & - & - & - & - & - \tabularnewline
72 & 858 & - & - & - & - & - & - & - \tabularnewline
73 & 775 & 777.2061 & 661.9781 & 892.4341 & 0.485 & 0.0847 & 0.9416 & 0.0847 \tabularnewline
74 & 785 & 700.8281 & 583.0221 & 818.6342 & 0.0807 & 0.1086 & 0.9184 & 0.0045 \tabularnewline
75 & 1006 & 717.1721 & 596.8552 & 837.489 & 0 & 0.1346 & 0.5141 & 0.0109 \tabularnewline
76 & 789 & 668.409 & 547.7338 & 789.0843 & 0.0251 & 0 & 0.2246 & 0.001 \tabularnewline
77 & 734 & 688.2212 & 567.3939 & 809.0485 & 0.2289 & 0.051 & 0.8316 & 0.0029 \tabularnewline
78 & 906 & 839.2661 & 718.4055 & 960.1268 & 0.1396 & 0.9561 & 0.1067 & 0.3806 \tabularnewline
79 & 532 & 469.3506 & 348.4791 & 590.2221 & 0.1548 & 0 & 0.1587 & 0 \tabularnewline
80 & 387 & 345.2949 & 224.4206 & 466.1691 & 0.2494 & 0.0012 & 0.4247 & 0 \tabularnewline
81 & 991 & 817.2479 & 696.3728 & 938.1229 & 0.0024 & 1 & 0.0529 & 0.2544 \tabularnewline
82 & 841 & 765.0576 & 644.1823 & 885.9329 & 0.1091 & 1e-04 & 0.1537 & 0.0659 \tabularnewline
83 & 892 & 686.9204 & 566.045 & 807.7957 & 4e-04 & 0.0062 & 0.3662 & 0.0028 \tabularnewline
84 & 782 & 771.9565 & 651.0811 & 892.8318 & 0.4353 & 0.0258 & 0.0815 & 0.0815 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114408&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[72])[/C][/ROW]
[ROW][C]60[/C][C]629[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]685[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]617[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]715[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]715[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]629[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]916[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]531[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]917[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]828[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]708[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]858[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]775[/C][C]777.2061[/C][C]661.9781[/C][C]892.4341[/C][C]0.485[/C][C]0.0847[/C][C]0.9416[/C][C]0.0847[/C][/ROW]
[ROW][C]74[/C][C]785[/C][C]700.8281[/C][C]583.0221[/C][C]818.6342[/C][C]0.0807[/C][C]0.1086[/C][C]0.9184[/C][C]0.0045[/C][/ROW]
[ROW][C]75[/C][C]1006[/C][C]717.1721[/C][C]596.8552[/C][C]837.489[/C][C]0[/C][C]0.1346[/C][C]0.5141[/C][C]0.0109[/C][/ROW]
[ROW][C]76[/C][C]789[/C][C]668.409[/C][C]547.7338[/C][C]789.0843[/C][C]0.0251[/C][C]0[/C][C]0.2246[/C][C]0.001[/C][/ROW]
[ROW][C]77[/C][C]734[/C][C]688.2212[/C][C]567.3939[/C][C]809.0485[/C][C]0.2289[/C][C]0.051[/C][C]0.8316[/C][C]0.0029[/C][/ROW]
[ROW][C]78[/C][C]906[/C][C]839.2661[/C][C]718.4055[/C][C]960.1268[/C][C]0.1396[/C][C]0.9561[/C][C]0.1067[/C][C]0.3806[/C][/ROW]
[ROW][C]79[/C][C]532[/C][C]469.3506[/C][C]348.4791[/C][C]590.2221[/C][C]0.1548[/C][C]0[/C][C]0.1587[/C][C]0[/C][/ROW]
[ROW][C]80[/C][C]387[/C][C]345.2949[/C][C]224.4206[/C][C]466.1691[/C][C]0.2494[/C][C]0.0012[/C][C]0.4247[/C][C]0[/C][/ROW]
[ROW][C]81[/C][C]991[/C][C]817.2479[/C][C]696.3728[/C][C]938.1229[/C][C]0.0024[/C][C]1[/C][C]0.0529[/C][C]0.2544[/C][/ROW]
[ROW][C]82[/C][C]841[/C][C]765.0576[/C][C]644.1823[/C][C]885.9329[/C][C]0.1091[/C][C]1e-04[/C][C]0.1537[/C][C]0.0659[/C][/ROW]
[ROW][C]83[/C][C]892[/C][C]686.9204[/C][C]566.045[/C][C]807.7957[/C][C]4e-04[/C][C]0.0062[/C][C]0.3662[/C][C]0.0028[/C][/ROW]
[ROW][C]84[/C][C]782[/C][C]771.9565[/C][C]651.0811[/C][C]892.8318[/C][C]0.4353[/C][C]0.0258[/C][C]0.0815[/C][C]0.0815[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114408&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114408&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[72])
60629-------
61685-------
62617-------
63715-------
64715-------
65629-------
66916-------
67531-------
68357-------
69917-------
70828-------
71708-------
72858-------
73775777.2061661.9781892.43410.4850.08470.94160.0847
74785700.8281583.0221818.63420.08070.10860.91840.0045
751006717.1721596.8552837.48900.13460.51410.0109
76789668.409547.7338789.08430.025100.22460.001
77734688.2212567.3939809.04850.22890.0510.83160.0029
78906839.2661718.4055960.12680.13960.95610.10670.3806
79532469.3506348.4791590.22210.154800.15870
80387345.2949224.4206466.16910.24940.00120.42470
81991817.2479696.3728938.12290.002410.05290.2544
82841765.0576644.1823885.93290.10911e-040.15370.0659
83892686.9204566.045807.79574e-040.00620.36620.0028
84782771.9565651.0811892.83180.43530.02580.08150.0815







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
730.0756-0.002804.86700
740.08580.12010.06157084.90333544.885259.5389
750.08560.40270.175283421.554430170.4416173.6964
760.09210.18040.176514542.180426263.3763162.0598
770.08960.06650.15452095.697121429.8405146.3893
780.07350.07950.1424453.408118600.4351136.3834
790.13140.13350.14083924.948916503.937128.4676
800.17860.12080.13831739.315814658.3594121.0717
810.07550.21260.146630189.807816384.0759128.0003
820.08060.09930.14185767.251915322.3935123.7837
830.08980.29850.156142057.649217752.8713133.2399
840.07990.0130.1442100.872716281.8714127.6004

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
73 & 0.0756 & -0.0028 & 0 & 4.867 & 0 & 0 \tabularnewline
74 & 0.0858 & 0.1201 & 0.0615 & 7084.9033 & 3544.8852 & 59.5389 \tabularnewline
75 & 0.0856 & 0.4027 & 0.1752 & 83421.5544 & 30170.4416 & 173.6964 \tabularnewline
76 & 0.0921 & 0.1804 & 0.1765 & 14542.1804 & 26263.3763 & 162.0598 \tabularnewline
77 & 0.0896 & 0.0665 & 0.1545 & 2095.6971 & 21429.8405 & 146.3893 \tabularnewline
78 & 0.0735 & 0.0795 & 0.142 & 4453.4081 & 18600.4351 & 136.3834 \tabularnewline
79 & 0.1314 & 0.1335 & 0.1408 & 3924.9489 & 16503.937 & 128.4676 \tabularnewline
80 & 0.1786 & 0.1208 & 0.1383 & 1739.3158 & 14658.3594 & 121.0717 \tabularnewline
81 & 0.0755 & 0.2126 & 0.1466 & 30189.8078 & 16384.0759 & 128.0003 \tabularnewline
82 & 0.0806 & 0.0993 & 0.1418 & 5767.2519 & 15322.3935 & 123.7837 \tabularnewline
83 & 0.0898 & 0.2985 & 0.1561 & 42057.6492 & 17752.8713 & 133.2399 \tabularnewline
84 & 0.0799 & 0.013 & 0.1442 & 100.8727 & 16281.8714 & 127.6004 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114408&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]73[/C][C]0.0756[/C][C]-0.0028[/C][C]0[/C][C]4.867[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]74[/C][C]0.0858[/C][C]0.1201[/C][C]0.0615[/C][C]7084.9033[/C][C]3544.8852[/C][C]59.5389[/C][/ROW]
[ROW][C]75[/C][C]0.0856[/C][C]0.4027[/C][C]0.1752[/C][C]83421.5544[/C][C]30170.4416[/C][C]173.6964[/C][/ROW]
[ROW][C]76[/C][C]0.0921[/C][C]0.1804[/C][C]0.1765[/C][C]14542.1804[/C][C]26263.3763[/C][C]162.0598[/C][/ROW]
[ROW][C]77[/C][C]0.0896[/C][C]0.0665[/C][C]0.1545[/C][C]2095.6971[/C][C]21429.8405[/C][C]146.3893[/C][/ROW]
[ROW][C]78[/C][C]0.0735[/C][C]0.0795[/C][C]0.142[/C][C]4453.4081[/C][C]18600.4351[/C][C]136.3834[/C][/ROW]
[ROW][C]79[/C][C]0.1314[/C][C]0.1335[/C][C]0.1408[/C][C]3924.9489[/C][C]16503.937[/C][C]128.4676[/C][/ROW]
[ROW][C]80[/C][C]0.1786[/C][C]0.1208[/C][C]0.1383[/C][C]1739.3158[/C][C]14658.3594[/C][C]121.0717[/C][/ROW]
[ROW][C]81[/C][C]0.0755[/C][C]0.2126[/C][C]0.1466[/C][C]30189.8078[/C][C]16384.0759[/C][C]128.0003[/C][/ROW]
[ROW][C]82[/C][C]0.0806[/C][C]0.0993[/C][C]0.1418[/C][C]5767.2519[/C][C]15322.3935[/C][C]123.7837[/C][/ROW]
[ROW][C]83[/C][C]0.0898[/C][C]0.2985[/C][C]0.1561[/C][C]42057.6492[/C][C]17752.8713[/C][C]133.2399[/C][/ROW]
[ROW][C]84[/C][C]0.0799[/C][C]0.013[/C][C]0.1442[/C][C]100.8727[/C][C]16281.8714[/C][C]127.6004[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114408&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114408&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
730.0756-0.002804.86700
740.08580.12010.06157084.90333544.885259.5389
750.08560.40270.175283421.554430170.4416173.6964
760.09210.18040.176514542.180426263.3763162.0598
770.08960.06650.15452095.697121429.8405146.3893
780.07350.07950.1424453.408118600.4351136.3834
790.13140.13350.14083924.948916503.937128.4676
800.17860.12080.13831739.315814658.3594121.0717
810.07550.21260.146630189.807816384.0759128.0003
820.08060.09930.14185767.251915322.3935123.7837
830.08980.29850.156142057.649217752.8713133.2399
840.07990.0130.1442100.872716281.8714127.6004



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