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, 21 Dec 2011 12:54:32 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/21/t13244901628p49zkjdach6c96.htm/, Retrieved Tue, 07 May 2024 21:56:15 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=158915, Retrieved Tue, 07 May 2024 21:56:15 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact65
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [paper - Forecasting] [2011-12-21 17:54:32] [13dfa60174f50d862e8699db2153bfc5] [Current]
Feedback Forum

Post a new message
Dataseries X:
617
614
647
580
614
636
388
356
639
753
611
639
630
586
695
552
619
681
421
307
754
690
644
643
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
811
792
978
773
796
946
594
438
1023
868
791
760
779
852
1001
734
996
869
599
426
1138




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\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 & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158915&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]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158915&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158915&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'Gertrude Mary Cox' @ cox.wessa.net







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[117])
105991-------
106841-------
107892-------
108782-------
109811-------
110792.000000000001-------
111978.000000000001-------
112773-------
113796-------
114946-------
115594-------
116438-------
1171023-------
118868964.8532826.24021132.32850.12850.24810.92640.2481
119791845.6869726.7622988.74490.22690.37990.26290.0076
120760875.6277748.69741029.27640.07010.85980.88380.0301
121779873.3093744.80091029.36440.11810.92270.78310.03
122852856.9482729.01641012.78790.47520.83650.7930.0184
1231001984.6396831.32971173.15910.43250.91610.52750.345
124734838.5461709.6357996.60320.09740.0220.79180.0111
125996862.9372727.48661029.80630.0590.9350.78410.0301
1268691012.2578846.26881218.88840.08710.56130.73520.4594
127599563.6111479.2369666.45370.2500.28120
128426441.6516377.4992519.34120.346500.53670
12911381058.4133876.00921288.34490.248810.61860.6186

