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 computationFri, 16 Dec 2016 17:28:43 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/16/t14819057500v00xwamv8jd6jg.htm/, Retrieved Fri, 03 May 2024 02:56:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300427, Retrieved Fri, 03 May 2024 02:56:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact80
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [] [2016-12-16 13:36:55] [683f400e1b95307fc738e729f07c4fce]
-    D  [ARIMA Backward Selection] [] [2016-12-16 14:17:56] [683f400e1b95307fc738e729f07c4fce]
- R  D    [ARIMA Backward Selection] [] [2016-12-16 14:51:40] [683f400e1b95307fc738e729f07c4fce]
- RM D        [ARIMA Forecasting] [] [2016-12-16 16:28:43] [404ac5ee4f7301873f6a96ef36861981] [Current]
Feedback Forum

Post a new message
Dataseries X:
512
308
396
532
442
818
350
598
446
684
622
794
618
624
672
640
734
1042
760
682
1352
1196
1140
1134
1008
1262
842
890
792
1138
800
1212
1606
1686
1374
1670
1350
1056
1914
928
1296
966
1302
1822
1308
2030
2824
1342
1562
1278
2340
1826
1412
3068
1448
1202
2094
2408
2344
2386
3020
1990
2570
3664
2272
1596
3282
3870
3950
4292
3056
3170
3138
3232
3660
3310
2160
4444
2654
3226
5788
4288
4446
2778
3398
3896
2078
3230
2926
4746
2236
4306
3278
3498
2964
4184
3344
4152
2220
3520
2872
2900
1430
2730
3226
5472
4664
4566




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time7 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300427&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]7 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=300427&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300427&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R ServerBig Analytics Cloud Computing Center







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[98])
863896-------
872078-------
883230-------
892926-------
904746-------
912236-------
924306-------
933278-------
943498-------
952964-------
964184-------
973344-------
984152-------
9922203582.0192341.13234822.90560.01570.1840.99120.184
10035203955.46682713.57735197.35630.2460.99690.87390.3782
10128723252.5071985.75564519.25850.2780.33950.69330.082
10229004114.67572839.02635390.32510.0310.97190.1660.4771
10314303433.91612136.33564731.49660.00120.790.96480.139
10427304089.44952782.74885396.15010.020710.37270.4626
10532264217.62342890.11965545.12710.07160.9860.91730.5386
10654724564.17213227.44025900.9040.09160.97510.9410.7272
10746644149.43982792.88825505.99140.22860.0280.95660.4985
10845664151.30822785.73655516.87990.27590.23090.48130.4996

