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, 04 Dec 2009 08:42:20 -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/2009/Dec/04/t125994182149hh80kcnc1zj0e.htm/, Retrieved Sat, 27 Apr 2024 14:09:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=63798, Retrieved Sat, 27 Apr 2024 14:09:30 +0000
QR Codes:

Original text written by user:ARIMA Forecasting
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact207
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Shw10: ARIMA Fore...] [2009-12-04 15:42:20] [7a39e26d7a09dd77604df90cb29f8d39] [Current]
-    D    [ARIMA Forecasting] [Shw10: Forecastin...] [2009-12-05 10:55:15] [3c8b83428ce260cd44df892bb7619588]
-   P       [ARIMA Forecasting] [Shw10: Forecastin...] [2009-12-10 18:08:29] [1433a524809eda02c3198b3ae6eebb69]
- R         [ARIMA Forecasting] [WS10 - ARIMA fore...] [2009-12-14 21:54:30] [df6326eec97a6ca984a853b142930499]
-   PD      [ARIMA Forecasting] [arima forecasting] [2009-12-28 20:48:56] [b5ba85a7ae9f50cb97d92cbc56161b32]
-   PD        [ARIMA Forecasting] [arima forecasting] [2009-12-29 15:27:01] [b5ba85a7ae9f50cb97d92cbc56161b32]
-   PD    [ARIMA Forecasting] [WS 10: arima forc...] [2009-12-05 13:03:21] [f924a0adda9c1905a1ba8f1c751261ff]
-   P       [ARIMA Forecasting] [xt arima forecast] [2009-12-10 12:28:32] [f924a0adda9c1905a1ba8f1c751261ff]
- R PD        [ARIMA Forecasting] [] [2009-12-11 15:23:11] [2c5be225250d91402426bbbf07a5e2b3]
Feedback Forum

Post a new message
Dataseries X:
0.7461
0.7775
0.7790
0.7744
0.7905
0.7719
0.7811
0.7557
0.7637
0.7595
0.7471
0.7615
0.7487
0.7389
0.7337
0.7510
0.7382
0.7159
0.7542
0.7636
0.7433
0.7658
0.7627
0.7480
0.7692
0.7850
0.7913
0.7720
0.7880
0.8070
0.8268
0.8244
0.8487
0.8572
0.8214
0.8827
0.9216
0.8865
0.8816
0.8884
0.9466
0.9180
0.9337
0.9559
0.9626
0.9434
0.8639
0.7996
0.6680
0.6572
0.6928
0.6438
0.6454
0.6873
0.7265
0.7912
0.8114
0.8281
0.8393




Summary of computational 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 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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=63798&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=63798&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63798&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'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[47])
350.8214-------
360.8827-------
370.9216-------
380.8865-------
390.8816-------
400.8884-------
410.9466-------
420.918-------
430.9337-------
440.9559-------
450.9626-------
460.9434-------
470.8639-------
480.79960.88340.83520.93173e-040.78610.51160.7861
490.6680.88760.82670.948400.99770.13650.7773
500.65720.88850.81840.9585010.5220.7542
510.69280.88870.81070.9666010.57050.7333
520.64380.88870.80370.9737010.50280.7162
530.64540.88870.79710.9803010.10770.7023
540.68730.88870.7910.9864010.27840.6907
550.72650.88870.78530.99220.00110.99990.1970.6808
560.79120.88870.77980.99760.03960.99820.11330.6724
570.81140.88870.77461.00280.09210.9530.10220.665
580.82810.88870.76961.00780.15920.89840.1840.6585
590.83930.88870.76491.01250.21710.83130.65270.6527

