Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSat, 08 Dec 2007 06:15:48 -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/2007/Dec/08/t1197118994os1i67g55it0pbv.htm/, Retrieved Mon, 29 Apr 2024 03:16:02 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2920, Retrieved Mon, 29 Apr 2024 03:16:02 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsQ1
Estimated Impact268
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Extrapolation for...] [2007-12-08 13:15:48] [c8ae83d0115975332f4c8aef1088e2d8] [Current]
-    D    [ARIMA Forecasting] [TEST] [2008-12-08 19:15:58] [547636b63517c1c2916a747d66b36ebf]
Feedback Forum

Post a new message
Dataseries X:
15859,4
15258,9
15498,6
15106,5
15023,6
12083,0
15761,3
16942,6
15070,3
13659,6
14768,9
14725,1
15998,1
15370,6
14956,9
15469,7
15101,8
11703,7
16283,6
16726,5
14968,9
14861,0
14583,3
15305,8
17903,9
16379,4
15420,3
17870,5
15912,8
13866,5
17823,2
17872,0
17422,0
16704,5
15991,2
16583,6
19123,5
17838,7
17209,4
18586,5
16258,1
15141,6
19202,1
17746,5
19090,1
18040,3
17515,5
17751,8
21072,4
17170,0
19439,5
19795,4
17574,9
16165,4
19464,6
19932,1
19961,2
17343,4
18924,2
18574,1
21350,6




Summary of compuational 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 compuational 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=2920&T=0

[TABLE]
[ROW][C]Summary of compuational 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=2920&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2920&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 compuational 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[49])
3719123.5-------
3817838.7-------
3917209.4000000000-------
4018586.5-------
4116258.1-------
4215141.6-------
4319202.1-------
4417746.5-------
4519090.1-------
4618040.3-------
4717515.5-------
4817751.8-------
4921072.4-------
501717019316.320717938.67620799.76510.00230.01020.97450.0102
5119439.518494.472617169.715819921.44310.09710.96560.96122e-04
5219795.420207.928718712.51121822.85330.30830.82450.97550.147
5317574.917483.361515979.754619128.44950.45660.00290.92780
5416165.416242.83914830.81817789.29650.46090.04570.91860
5519464.620674.96918815.621222718.05640.122810.92120.3515
5619932.118980.967317177.758920973.46480.17470.31710.88770.0198
5719961.220395.433618430.253322570.1570.34780.66190.88030.2709
5817343.419280.278917371.990321398.19020.03650.26430.87440.0486
5918924.218642.479116744.168220756.00440.39690.88580.8520.0121
6018574.118876.063716926.267621050.46370.39270.48270.84460.0239
6121350.622385.601920026.691525022.36430.22080.99770.83550.8355