\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[117]) \tabularnewline
105 & 991 & - & - & - & - & - & - & - \tabularnewline
106 & 841 & - & - & - & - & - & - & - \tabularnewline
107 & 892 & - & - & - & - & - & - & - \tabularnewline
108 & 782 & - & - & - & - & - & - & - \tabularnewline
109 & 811 & - & - & - & - & - & - & - \tabularnewline
110 & 792.000000000001 & - & - & - & - & - & - & - \tabularnewline
111 & 978.000000000001 & - & - & - & - & - & - & - \tabularnewline
112 & 773 & - & - & - & - & - & - & - \tabularnewline
113 & 796 & - & - & - & - & - & - & - \tabularnewline
114 & 946 & - & - & - & - & - & - & - \tabularnewline
115 & 594 & - & - & - & - & - & - & - \tabularnewline
116 & 438 & - & - & - & - & - & - & - \tabularnewline
117 & 1023 & - & - & - & - & - & - & - \tabularnewline
118 & 868 & 964.8532 & 826.2402 & 1132.3285 & 0.1285 & 0.2481 & 0.9264 & 0.2481 \tabularnewline
119 & 791 & 845.6869 & 726.7622 & 988.7449 & 0.2269 & 0.3799 & 0.2629 & 0.0076 \tabularnewline
120 & 760 & 875.6277 & 748.6974 & 1029.2764 & 0.0701 & 0.8598 & 0.8838 & 0.0301 \tabularnewline
121 & 779 & 873.3093 & 744.8009 & 1029.3644 & 0.1181 & 0.9227 & 0.7831 & 0.03 \tabularnewline
122 & 852 & 856.9482 & 729.0164 & 1012.7879 & 0.4752 & 0.8365 & 0.793 & 0.0184 \tabularnewline
123 & 1001 & 984.6396 & 831.3297 & 1173.1591 & 0.4325 & 0.9161 & 0.5275 & 0.345 \tabularnewline
124 & 734 & 838.5461 & 709.6357 & 996.6032 & 0.0974 & 0.022 & 0.7918 & 0.0111 \tabularnewline
125 & 996 & 862.9372 & 727.4866 & 1029.8063 & 0.059 & 0.935 & 0.7841 & 0.0301 \tabularnewline
126 & 869 & 1012.2578 & 846.2688 & 1218.8884 & 0.0871 & 0.5613 & 0.7352 & 0.4594 \tabularnewline
127 & 599 & 563.6111 & 479.2369 & 666.4537 & 0.25 & 0 & 0.2812 & 0 \tabularnewline
128 & 426 & 441.6516 & 377.4992 & 519.3412 & 0.3465 & 0 & 0.5367 & 0 \tabularnewline
129 & 1138 & 1058.4133 & 876.0092 & 1288.3449 & 0.2488 & 1 & 0.6186 & 0.6186 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158915&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[117])[/C][/ROW]
[ROW][C]105[/C][C]991[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]841[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]892[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]782[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]811[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]792.000000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]978.000000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]773[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]796[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]946[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]594[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]438[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]1023[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]868[/C][C]964.8532[/C][C]826.2402[/C][C]1132.3285[/C][C]0.1285[/C][C]0.2481[/C][C]0.9264[/C][C]0.2481[/C][/ROW]
[ROW][C]119[/C][C]791[/C][C]845.6869[/C][C]726.7622[/C][C]988.7449[/C][C]0.2269[/C][C]0.3799[/C][C]0.2629[/C][C]0.0076[/C][/ROW]
[ROW][C]120[/C][C]760[/C][C]875.6277[/C][C]748.6974[/C][C]1029.2764[/C][C]0.0701[/C][C]0.8598[/C][C]0.8838[/C][C]0.0301[/C][/ROW]
[ROW][C]121[/C][C]779[/C][C]873.3093[/C][C]744.8009[/C][C]1029.3644[/C][C]0.1181[/C][C]0.9227[/C][C]0.7831[/C][C]0.03[/C][/ROW]
[ROW][C]122[/C][C]852[/C][C]856.9482[/C][C]729.0164[/C][C]1012.7879[/C][C]0.4752[/C][C]0.8365[/C][C]0.793[/C][C]0.0184[/C][/ROW]
[ROW][C]123[/C][C]1001[/C][C]984.6396[/C][C]831.3297[/C][C]1173.1591[/C][C]0.4325[/C][C]0.9161[/C][C]0.5275[/C][C]0.345[/C][/ROW]
[ROW][C]124[/C][C]734[/C][C]838.5461[/C][C]709.6357[/C][C]996.6032[/C][C]0.0974[/C][C]0.022[/C][C]0.7918[/C][C]0.0111[/C][/ROW]
[ROW][C]125[/C][C]996[/C][C]862.9372[/C][C]727.4866[/C][C]1029.8063[/C][C]0.059[/C][C]0.935[/C][C]0.7841[/C][C]0.0301[/C][/ROW]
[ROW][C]126[/C][C]869[/C][C]1012.2578[/C][C]846.2688[/C][C]1218.8884[/C][C]0.0871[/C][C]0.5613[/C][C]0.7352[/C][C]0.4594[/C][/ROW]
[ROW][C]127[/C][C]599[/C][C]563.6111[/C][C]479.2369[/C][C]666.4537[/C][C]0.25[/C][C]0[/C][C]0.2812[/C][C]0[/C][/ROW]
[ROW][C]128[/C][C]426[/C][C]441.6516[/C][C]377.4992[/C][C]519.3412[/C][C]0.3465[/C][C]0[/C][C]0.5367[/C][C]0[/C][/ROW]
[ROW][C]129[/C][C]1138[/C][C]1058.4133[/C][C]876.0092[/C][C]1288.3449[/C][C]0.2488[/C][C]1[/C][C]0.6186[/C][C]0.6186[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158915&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158915&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[117])
105991-------
106841-------
107892-------
108782-------
109811-------
110792.000000000001-------
111978.000000000001-------
112773-------
113796-------
114946-------
115594-------
116438-------
1171023-------
118868964.8532826.24021132.32850.12850.24810.92640.2481
119791845.6869726.7622988.74490.22690.37990.26290.0076
120760875.6277748.69741029.27640.07010.85980.88380.0301
121779873.3093744.80091029.36440.11810.92270.78310.03
122852856.9482729.01641012.78790.47520.83650.7930.0184
1231001984.6396831.32971173.15910.43250.91610.52750.345
124734838.5461709.6357996.60320.09740.0220.79180.0111
125996862.9372727.48661029.80630.0590.9350.78410.0301
1268691012.2578846.26881218.88840.08710.56130.73520.4594
127599563.6111479.2369666.45370.2500.28120
128426441.6516377.4992519.34120.346500.53670
12911381058.4133876.00921288.34490.248810.61860.6186







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1180.0886-0.100409380.536600
1190.0863-0.06470.08252990.65316185.594878.6486
1200.0895-0.13210.09913369.77478580.321492.63
1210.0912-0.1080.10138894.2368658.800193.0527
1220.0928-0.00580.082224.4856931.937183.2583
1230.09770.01660.0712267.66145821.224476.2969
1240.0962-0.12470.078910929.88026551.032480.9384
1250.09870.15420.088317705.70397945.366489.1368
1260.1041-0.14150.094220522.79059342.857996.6585
1270.09310.06280.09111252.37148533.809392.3786
1280.0897-0.03540.086244.97157780.278688.2059
1290.11080.07520.08516334.04087659.758887.52

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
118 & 0.0886 & -0.1004 & 0 & 9380.5366 & 0 & 0 \tabularnewline
119 & 0.0863 & -0.0647 & 0.0825 & 2990.6531 & 6185.5948 & 78.6486 \tabularnewline
120 & 0.0895 & -0.1321 & 0.099 & 13369.7747 & 8580.3214 & 92.63 \tabularnewline
121 & 0.0912 & -0.108 & 0.1013 & 8894.236 & 8658.8001 & 93.0527 \tabularnewline
122 & 0.0928 & -0.0058 & 0.0822 & 24.485 & 6931.9371 & 83.2583 \tabularnewline
123 & 0.0977 & 0.0166 & 0.0712 & 267.6614 & 5821.2244 & 76.2969 \tabularnewline
124 & 0.0962 & -0.1247 & 0.0789 & 10929.8802 & 6551.0324 & 80.9384 \tabularnewline
125 & 0.0987 & 0.1542 & 0.0883 & 17705.7039 & 7945.3664 & 89.1368 \tabularnewline
126 & 0.1041 & -0.1415 & 0.0942 & 20522.7905 & 9342.8579 & 96.6585 \tabularnewline
127 & 0.0931 & 0.0628 & 0.0911 & 1252.3714 & 8533.8093 & 92.3786 \tabularnewline
128 & 0.0897 & -0.0354 & 0.086 & 244.9715 & 7780.2786 & 88.2059 \tabularnewline
129 & 0.1108 & 0.0752 & 0.0851 & 6334.0408 & 7659.7588 & 87.52 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158915&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]118[/C][C]0.0886[/C][C]-0.1004[/C][C]0[/C][C]9380.5366[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]119[/C][C]0.0863[/C][C]-0.0647[/C][C]0.0825[/C][C]2990.6531[/C][C]6185.5948[/C][C]78.6486[/C][/ROW]
[ROW][C]120[/C][C]0.0895[/C][C]-0.1321[/C][C]0.099[/C][C]13369.7747[/C][C]8580.3214[/C][C]92.63[/C][/ROW]
[ROW][C]121[/C][C]0.0912[/C][C]-0.108[/C][C]0.1013[/C][C]8894.236[/C][C]8658.8001[/C][C]93.0527[/C][/ROW]
[ROW][C]122[/C][C]0.0928[/C][C]-0.0058[/C][C]0.0822[/C][C]24.485[/C][C]6931.9371[/C][C]83.2583[/C][/ROW]
[ROW][C]123[/C][C]0.0977[/C][C]0.0166[/C][C]0.0712[/C][C]267.6614[/C][C]5821.2244[/C][C]76.2969[/C][/ROW]
[ROW][C]124[/C][C]0.0962[/C][C]-0.1247[/C][C]0.0789[/C][C]10929.8802[/C][C]6551.0324[/C][C]80.9384[/C][/ROW]
[ROW][C]125[/C][C]0.0987[/C][C]0.1542[/C][C]0.0883[/C][C]17705.7039[/C][C]7945.3664[/C][C]89.1368[/C][/ROW]
[ROW][C]126[/C][C]0.1041[/C][C]-0.1415[/C][C]0.0942[/C][C]20522.7905[/C][C]9342.8579[/C][C]96.6585[/C][/ROW]
[ROW][C]127[/C][C]0.0931[/C][C]0.0628[/C][C]0.0911[/C][C]1252.3714[/C][C]8533.8093[/C][C]92.3786[/C][/ROW]
[ROW][C]128[/C][C]0.0897[/C][C]-0.0354[/C][C]0.086[/C][C]244.9715[/C][C]7780.2786[/C][C]88.2059[/C][/ROW]
[ROW][C]129[/C][C]0.1108[/C][C]0.0752[/C][C]0.0851[/C][C]6334.0408[/C][C]7659.7588[/C][C]87.52[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158915&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158915&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
1180.0886-0.100409380.536600
1190.0863-0.06470.08252990.65316185.594878.6486
1200.0895-0.13210.09913369.77478580.321492.63
1210.0912-0.1080.10138894.2368658.800193.0527
1220.0928-0.00580.082224.4856931.937183.2583
1230.09770.01660.0712267.66145821.224476.2969
1240.0962-0.12470.078910929.88026551.032480.9384
1250.09870.15420.088317705.70397945.366489.1368
1260.1041-0.14150.094220522.79059342.857996.6585
1270.09310.06280.09111252.37148533.809392.3786
1280.0897-0.03540.086244.97157780.278688.2059
1290.11080.07520.08516334.04087659.758887.52



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