\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[47]) \tabularnewline
35 & 0.8214 & - & - & - & - & - & - & - \tabularnewline
36 & 0.8827 & - & - & - & - & - & - & - \tabularnewline
37 & 0.9216 & - & - & - & - & - & - & - \tabularnewline
38 & 0.8865 & - & - & - & - & - & - & - \tabularnewline
39 & 0.8816 & - & - & - & - & - & - & - \tabularnewline
40 & 0.8884 & - & - & - & - & - & - & - \tabularnewline
41 & 0.9466 & - & - & - & - & - & - & - \tabularnewline
42 & 0.918 & - & - & - & - & - & - & - \tabularnewline
43 & 0.9337 & - & - & - & - & - & - & - \tabularnewline
44 & 0.9559 & - & - & - & - & - & - & - \tabularnewline
45 & 0.9626 & - & - & - & - & - & - & - \tabularnewline
46 & 0.9434 & - & - & - & - & - & - & - \tabularnewline
47 & 0.8639 & - & - & - & - & - & - & - \tabularnewline
48 & 0.7996 & 0.8834 & 0.8352 & 0.9317 & 3e-04 & 0.7861 & 0.5116 & 0.7861 \tabularnewline
49 & 0.668 & 0.8876 & 0.8267 & 0.9484 & 0 & 0.9977 & 0.1365 & 0.7773 \tabularnewline
50 & 0.6572 & 0.8885 & 0.8184 & 0.9585 & 0 & 1 & 0.522 & 0.7542 \tabularnewline
51 & 0.6928 & 0.8887 & 0.8107 & 0.9666 & 0 & 1 & 0.5705 & 0.7333 \tabularnewline
52 & 0.6438 & 0.8887 & 0.8037 & 0.9737 & 0 & 1 & 0.5028 & 0.7162 \tabularnewline
53 & 0.6454 & 0.8887 & 0.7971 & 0.9803 & 0 & 1 & 0.1077 & 0.7023 \tabularnewline
54 & 0.6873 & 0.8887 & 0.791 & 0.9864 & 0 & 1 & 0.2784 & 0.6907 \tabularnewline
55 & 0.7265 & 0.8887 & 0.7853 & 0.9922 & 0.0011 & 0.9999 & 0.197 & 0.6808 \tabularnewline
56 & 0.7912 & 0.8887 & 0.7798 & 0.9976 & 0.0396 & 0.9982 & 0.1133 & 0.6724 \tabularnewline
57 & 0.8114 & 0.8887 & 0.7746 & 1.0028 & 0.0921 & 0.953 & 0.1022 & 0.665 \tabularnewline
58 & 0.8281 & 0.8887 & 0.7696 & 1.0078 & 0.1592 & 0.8984 & 0.184 & 0.6585 \tabularnewline
59 & 0.8393 & 0.8887 & 0.7649 & 1.0125 & 0.2171 & 0.8313 & 0.6527 & 0.6527 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=63798&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[47])[/C][/ROW]
[ROW][C]35[/C][C]0.8214[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]0.8827[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]0.9216[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]0.8865[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]0.8816[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]0.8884[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]0.9466[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]0.918[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]0.9337[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]0.9559[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]0.9626[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]0.9434[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]0.8639[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]0.7996[/C][C]0.8834[/C][C]0.8352[/C][C]0.9317[/C][C]3e-04[/C][C]0.7861[/C][C]0.5116[/C][C]0.7861[/C][/ROW]
[ROW][C]49[/C][C]0.668[/C][C]0.8876[/C][C]0.8267[/C][C]0.9484[/C][C]0[/C][C]0.9977[/C][C]0.1365[/C][C]0.7773[/C][/ROW]
[ROW][C]50[/C][C]0.6572[/C][C]0.8885[/C][C]0.8184[/C][C]0.9585[/C][C]0[/C][C]1[/C][C]0.522[/C][C]0.7542[/C][/ROW]
[ROW][C]51[/C][C]0.6928[/C][C]0.8887[/C][C]0.8107[/C][C]0.9666[/C][C]0[/C][C]1[/C][C]0.5705[/C][C]0.7333[/C][/ROW]
[ROW][C]52[/C][C]0.6438[/C][C]0.8887[/C][C]0.8037[/C][C]0.9737[/C][C]0[/C][C]1[/C][C]0.5028[/C][C]0.7162[/C][/ROW]
[ROW][C]53[/C][C]0.6454[/C][C]0.8887[/C][C]0.7971[/C][C]0.9803[/C][C]0[/C][C]1[/C][C]0.1077[/C][C]0.7023[/C][/ROW]
[ROW][C]54[/C][C]0.6873[/C][C]0.8887[/C][C]0.791[/C][C]0.9864[/C][C]0[/C][C]1[/C][C]0.2784[/C][C]0.6907[/C][/ROW]
[ROW][C]55[/C][C]0.7265[/C][C]0.8887[/C][C]0.7853[/C][C]0.9922[/C][C]0.0011[/C][C]0.9999[/C][C]0.197[/C][C]0.6808[/C][/ROW]
[ROW][C]56[/C][C]0.7912[/C][C]0.8887[/C][C]0.7798[/C][C]0.9976[/C][C]0.0396[/C][C]0.9982[/C][C]0.1133[/C][C]0.6724[/C][/ROW]
[ROW][C]57[/C][C]0.8114[/C][C]0.8887[/C][C]0.7746[/C][C]1.0028[/C][C]0.0921[/C][C]0.953[/C][C]0.1022[/C][C]0.665[/C][/ROW]
[ROW][C]58[/C][C]0.8281[/C][C]0.8887[/C][C]0.7696[/C][C]1.0078[/C][C]0.1592[/C][C]0.8984[/C][C]0.184[/C][C]0.6585[/C][/ROW]
[ROW][C]59[/C][C]0.8393[/C][C]0.8887[/C][C]0.7649[/C][C]1.0125[/C][C]0.2171[/C][C]0.8313[/C][C]0.6527[/C][C]0.6527[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=63798&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63798&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[47])
350.8214-------
360.8827-------
370.9216-------
380.8865-------
390.8816-------
400.8884-------
410.9466-------
420.918-------
430.9337-------
440.9559-------
450.9626-------
460.9434-------
470.8639-------
480.79960.88340.83520.93173e-040.78610.51160.7861
490.6680.88760.82670.948400.99770.13650.7773
500.65720.88850.81840.9585010.5220.7542
510.69280.88870.81070.9666010.57050.7333
520.64380.88870.80370.9737010.50280.7162
530.64540.88870.79710.9803010.10770.7023
540.68730.88870.7910.9864010.27840.6907
550.72650.88870.78530.99220.00110.99990.1970.6808
560.79120.88870.77980.99760.03960.99820.11330.6724
570.81140.88870.77461.00280.09210.9530.10220.665
580.82810.88870.76961.00780.15920.89840.1840.6585
590.83930.88870.76491.01250.21710.83130.65270.6527







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
480.0279-0.09490.00790.0076e-040.0242
490.035-0.24740.02060.04820.0040.0634
500.0402-0.26030.02170.05350.00450.0668
510.0447-0.22040.01840.03840.00320.0565
520.0488-0.27560.0230.060.0050.0707
530.0526-0.27380.02280.05920.00490.0702
540.0561-0.22660.01890.04060.00340.0581
550.0594-0.18250.01520.02630.00220.0468
560.0625-0.10970.00910.00958e-040.0281
570.0655-0.0870.00720.0065e-040.0223
580.0684-0.06820.00570.00373e-040.0175
590.0711-0.05560.00460.00242e-040.0143

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
48 & 0.0279 & -0.0949 & 0.0079 & 0.007 & 6e-04 & 0.0242 \tabularnewline
49 & 0.035 & -0.2474 & 0.0206 & 0.0482 & 0.004 & 0.0634 \tabularnewline
50 & 0.0402 & -0.2603 & 0.0217 & 0.0535 & 0.0045 & 0.0668 \tabularnewline
51 & 0.0447 & -0.2204 & 0.0184 & 0.0384 & 0.0032 & 0.0565 \tabularnewline
52 & 0.0488 & -0.2756 & 0.023 & 0.06 & 0.005 & 0.0707 \tabularnewline
53 & 0.0526 & -0.2738 & 0.0228 & 0.0592 & 0.0049 & 0.0702 \tabularnewline
54 & 0.0561 & -0.2266 & 0.0189 & 0.0406 & 0.0034 & 0.0581 \tabularnewline
55 & 0.0594 & -0.1825 & 0.0152 & 0.0263 & 0.0022 & 0.0468 \tabularnewline
56 & 0.0625 & -0.1097 & 0.0091 & 0.0095 & 8e-04 & 0.0281 \tabularnewline
57 & 0.0655 & -0.087 & 0.0072 & 0.006 & 5e-04 & 0.0223 \tabularnewline
58 & 0.0684 & -0.0682 & 0.0057 & 0.0037 & 3e-04 & 0.0175 \tabularnewline
59 & 0.0711 & -0.0556 & 0.0046 & 0.0024 & 2e-04 & 0.0143 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=63798&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]48[/C][C]0.0279[/C][C]-0.0949[/C][C]0.0079[/C][C]0.007[/C][C]6e-04[/C][C]0.0242[/C][/ROW]
[ROW][C]49[/C][C]0.035[/C][C]-0.2474[/C][C]0.0206[/C][C]0.0482[/C][C]0.004[/C][C]0.0634[/C][/ROW]
[ROW][C]50[/C][C]0.0402[/C][C]-0.2603[/C][C]0.0217[/C][C]0.0535[/C][C]0.0045[/C][C]0.0668[/C][/ROW]
[ROW][C]51[/C][C]0.0447[/C][C]-0.2204[/C][C]0.0184[/C][C]0.0384[/C][C]0.0032[/C][C]0.0565[/C][/ROW]
[ROW][C]52[/C][C]0.0488[/C][C]-0.2756[/C][C]0.023[/C][C]0.06[/C][C]0.005[/C][C]0.0707[/C][/ROW]
[ROW][C]53[/C][C]0.0526[/C][C]-0.2738[/C][C]0.0228[/C][C]0.0592[/C][C]0.0049[/C][C]0.0702[/C][/ROW]
[ROW][C]54[/C][C]0.0561[/C][C]-0.2266[/C][C]0.0189[/C][C]0.0406[/C][C]0.0034[/C][C]0.0581[/C][/ROW]
[ROW][C]55[/C][C]0.0594[/C][C]-0.1825[/C][C]0.0152[/C][C]0.0263[/C][C]0.0022[/C][C]0.0468[/C][/ROW]
[ROW][C]56[/C][C]0.0625[/C][C]-0.1097[/C][C]0.0091[/C][C]0.0095[/C][C]8e-04[/C][C]0.0281[/C][/ROW]
[ROW][C]57[/C][C]0.0655[/C][C]-0.087[/C][C]0.0072[/C][C]0.006[/C][C]5e-04[/C][C]0.0223[/C][/ROW]
[ROW][C]58[/C][C]0.0684[/C][C]-0.0682[/C][C]0.0057[/C][C]0.0037[/C][C]3e-04[/C][C]0.0175[/C][/ROW]
[ROW][C]59[/C][C]0.0711[/C][C]-0.0556[/C][C]0.0046[/C][C]0.0024[/C][C]2e-04[/C][C]0.0143[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=63798&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63798&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
480.0279-0.09490.00790.0076e-040.0242
490.035-0.24740.02060.04820.0040.0634
500.0402-0.26030.02170.05350.00450.0668
510.0447-0.22040.01840.03840.00320.0565
520.0488-0.27560.0230.060.0050.0707
530.0526-0.27380.02280.05920.00490.0702
540.0561-0.22660.01890.04060.00340.0581
550.0594-0.18250.01520.02630.00220.0468
560.0625-0.10970.00910.00958e-040.0281
570.0655-0.0870.00720.0065e-040.0223
580.0684-0.06820.00570.00373e-040.0175
590.0711-0.05560.00460.00242e-040.0143



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