\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[98]) \tabularnewline
86 & 3896 & - & - & - & - & - & - & - \tabularnewline
87 & 2078 & - & - & - & - & - & - & - \tabularnewline
88 & 3230 & - & - & - & - & - & - & - \tabularnewline
89 & 2926 & - & - & - & - & - & - & - \tabularnewline
90 & 4746 & - & - & - & - & - & - & - \tabularnewline
91 & 2236 & - & - & - & - & - & - & - \tabularnewline
92 & 4306 & - & - & - & - & - & - & - \tabularnewline
93 & 3278 & - & - & - & - & - & - & - \tabularnewline
94 & 3498 & - & - & - & - & - & - & - \tabularnewline
95 & 2964 & - & - & - & - & - & - & - \tabularnewline
96 & 4184 & - & - & - & - & - & - & - \tabularnewline
97 & 3344 & - & - & - & - & - & - & - \tabularnewline
98 & 4152 & - & - & - & - & - & - & - \tabularnewline
99 & 2220 & 3582.019 & 2341.1323 & 4822.9056 & 0.0157 & 0.184 & 0.9912 & 0.184 \tabularnewline
100 & 3520 & 3955.4668 & 2713.5773 & 5197.3563 & 0.246 & 0.9969 & 0.8739 & 0.3782 \tabularnewline
101 & 2872 & 3252.507 & 1985.7556 & 4519.2585 & 0.278 & 0.3395 & 0.6933 & 0.082 \tabularnewline
102 & 2900 & 4114.6757 & 2839.0263 & 5390.3251 & 0.031 & 0.9719 & 0.166 & 0.4771 \tabularnewline
103 & 1430 & 3433.9161 & 2136.3356 & 4731.4966 & 0.0012 & 0.79 & 0.9648 & 0.139 \tabularnewline
104 & 2730 & 4089.4495 & 2782.7488 & 5396.1501 & 0.0207 & 1 & 0.3727 & 0.4626 \tabularnewline
105 & 3226 & 4217.6234 & 2890.1196 & 5545.1271 & 0.0716 & 0.986 & 0.9173 & 0.5386 \tabularnewline
106 & 5472 & 4564.1721 & 3227.4402 & 5900.904 & 0.0916 & 0.9751 & 0.941 & 0.7272 \tabularnewline
107 & 4664 & 4149.4398 & 2792.8882 & 5505.9914 & 0.2286 & 0.028 & 0.9566 & 0.4985 \tabularnewline
108 & 4566 & 4151.3082 & 2785.7365 & 5516.8799 & 0.2759 & 0.2309 & 0.4813 & 0.4996 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300427&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[98])[/C][/ROW]
[ROW][C]86[/C][C]3896[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]2078[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]3230[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]2926[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]4746[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]2236[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]4306[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]3278[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]3498[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]2964[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]4184[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]3344[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]4152[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]2220[/C][C]3582.019[/C][C]2341.1323[/C][C]4822.9056[/C][C]0.0157[/C][C]0.184[/C][C]0.9912[/C][C]0.184[/C][/ROW]
[ROW][C]100[/C][C]3520[/C][C]3955.4668[/C][C]2713.5773[/C][C]5197.3563[/C][C]0.246[/C][C]0.9969[/C][C]0.8739[/C][C]0.3782[/C][/ROW]
[ROW][C]101[/C][C]2872[/C][C]3252.507[/C][C]1985.7556[/C][C]4519.2585[/C][C]0.278[/C][C]0.3395[/C][C]0.6933[/C][C]0.082[/C][/ROW]
[ROW][C]102[/C][C]2900[/C][C]4114.6757[/C][C]2839.0263[/C][C]5390.3251[/C][C]0.031[/C][C]0.9719[/C][C]0.166[/C][C]0.4771[/C][/ROW]
[ROW][C]103[/C][C]1430[/C][C]3433.9161[/C][C]2136.3356[/C][C]4731.4966[/C][C]0.0012[/C][C]0.79[/C][C]0.9648[/C][C]0.139[/C][/ROW]
[ROW][C]104[/C][C]2730[/C][C]4089.4495[/C][C]2782.7488[/C][C]5396.1501[/C][C]0.0207[/C][C]1[/C][C]0.3727[/C][C]0.4626[/C][/ROW]
[ROW][C]105[/C][C]3226[/C][C]4217.6234[/C][C]2890.1196[/C][C]5545.1271[/C][C]0.0716[/C][C]0.986[/C][C]0.9173[/C][C]0.5386[/C][/ROW]
[ROW][C]106[/C][C]5472[/C][C]4564.1721[/C][C]3227.4402[/C][C]5900.904[/C][C]0.0916[/C][C]0.9751[/C][C]0.941[/C][C]0.7272[/C][/ROW]
[ROW][C]107[/C][C]4664[/C][C]4149.4398[/C][C]2792.8882[/C][C]5505.9914[/C][C]0.2286[/C][C]0.028[/C][C]0.9566[/C][C]0.4985[/C][/ROW]
[ROW][C]108[/C][C]4566[/C][C]4151.3082[/C][C]2785.7365[/C][C]5516.8799[/C][C]0.2759[/C][C]0.2309[/C][C]0.4813[/C][C]0.4996[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300427&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300427&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[98])
863896-------
872078-------
883230-------
892926-------
904746-------
912236-------
924306-------
933278-------
943498-------
952964-------
964184-------
973344-------
984152-------
9922203582.0192341.13234822.90560.01570.1840.99120.184
10035203955.46682713.57735197.35630.2460.99690.87390.3782
10128723252.5071985.75564519.25850.2780.33950.69330.082
10229004114.67572839.02635390.32510.0310.97190.1660.4771
10314303433.91612136.33564731.49660.00120.790.96480.139
10427304089.44952782.74885396.15010.020710.37270.4626
10532264217.62342890.11965545.12710.07160.9860.91730.5386
10654724564.17213227.44025900.9040.09160.97510.9410.7272
10746644149.43982792.88825505.99140.22860.0280.95660.4985
10845664151.30822785.73655516.87990.27590.23090.48130.4996







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
990.1767-0.61350.61350.46951855095.654400-1.46031.4603
1000.1602-0.12370.36860.293189631.33591022363.49521011.1199-0.46690.9636
1010.1987-0.13250.28990.2368144785.6096729837.5333854.3053-0.4080.7784
1020.1582-0.41890.32210.26411475437.0268916237.4067957.2029-1.30240.9094
1030.1928-1.40130.5380.37614015679.81661536125.88871239.4055-2.14861.1572
1040.163-0.4980.53130.37991848102.82391588122.04451260.2071-1.45761.2073
1050.1606-0.30740.49930.3637983316.90261501721.311225.4474-1.06321.1867
1060.14940.16590.45760.3408824151.47611417025.08071190.38860.97341.16
1070.16680.11030.41910.3159264772.19561288996.98241135.340.55171.0925
1080.16780.09080.38620.2939171969.32781177294.21691085.03190.44461.0277

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
99 & 0.1767 & -0.6135 & 0.6135 & 0.4695 & 1855095.6544 & 0 & 0 & -1.4603 & 1.4603 \tabularnewline
100 & 0.1602 & -0.1237 & 0.3686 & 0.293 & 189631.3359 & 1022363.4952 & 1011.1199 & -0.4669 & 0.9636 \tabularnewline
101 & 0.1987 & -0.1325 & 0.2899 & 0.2368 & 144785.6096 & 729837.5333 & 854.3053 & -0.408 & 0.7784 \tabularnewline
102 & 0.1582 & -0.4189 & 0.3221 & 0.2641 & 1475437.0268 & 916237.4067 & 957.2029 & -1.3024 & 0.9094 \tabularnewline
103 & 0.1928 & -1.4013 & 0.538 & 0.3761 & 4015679.8166 & 1536125.8887 & 1239.4055 & -2.1486 & 1.1572 \tabularnewline
104 & 0.163 & -0.498 & 0.5313 & 0.3799 & 1848102.8239 & 1588122.0445 & 1260.2071 & -1.4576 & 1.2073 \tabularnewline
105 & 0.1606 & -0.3074 & 0.4993 & 0.3637 & 983316.9026 & 1501721.31 & 1225.4474 & -1.0632 & 1.1867 \tabularnewline
106 & 0.1494 & 0.1659 & 0.4576 & 0.3408 & 824151.4761 & 1417025.0807 & 1190.3886 & 0.9734 & 1.16 \tabularnewline
107 & 0.1668 & 0.1103 & 0.4191 & 0.3159 & 264772.1956 & 1288996.9824 & 1135.34 & 0.5517 & 1.0925 \tabularnewline
108 & 0.1678 & 0.0908 & 0.3862 & 0.2939 & 171969.3278 & 1177294.2169 & 1085.0319 & 0.4446 & 1.0277 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300427&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]99[/C][C]0.1767[/C][C]-0.6135[/C][C]0.6135[/C][C]0.4695[/C][C]1855095.6544[/C][C]0[/C][C]0[/C][C]-1.4603[/C][C]1.4603[/C][/ROW]
[ROW][C]100[/C][C]0.1602[/C][C]-0.1237[/C][C]0.3686[/C][C]0.293[/C][C]189631.3359[/C][C]1022363.4952[/C][C]1011.1199[/C][C]-0.4669[/C][C]0.9636[/C][/ROW]
[ROW][C]101[/C][C]0.1987[/C][C]-0.1325[/C][C]0.2899[/C][C]0.2368[/C][C]144785.6096[/C][C]729837.5333[/C][C]854.3053[/C][C]-0.408[/C][C]0.7784[/C][/ROW]
[ROW][C]102[/C][C]0.1582[/C][C]-0.4189[/C][C]0.3221[/C][C]0.2641[/C][C]1475437.0268[/C][C]916237.4067[/C][C]957.2029[/C][C]-1.3024[/C][C]0.9094[/C][/ROW]
[ROW][C]103[/C][C]0.1928[/C][C]-1.4013[/C][C]0.538[/C][C]0.3761[/C][C]4015679.8166[/C][C]1536125.8887[/C][C]1239.4055[/C][C]-2.1486[/C][C]1.1572[/C][/ROW]
[ROW][C]104[/C][C]0.163[/C][C]-0.498[/C][C]0.5313[/C][C]0.3799[/C][C]1848102.8239[/C][C]1588122.0445[/C][C]1260.2071[/C][C]-1.4576[/C][C]1.2073[/C][/ROW]
[ROW][C]105[/C][C]0.1606[/C][C]-0.3074[/C][C]0.4993[/C][C]0.3637[/C][C]983316.9026[/C][C]1501721.31[/C][C]1225.4474[/C][C]-1.0632[/C][C]1.1867[/C][/ROW]
[ROW][C]106[/C][C]0.1494[/C][C]0.1659[/C][C]0.4576[/C][C]0.3408[/C][C]824151.4761[/C][C]1417025.0807[/C][C]1190.3886[/C][C]0.9734[/C][C]1.16[/C][/ROW]
[ROW][C]107[/C][C]0.1668[/C][C]0.1103[/C][C]0.4191[/C][C]0.3159[/C][C]264772.1956[/C][C]1288996.9824[/C][C]1135.34[/C][C]0.5517[/C][C]1.0925[/C][/ROW]
[ROW][C]108[/C][C]0.1678[/C][C]0.0908[/C][C]0.3862[/C][C]0.2939[/C][C]171969.3278[/C][C]1177294.2169[/C][C]1085.0319[/C][C]0.4446[/C][C]1.0277[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300427&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300427&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
990.1767-0.61350.61350.46951855095.654400-1.46031.4603
1000.1602-0.12370.36860.293189631.33591022363.49521011.1199-0.46690.9636
1010.1987-0.13250.28990.2368144785.6096729837.5333854.3053-0.4080.7784
1020.1582-0.41890.32210.26411475437.0268916237.4067957.2029-1.30240.9094
1030.1928-1.40130.5380.37614015679.81661536125.88871239.4055-2.14861.1572
1040.163-0.4980.53130.37991848102.82391588122.04451260.2071-1.45761.2073
1050.1606-0.30740.49930.3637983316.90261501721.311225.4474-1.06321.1867
1060.14940.16590.45760.3408824151.47611417025.08071190.38860.97341.16
1070.16680.11030.41910.3159264772.19561288996.98241135.340.55171.0925
1080.16780.09080.38620.2939171969.32781177294.21691085.03190.44461.0277



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