\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[49]) \tabularnewline
37 & 19123.5 & - & - & - & - & - & - & - \tabularnewline
38 & 17838.7 & - & - & - & - & - & - & - \tabularnewline
39 & 17209.4000000000 & - & - & - & - & - & - & - \tabularnewline
40 & 18586.5 & - & - & - & - & - & - & - \tabularnewline
41 & 16258.1 & - & - & - & - & - & - & - \tabularnewline
42 & 15141.6 & - & - & - & - & - & - & - \tabularnewline
43 & 19202.1 & - & - & - & - & - & - & - \tabularnewline
44 & 17746.5 & - & - & - & - & - & - & - \tabularnewline
45 & 19090.1 & - & - & - & - & - & - & - \tabularnewline
46 & 18040.3 & - & - & - & - & - & - & - \tabularnewline
47 & 17515.5 & - & - & - & - & - & - & - \tabularnewline
48 & 17751.8 & - & - & - & - & - & - & - \tabularnewline
49 & 21072.4 & - & - & - & - & - & - & - \tabularnewline
50 & 17170 & 19316.3207 & 17938.676 & 20799.7651 & 0.0023 & 0.0102 & 0.9745 & 0.0102 \tabularnewline
51 & 19439.5 & 18494.4726 & 17169.7158 & 19921.4431 & 0.0971 & 0.9656 & 0.9612 & 2e-04 \tabularnewline
52 & 19795.4 & 20207.9287 & 18712.511 & 21822.8533 & 0.3083 & 0.8245 & 0.9755 & 0.147 \tabularnewline
53 & 17574.9 & 17483.3615 & 15979.7546 & 19128.4495 & 0.4566 & 0.0029 & 0.9278 & 0 \tabularnewline
54 & 16165.4 & 16242.839 & 14830.818 & 17789.2965 & 0.4609 & 0.0457 & 0.9186 & 0 \tabularnewline
55 & 19464.6 & 20674.969 & 18815.6212 & 22718.0564 & 0.1228 & 1 & 0.9212 & 0.3515 \tabularnewline
56 & 19932.1 & 18980.9673 & 17177.7589 & 20973.4648 & 0.1747 & 0.3171 & 0.8877 & 0.0198 \tabularnewline
57 & 19961.2 & 20395.4336 & 18430.2533 & 22570.157 & 0.3478 & 0.6619 & 0.8803 & 0.2709 \tabularnewline
58 & 17343.4 & 19280.2789 & 17371.9903 & 21398.1902 & 0.0365 & 0.2643 & 0.8744 & 0.0486 \tabularnewline
59 & 18924.2 & 18642.4791 & 16744.1682 & 20756.0044 & 0.3969 & 0.8858 & 0.852 & 0.0121 \tabularnewline
60 & 18574.1 & 18876.0637 & 16926.2676 & 21050.4637 & 0.3927 & 0.4827 & 0.8446 & 0.0239 \tabularnewline
61 & 21350.6 & 22385.6019 & 20026.6915 & 25022.3643 & 0.2208 & 0.9977 & 0.8355 & 0.8355 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2920&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[49])[/C][/ROW]
[ROW][C]37[/C][C]19123.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]17838.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]17209.4000000000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]18586.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]16258.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]15141.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]19202.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]17746.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]19090.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]18040.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]17515.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]17751.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]21072.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]17170[/C][C]19316.3207[/C][C]17938.676[/C][C]20799.7651[/C][C]0.0023[/C][C]0.0102[/C][C]0.9745[/C][C]0.0102[/C][/ROW]
[ROW][C]51[/C][C]19439.5[/C][C]18494.4726[/C][C]17169.7158[/C][C]19921.4431[/C][C]0.0971[/C][C]0.9656[/C][C]0.9612[/C][C]2e-04[/C][/ROW]
[ROW][C]52[/C][C]19795.4[/C][C]20207.9287[/C][C]18712.511[/C][C]21822.8533[/C][C]0.3083[/C][C]0.8245[/C][C]0.9755[/C][C]0.147[/C][/ROW]
[ROW][C]53[/C][C]17574.9[/C][C]17483.3615[/C][C]15979.7546[/C][C]19128.4495[/C][C]0.4566[/C][C]0.0029[/C][C]0.9278[/C][C]0[/C][/ROW]
[ROW][C]54[/C][C]16165.4[/C][C]16242.839[/C][C]14830.818[/C][C]17789.2965[/C][C]0.4609[/C][C]0.0457[/C][C]0.9186[/C][C]0[/C][/ROW]
[ROW][C]55[/C][C]19464.6[/C][C]20674.969[/C][C]18815.6212[/C][C]22718.0564[/C][C]0.1228[/C][C]1[/C][C]0.9212[/C][C]0.3515[/C][/ROW]
[ROW][C]56[/C][C]19932.1[/C][C]18980.9673[/C][C]17177.7589[/C][C]20973.4648[/C][C]0.1747[/C][C]0.3171[/C][C]0.8877[/C][C]0.0198[/C][/ROW]
[ROW][C]57[/C][C]19961.2[/C][C]20395.4336[/C][C]18430.2533[/C][C]22570.157[/C][C]0.3478[/C][C]0.6619[/C][C]0.8803[/C][C]0.2709[/C][/ROW]
[ROW][C]58[/C][C]17343.4[/C][C]19280.2789[/C][C]17371.9903[/C][C]21398.1902[/C][C]0.0365[/C][C]0.2643[/C][C]0.8744[/C][C]0.0486[/C][/ROW]
[ROW][C]59[/C][C]18924.2[/C][C]18642.4791[/C][C]16744.1682[/C][C]20756.0044[/C][C]0.3969[/C][C]0.8858[/C][C]0.852[/C][C]0.0121[/C][/ROW]
[ROW][C]60[/C][C]18574.1[/C][C]18876.0637[/C][C]16926.2676[/C][C]21050.4637[/C][C]0.3927[/C][C]0.4827[/C][C]0.8446[/C][C]0.0239[/C][/ROW]
[ROW][C]61[/C][C]21350.6[/C][C]22385.6019[/C][C]20026.6915[/C][C]25022.3643[/C][C]0.2208[/C][C]0.9977[/C][C]0.8355[/C][C]0.8355[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2920&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2920&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[49])
3719123.5-------
3817838.7-------
3917209.4000000000-------
4018586.5-------
4116258.1-------
4215141.6-------
4319202.1-------
4417746.5-------
4519090.1-------
4618040.3-------
4717515.5-------
4817751.8-------
4921072.4-------
501717019316.320717938.67620799.76510.00230.01020.97450.0102
5119439.518494.472617169.715819921.44310.09710.96560.96122e-04
5219795.420207.928718712.51121822.85330.30830.82450.97550.147
5317574.917483.361515979.754619128.44950.45660.00290.92780
5416165.416242.83914830.81817789.29650.46090.04570.91860
5519464.620674.96918815.621222718.05640.122810.92120.3515
5619932.118980.967317177.758920973.46480.17470.31710.88770.0198
5719961.220395.433618430.253322570.1570.34780.66190.88030.2709
5817343.419280.278917371.990321398.19020.03650.26430.87440.0486
5918924.218642.479116744.168220756.00440.39690.88580.8520.0121
6018574.118876.063716926.267621050.46370.39270.48270.84460.0239
6121350.622385.601920026.691525022.36430.22080.99770.83550.8355







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0392-0.11110.00934606692.7118383891.0593619.5894
510.03940.05110.0043893076.838374423.0699272.8059
520.0408-0.02040.0017170179.934314181.6612119.0868
530.0480.00524e-048379.2931698.274426.4249
540.0486-0.00484e-045996.7986499.733222.3547
550.0504-0.05850.00491464993.1495122082.7625349.4034
560.05360.05010.0042904653.325775387.7771274.5683
570.0544-0.02130.0018188558.809215713.2341125.3524
580.056-0.10050.00843751499.7172312624.9764559.1288
590.05780.01510.001379366.65016613.887581.3258
600.0588-0.0160.001391182.08137598.506887.1694
610.0601-0.04620.00391071228.922889269.0769298.7793

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0392 & -0.1111 & 0.0093 & 4606692.7118 & 383891.0593 & 619.5894 \tabularnewline
51 & 0.0394 & 0.0511 & 0.0043 & 893076.8383 & 74423.0699 & 272.8059 \tabularnewline
52 & 0.0408 & -0.0204 & 0.0017 & 170179.9343 & 14181.6612 & 119.0868 \tabularnewline
53 & 0.048 & 0.0052 & 4e-04 & 8379.2931 & 698.2744 & 26.4249 \tabularnewline
54 & 0.0486 & -0.0048 & 4e-04 & 5996.7986 & 499.7332 & 22.3547 \tabularnewline
55 & 0.0504 & -0.0585 & 0.0049 & 1464993.1495 & 122082.7625 & 349.4034 \tabularnewline
56 & 0.0536 & 0.0501 & 0.0042 & 904653.3257 & 75387.7771 & 274.5683 \tabularnewline
57 & 0.0544 & -0.0213 & 0.0018 & 188558.8092 & 15713.2341 & 125.3524 \tabularnewline
58 & 0.056 & -0.1005 & 0.0084 & 3751499.7172 & 312624.9764 & 559.1288 \tabularnewline
59 & 0.0578 & 0.0151 & 0.0013 & 79366.6501 & 6613.8875 & 81.3258 \tabularnewline
60 & 0.0588 & -0.016 & 0.0013 & 91182.0813 & 7598.5068 & 87.1694 \tabularnewline
61 & 0.0601 & -0.0462 & 0.0039 & 1071228.9228 & 89269.0769 & 298.7793 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2920&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]50[/C][C]0.0392[/C][C]-0.1111[/C][C]0.0093[/C][C]4606692.7118[/C][C]383891.0593[/C][C]619.5894[/C][/ROW]
[ROW][C]51[/C][C]0.0394[/C][C]0.0511[/C][C]0.0043[/C][C]893076.8383[/C][C]74423.0699[/C][C]272.8059[/C][/ROW]
[ROW][C]52[/C][C]0.0408[/C][C]-0.0204[/C][C]0.0017[/C][C]170179.9343[/C][C]14181.6612[/C][C]119.0868[/C][/ROW]
[ROW][C]53[/C][C]0.048[/C][C]0.0052[/C][C]4e-04[/C][C]8379.2931[/C][C]698.2744[/C][C]26.4249[/C][/ROW]
[ROW][C]54[/C][C]0.0486[/C][C]-0.0048[/C][C]4e-04[/C][C]5996.7986[/C][C]499.7332[/C][C]22.3547[/C][/ROW]
[ROW][C]55[/C][C]0.0504[/C][C]-0.0585[/C][C]0.0049[/C][C]1464993.1495[/C][C]122082.7625[/C][C]349.4034[/C][/ROW]
[ROW][C]56[/C][C]0.0536[/C][C]0.0501[/C][C]0.0042[/C][C]904653.3257[/C][C]75387.7771[/C][C]274.5683[/C][/ROW]
[ROW][C]57[/C][C]0.0544[/C][C]-0.0213[/C][C]0.0018[/C][C]188558.8092[/C][C]15713.2341[/C][C]125.3524[/C][/ROW]
[ROW][C]58[/C][C]0.056[/C][C]-0.1005[/C][C]0.0084[/C][C]3751499.7172[/C][C]312624.9764[/C][C]559.1288[/C][/ROW]
[ROW][C]59[/C][C]0.0578[/C][C]0.0151[/C][C]0.0013[/C][C]79366.6501[/C][C]6613.8875[/C][C]81.3258[/C][/ROW]
[ROW][C]60[/C][C]0.0588[/C][C]-0.016[/C][C]0.0013[/C][C]91182.0813[/C][C]7598.5068[/C][C]87.1694[/C][/ROW]
[ROW][C]61[/C][C]0.0601[/C][C]-0.0462[/C][C]0.0039[/C][C]1071228.9228[/C][C]89269.0769[/C][C]298.7793[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2920&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2920&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
500.0392-0.11110.00934606692.7118383891.0593619.5894
510.03940.05110.0043893076.838374423.0699272.8059
520.0408-0.02040.0017170179.934314181.6612119.0868
530.0480.00524e-048379.2931698.274426.4249
540.0486-0.00484e-045996.7986499.733222.3547
550.0504-0.05850.00491464993.1495122082.7625349.4034
560.05360.05010.0042904653.325775387.7771274.5683
570.0544-0.02130.0018188558.809215713.2341125.3524
580.056-0.10050.00843751499.7172312624.9764559.1288
590.05780.01510.001379366.65016613.887581.3258
600.0588-0.0160.001391182.08137598.506887.1694
610.0601-0.04620.00391071228.922889269.0769298.7793



Parameters (Session):
par1 = 12 ; par2 = 0.0 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; 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,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)
}
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')