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 computationTue, 15 Dec 2015 11:29:57 +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/2015/Dec/15/t145017901712u9d4shl6qtzng.htm/, Retrieved Sat, 18 May 2024 15:59:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=286471, Retrieved Sat, 18 May 2024 15:59:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact95
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima Forecast] [2015-12-15 11:29:57] [bf0d5eb0caf2a926d5d81273b164b1d3] [Current]
Feedback Forum

Post a new message
Dataseries X:
589
561
640
656
727
697
640
599
568
577
553
582
600
566
653
673
742
716
660
617
583
587
565
598
628
618
688
705
770
736
678
639
604
611
594
634
658
622
709
722
782
756
702
653
615
621
602
635
677
635
736
755
811
798
735
697
661
667
645
688
713
667
762
784
837
817
767
722
681
687
660
698
717
696
775
796
858
826
783
740
701
706
677
711
734
690
785
805
871
845
801
764
725
723
690
734
750
707
807
824
886
859
819
783
740
747
711
751
804
756
860
878
942
913
869
834
790
800
763
800
826
799
890
900
961
935
894
855
809
810
766
805
821
773
883
898
957
924
881
837
784
791
760
802
828
778
889
902
969
947
908
867
815
812
773
813
834
782
892
903
966
937
896
858
817
827
797
843




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=286471&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[156])
144802-------
145828-------
146778-------
147889-------
148902-------
149969-------
150947-------
151908-------
152867-------
153815-------
154812-------
155773-------
156813-------
157834836.8389822.4209851.30680.35030.99940.88440.9994
158782794.3325776.1439812.60470.092900.96010.0226
159892897.6417875.9734919.4150.305810.78171
160903913.9569888.8503939.20220.19750.95590.82341
161966975.9919948.23521003.90740.241510.68831
162937950.7655920.4524981.27330.18820.16390.59561
163896907.6813875.6645939.92550.23880.03740.49231
164858867.8297833.8753902.05190.28670.05330.5190.9992
165817817.7811782.4715853.39830.48290.01340.56080.6038
166827820.7507783.492858.35080.37230.57750.67590.6569
167797783.3905744.8715822.29210.24650.0140.69970.0679
168843824.1965783.5507865.24730.18460.90290.70350.7035

\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[156]) \tabularnewline
144 & 802 & - & - & - & - & - & - & - \tabularnewline
145 & 828 & - & - & - & - & - & - & - \tabularnewline
146 & 778 & - & - & - & - & - & - & - \tabularnewline
147 & 889 & - & - & - & - & - & - & - \tabularnewline
148 & 902 & - & - & - & - & - & - & - \tabularnewline
149 & 969 & - & - & - & - & - & - & - \tabularnewline
150 & 947 & - & - & - & - & - & - & - \tabularnewline
151 & 908 & - & - & - & - & - & - & - \tabularnewline
152 & 867 & - & - & - & - & - & - & - \tabularnewline
153 & 815 & - & - & - & - & - & - & - \tabularnewline
154 & 812 & - & - & - & - & - & - & - \tabularnewline
155 & 773 & - & - & - & - & - & - & - \tabularnewline
156 & 813 & - & - & - & - & - & - & - \tabularnewline
157 & 834 & 836.8389 & 822.4209 & 851.3068 & 0.3503 & 0.9994 & 0.8844 & 0.9994 \tabularnewline
158 & 782 & 794.3325 & 776.1439 & 812.6047 & 0.0929 & 0 & 0.9601 & 0.0226 \tabularnewline
159 & 892 & 897.6417 & 875.9734 & 919.415 & 0.3058 & 1 & 0.7817 & 1 \tabularnewline
160 & 903 & 913.9569 & 888.8503 & 939.2022 & 0.1975 & 0.9559 & 0.8234 & 1 \tabularnewline
161 & 966 & 975.9919 & 948.2352 & 1003.9074 & 0.2415 & 1 & 0.6883 & 1 \tabularnewline
162 & 937 & 950.7655 & 920.4524 & 981.2733 & 0.1882 & 0.1639 & 0.5956 & 1 \tabularnewline
163 & 896 & 907.6813 & 875.6645 & 939.9255 & 0.2388 & 0.0374 & 0.4923 & 1 \tabularnewline
164 & 858 & 867.8297 & 833.8753 & 902.0519 & 0.2867 & 0.0533 & 0.519 & 0.9992 \tabularnewline
165 & 817 & 817.7811 & 782.4715 & 853.3983 & 0.4829 & 0.0134 & 0.5608 & 0.6038 \tabularnewline
166 & 827 & 820.7507 & 783.492 & 858.3508 & 0.3723 & 0.5775 & 0.6759 & 0.6569 \tabularnewline
167 & 797 & 783.3905 & 744.8715 & 822.2921 & 0.2465 & 0.014 & 0.6997 & 0.0679 \tabularnewline
168 & 843 & 824.1965 & 783.5507 & 865.2473 & 0.1846 & 0.9029 & 0.7035 & 0.7035 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=286471&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[156])[/C][/ROW]
[ROW][C]144[/C][C]802[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]145[/C][C]828[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]146[/C][C]778[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]147[/C][C]889[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]148[/C][C]902[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]149[/C][C]969[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]150[/C][C]947[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]151[/C][C]908[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]152[/C][C]867[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]153[/C][C]815[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]154[/C][C]812[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]155[/C][C]773[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]156[/C][C]813[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]157[/C][C]834[/C][C]836.8389[/C][C]822.4209[/C][C]851.3068[/C][C]0.3503[/C][C]0.9994[/C][C]0.8844[/C][C]0.9994[/C][/ROW]
[ROW][C]158[/C][C]782[/C][C]794.3325[/C][C]776.1439[/C][C]812.6047[/C][C]0.0929[/C][C]0[/C][C]0.9601[/C][C]0.0226[/C][/ROW]
[ROW][C]159[/C][C]892[/C][C]897.6417[/C][C]875.9734[/C][C]919.415[/C][C]0.3058[/C][C]1[/C][C]0.7817[/C][C]1[/C][/ROW]
[ROW][C]160[/C][C]903[/C][C]913.9569[/C][C]888.8503[/C][C]939.2022[/C][C]0.1975[/C][C]0.9559[/C][C]0.8234[/C][C]1[/C][/ROW]
[ROW][C]161[/C][C]966[/C][C]975.9919[/C][C]948.2352[/C][C]1003.9074[/C][C]0.2415[/C][C]1[/C][C]0.6883[/C][C]1[/C][/ROW]
[ROW][C]162[/C][C]937[/C][C]950.7655[/C][C]920.4524[/C][C]981.2733[/C][C]0.1882[/C][C]0.1639[/C][C]0.5956[/C][C]1[/C][/ROW]
[ROW][C]163[/C][C]896[/C][C]907.6813[/C][C]875.6645[/C][C]939.9255[/C][C]0.2388[/C][C]0.0374[/C][C]0.4923[/C][C]1[/C][/ROW]
[ROW][C]164[/C][C]858[/C][C]867.8297[/C][C]833.8753[/C][C]902.0519[/C][C]0.2867[/C][C]0.0533[/C][C]0.519[/C][C]0.9992[/C][/ROW]
[ROW][C]165[/C][C]817[/C][C]817.7811[/C][C]782.4715[/C][C]853.3983[/C][C]0.4829[/C][C]0.0134[/C][C]0.5608[/C][C]0.6038[/C][/ROW]
[ROW][C]166[/C][C]827[/C][C]820.7507[/C][C]783.492[/C][C]858.3508[/C][C]0.3723[/C][C]0.5775[/C][C]0.6759[/C][C]0.6569[/C][/ROW]
[ROW][C]167[/C][C]797[/C][C]783.3905[/C][C]744.8715[/C][C]822.2921[/C][C]0.2465[/C][C]0.014[/C][C]0.6997[/C][C]0.0679[/C][/ROW]
[ROW][C]168[/C][C]843[/C][C]824.1965[/C][C]783.5507[/C][C]865.2473[/C][C]0.1846[/C][C]0.9029[/C][C]0.7035[/C][C]0.7035[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=286471&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=286471&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[156])
144802-------
145828-------
146778-------
147889-------
148902-------
149969-------
150947-------
151908-------
152867-------
153815-------
154812-------
155773-------
156813-------
157834836.8389822.4209851.30680.35030.99940.88440.9994
158782794.3325776.1439812.60470.092900.96010.0226
159892897.6417875.9734919.4150.305810.78171
160903913.9569888.8503939.20220.19750.95590.82341
161966975.9919948.23521003.90740.241510.68831
162937950.7655920.4524981.27330.18820.16390.59561
163896907.6813875.6645939.92550.23880.03740.49231
164858867.8297833.8753902.05190.28670.05330.5190.9992
165817817.7811782.4715853.39830.48290.01340.56080.6038
166827820.7507783.492858.35080.37230.57750.67590.6569
167797783.3905744.8715822.29210.24650.0140.69970.0679
168843824.1965783.5507865.24730.18460.90290.70350.7035







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1570.0088-0.00340.00340.00348.059500-0.06630.0663
1580.0117-0.01580.00960.0095152.089780.07468.9484-0.2880.1772
1590.0124-0.00630.00850.008531.828363.99257.9995-0.13180.162
1600.0141-0.01210.00940.0094120.053878.00788.8322-0.25590.1855
1610.0146-0.01030.00960.009599.837782.37389.076-0.23340.1951
1620.0164-0.01470.01040.0104189.4898100.226510.0113-0.32150.2161
1630.0181-0.0130.01080.0107136.4516105.401510.2665-0.27280.2242
1640.0201-0.01150.01090.010896.623104.304210.2129-0.22960.2249
1650.0222-0.0010.00980.00970.610192.78269.6324-0.01820.2019
1660.02340.00760.00960.009539.054287.40989.34930.1460.1963
1670.02530.01710.01020.0102185.219396.30159.81330.31780.2074
1680.02540.02230.01130.0112353.5716117.740710.85080.43910.2267

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
157 & 0.0088 & -0.0034 & 0.0034 & 0.0034 & 8.0595 & 0 & 0 & -0.0663 & 0.0663 \tabularnewline
158 & 0.0117 & -0.0158 & 0.0096 & 0.0095 & 152.0897 & 80.0746 & 8.9484 & -0.288 & 0.1772 \tabularnewline
159 & 0.0124 & -0.0063 & 0.0085 & 0.0085 & 31.8283 & 63.9925 & 7.9995 & -0.1318 & 0.162 \tabularnewline
160 & 0.0141 & -0.0121 & 0.0094 & 0.0094 & 120.0538 & 78.0078 & 8.8322 & -0.2559 & 0.1855 \tabularnewline
161 & 0.0146 & -0.0103 & 0.0096 & 0.0095 & 99.8377 & 82.3738 & 9.076 & -0.2334 & 0.1951 \tabularnewline
162 & 0.0164 & -0.0147 & 0.0104 & 0.0104 & 189.4898 & 100.2265 & 10.0113 & -0.3215 & 0.2161 \tabularnewline
163 & 0.0181 & -0.013 & 0.0108 & 0.0107 & 136.4516 & 105.4015 & 10.2665 & -0.2728 & 0.2242 \tabularnewline
164 & 0.0201 & -0.0115 & 0.0109 & 0.0108 & 96.623 & 104.3042 & 10.2129 & -0.2296 & 0.2249 \tabularnewline
165 & 0.0222 & -0.001 & 0.0098 & 0.0097 & 0.6101 & 92.7826 & 9.6324 & -0.0182 & 0.2019 \tabularnewline
166 & 0.0234 & 0.0076 & 0.0096 & 0.0095 & 39.0542 & 87.4098 & 9.3493 & 0.146 & 0.1963 \tabularnewline
167 & 0.0253 & 0.0171 & 0.0102 & 0.0102 & 185.2193 & 96.3015 & 9.8133 & 0.3178 & 0.2074 \tabularnewline
168 & 0.0254 & 0.0223 & 0.0113 & 0.0112 & 353.5716 & 117.7407 & 10.8508 & 0.4391 & 0.2267 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=286471&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]157[/C][C]0.0088[/C][C]-0.0034[/C][C]0.0034[/C][C]0.0034[/C][C]8.0595[/C][C]0[/C][C]0[/C][C]-0.0663[/C][C]0.0663[/C][/ROW]
[ROW][C]158[/C][C]0.0117[/C][C]-0.0158[/C][C]0.0096[/C][C]0.0095[/C][C]152.0897[/C][C]80.0746[/C][C]8.9484[/C][C]-0.288[/C][C]0.1772[/C][/ROW]
[ROW][C]159[/C][C]0.0124[/C][C]-0.0063[/C][C]0.0085[/C][C]0.0085[/C][C]31.8283[/C][C]63.9925[/C][C]7.9995[/C][C]-0.1318[/C][C]0.162[/C][/ROW]
[ROW][C]160[/C][C]0.0141[/C][C]-0.0121[/C][C]0.0094[/C][C]0.0094[/C][C]120.0538[/C][C]78.0078[/C][C]8.8322[/C][C]-0.2559[/C][C]0.1855[/C][/ROW]
[ROW][C]161[/C][C]0.0146[/C][C]-0.0103[/C][C]0.0096[/C][C]0.0095[/C][C]99.8377[/C][C]82.3738[/C][C]9.076[/C][C]-0.2334[/C][C]0.1951[/C][/ROW]
[ROW][C]162[/C][C]0.0164[/C][C]-0.0147[/C][C]0.0104[/C][C]0.0104[/C][C]189.4898[/C][C]100.2265[/C][C]10.0113[/C][C]-0.3215[/C][C]0.2161[/C][/ROW]
[ROW][C]163[/C][C]0.0181[/C][C]-0.013[/C][C]0.0108[/C][C]0.0107[/C][C]136.4516[/C][C]105.4015[/C][C]10.2665[/C][C]-0.2728[/C][C]0.2242[/C][/ROW]
[ROW][C]164[/C][C]0.0201[/C][C]-0.0115[/C][C]0.0109[/C][C]0.0108[/C][C]96.623[/C][C]104.3042[/C][C]10.2129[/C][C]-0.2296[/C][C]0.2249[/C][/ROW]
[ROW][C]165[/C][C]0.0222[/C][C]-0.001[/C][C]0.0098[/C][C]0.0097[/C][C]0.6101[/C][C]92.7826[/C][C]9.6324[/C][C]-0.0182[/C][C]0.2019[/C][/ROW]
[ROW][C]166[/C][C]0.0234[/C][C]0.0076[/C][C]0.0096[/C][C]0.0095[/C][C]39.0542[/C][C]87.4098[/C][C]9.3493[/C][C]0.146[/C][C]0.1963[/C][/ROW]
[ROW][C]167[/C][C]0.0253[/C][C]0.0171[/C][C]0.0102[/C][C]0.0102[/C][C]185.2193[/C][C]96.3015[/C][C]9.8133[/C][C]0.3178[/C][C]0.2074[/C][/ROW]
[ROW][C]168[/C][C]0.0254[/C][C]0.0223[/C][C]0.0113[/C][C]0.0112[/C][C]353.5716[/C][C]117.7407[/C][C]10.8508[/C][C]0.4391[/C][C]0.2267[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=286471&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=286471&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1570.0088-0.00340.00340.00348.059500-0.06630.0663
1580.0117-0.01580.00960.0095152.089780.07468.9484-0.2880.1772
1590.0124-0.00630.00850.008531.828363.99257.9995-0.13180.162
1600.0141-0.01210.00940.0094120.053878.00788.8322-0.25590.1855
1610.0146-0.01030.00960.009599.837782.37389.076-0.23340.1951
1620.0164-0.01470.01040.0104189.4898100.226510.0113-0.32150.2161
1630.0181-0.0130.01080.0107136.4516105.401510.2665-0.27280.2242
1640.0201-0.01150.01090.010896.623104.304210.2129-0.22960.2249
1650.0222-0.0010.00980.00970.610192.78269.6324-0.01820.2019
1660.02340.00760.00960.009539.054287.40989.34930.1460.1963
1670.02530.01710.01020.0102185.219396.30159.81330.31780.2074
1680.02540.02230.01130.0112353.5716117.740710.85080.43910.2267



Parameters (Session):
par1 = 12 ; par2 = 0.8 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 0.8 ; par3 = 1 ; 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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')