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, 11 Dec 2009 04:35:23 -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/11/t1260531517l76y4mqlwi1b2ir.htm/, Retrieved Sun, 28 Apr 2024 23:59:24 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66016, Retrieved Sun, 28 Apr 2024 23:59:24 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact121
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
-   PD  [ARIMA Forecasting] [Voorspellingen me...] [2009-12-11 11:06:46] [35f0fff14d789f48983afb62e692bd0d]
- R  D      [ARIMA Forecasting] [Voorspellingen me...] [2009-12-11 11:35:23] [2210215221105fab636491031ce54076] [Current]
Feedback Forum

Post a new message
Dataseries X:
1.9
1.8
1.9
2.2
2.1
2.2
2.7
2.8
2.9
3.4
3
3.1
2.5
2.2
2.3
2.1
2.8
3.1
2.9
2.6
2.7
2.3
2.3
2.1
2.2
2.9
2.6
2.7
1.8
1.3
0.9
1.3
1.3
1.3
1.3
1.1
1.4
1.2
1.7
1.8
1.5
1
1.6
1.5
1.8
1.8
1.6
1.9
1.7
1.6
1.3
1.1
1.9
2.6
2.3
2.4
2.2
2
2.9
2.6
2.3
2.3
2.6
3.1
2.8
2.5
2.9
3.1
3.1
3.2
2.5
2.6
2.9
2.6
2.4
1.7
2
2.2
1.9
1.6
1.6
1.2
1.2
1.5
1.6
1.7
1.8
1.8
1.8
1.3
1.3
1.4
1.1
1.5
2.2
2.9
3.1
3.5
3.6
4.4
4.2
5.2
5.8
5.9
5.4
5.5
4.7
3.1
2.6
2.3
1.9
0.6
0.6
-0.4
-1.1
-1.7
-0.8
-1.2
-1
-0.1




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66016&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]1 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=66016&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66016&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 time1 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[108])
962.9-------
973.1-------
983.5-------
993.6-------
1004.4-------
1014.2-------
1025.2-------
1035.8-------
1045.9-------
1055.4-------
1065.5-------
1074.7-------
1083.1-------
1092.62.80112.12033.4820.28130.19480.19480.1948
1102.32.57921.53333.62520.30040.48450.04220.1646
1111.92.52371.21063.83690.17590.63080.05410.1949
1120.62.07990.54543.61440.02940.59090.00150.0963
1130.62.19090.46313.91860.03560.96440.01130.1512
114-0.41.6361-0.26543.53750.01790.85721e-040.0656
115-1.11.3032-0.75743.36380.01110.947400.0437
116-1.71.2477-0.96053.4560.00440.981400.0501
117-0.81.5251-0.82153.87180.02610.99656e-040.0942
118-1.21.4696-1.00773.9470.01730.96377e-040.0985
119-11.9135-0.6884.51490.01410.99050.01790.1857
120-0.12.80110.08125.52110.01830.99690.41470.4147

\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[108]) \tabularnewline
96 & 2.9 & - & - & - & - & - & - & - \tabularnewline
97 & 3.1 & - & - & - & - & - & - & - \tabularnewline
98 & 3.5 & - & - & - & - & - & - & - \tabularnewline
99 & 3.6 & - & - & - & - & - & - & - \tabularnewline
100 & 4.4 & - & - & - & - & - & - & - \tabularnewline
101 & 4.2 & - & - & - & - & - & - & - \tabularnewline
102 & 5.2 & - & - & - & - & - & - & - \tabularnewline
103 & 5.8 & - & - & - & - & - & - & - \tabularnewline
104 & 5.9 & - & - & - & - & - & - & - \tabularnewline
105 & 5.4 & - & - & - & - & - & - & - \tabularnewline
106 & 5.5 & - & - & - & - & - & - & - \tabularnewline
107 & 4.7 & - & - & - & - & - & - & - \tabularnewline
108 & 3.1 & - & - & - & - & - & - & - \tabularnewline
109 & 2.6 & 2.8011 & 2.1203 & 3.482 & 0.2813 & 0.1948 & 0.1948 & 0.1948 \tabularnewline
110 & 2.3 & 2.5792 & 1.5333 & 3.6252 & 0.3004 & 0.4845 & 0.0422 & 0.1646 \tabularnewline
111 & 1.9 & 2.5237 & 1.2106 & 3.8369 & 0.1759 & 0.6308 & 0.0541 & 0.1949 \tabularnewline
112 & 0.6 & 2.0799 & 0.5454 & 3.6144 & 0.0294 & 0.5909 & 0.0015 & 0.0963 \tabularnewline
113 & 0.6 & 2.1909 & 0.4631 & 3.9186 & 0.0356 & 0.9644 & 0.0113 & 0.1512 \tabularnewline
114 & -0.4 & 1.6361 & -0.2654 & 3.5375 & 0.0179 & 0.8572 & 1e-04 & 0.0656 \tabularnewline
115 & -1.1 & 1.3032 & -0.7574 & 3.3638 & 0.0111 & 0.9474 & 0 & 0.0437 \tabularnewline
116 & -1.7 & 1.2477 & -0.9605 & 3.456 & 0.0044 & 0.9814 & 0 & 0.0501 \tabularnewline
117 & -0.8 & 1.5251 & -0.8215 & 3.8718 & 0.0261 & 0.9965 & 6e-04 & 0.0942 \tabularnewline
118 & -1.2 & 1.4696 & -1.0077 & 3.947 & 0.0173 & 0.9637 & 7e-04 & 0.0985 \tabularnewline
119 & -1 & 1.9135 & -0.688 & 4.5149 & 0.0141 & 0.9905 & 0.0179 & 0.1857 \tabularnewline
120 & -0.1 & 2.8011 & 0.0812 & 5.5211 & 0.0183 & 0.9969 & 0.4147 & 0.4147 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66016&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[108])[/C][/ROW]
[ROW][C]96[/C][C]2.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]3.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]3.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]3.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]4.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]4.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]5.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]5.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]5.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]5.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]5.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]4.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]3.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]2.6[/C][C]2.8011[/C][C]2.1203[/C][C]3.482[/C][C]0.2813[/C][C]0.1948[/C][C]0.1948[/C][C]0.1948[/C][/ROW]
[ROW][C]110[/C][C]2.3[/C][C]2.5792[/C][C]1.5333[/C][C]3.6252[/C][C]0.3004[/C][C]0.4845[/C][C]0.0422[/C][C]0.1646[/C][/ROW]
[ROW][C]111[/C][C]1.9[/C][C]2.5237[/C][C]1.2106[/C][C]3.8369[/C][C]0.1759[/C][C]0.6308[/C][C]0.0541[/C][C]0.1949[/C][/ROW]
[ROW][C]112[/C][C]0.6[/C][C]2.0799[/C][C]0.5454[/C][C]3.6144[/C][C]0.0294[/C][C]0.5909[/C][C]0.0015[/C][C]0.0963[/C][/ROW]
[ROW][C]113[/C][C]0.6[/C][C]2.1909[/C][C]0.4631[/C][C]3.9186[/C][C]0.0356[/C][C]0.9644[/C][C]0.0113[/C][C]0.1512[/C][/ROW]
[ROW][C]114[/C][C]-0.4[/C][C]1.6361[/C][C]-0.2654[/C][C]3.5375[/C][C]0.0179[/C][C]0.8572[/C][C]1e-04[/C][C]0.0656[/C][/ROW]
[ROW][C]115[/C][C]-1.1[/C][C]1.3032[/C][C]-0.7574[/C][C]3.3638[/C][C]0.0111[/C][C]0.9474[/C][C]0[/C][C]0.0437[/C][/ROW]
[ROW][C]116[/C][C]-1.7[/C][C]1.2477[/C][C]-0.9605[/C][C]3.456[/C][C]0.0044[/C][C]0.9814[/C][C]0[/C][C]0.0501[/C][/ROW]
[ROW][C]117[/C][C]-0.8[/C][C]1.5251[/C][C]-0.8215[/C][C]3.8718[/C][C]0.0261[/C][C]0.9965[/C][C]6e-04[/C][C]0.0942[/C][/ROW]
[ROW][C]118[/C][C]-1.2[/C][C]1.4696[/C][C]-1.0077[/C][C]3.947[/C][C]0.0173[/C][C]0.9637[/C][C]7e-04[/C][C]0.0985[/C][/ROW]
[ROW][C]119[/C][C]-1[/C][C]1.9135[/C][C]-0.688[/C][C]4.5149[/C][C]0.0141[/C][C]0.9905[/C][C]0.0179[/C][C]0.1857[/C][/ROW]
[ROW][C]120[/C][C]-0.1[/C][C]2.8011[/C][C]0.0812[/C][C]5.5211[/C][C]0.0183[/C][C]0.9969[/C][C]0.4147[/C][C]0.4147[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66016&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66016&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[108])
962.9-------
973.1-------
983.5-------
993.6-------
1004.4-------
1014.2-------
1025.2-------
1035.8-------
1045.9-------
1055.4-------
1065.5-------
1074.7-------
1083.1-------
1092.62.80112.12033.4820.28130.19480.19480.1948
1102.32.57921.53333.62520.30040.48450.04220.1646
1111.92.52371.21063.83690.17590.63080.05410.1949
1120.62.07990.54543.61440.02940.59090.00150.0963
1130.62.19090.46313.91860.03560.96440.01130.1512
114-0.41.6361-0.26543.53750.01790.85721e-040.0656
115-1.11.3032-0.75743.36380.01110.947400.0437
116-1.71.2477-0.96053.4560.00440.981400.0501
117-0.81.5251-0.82153.87180.02610.99656e-040.0942
118-1.21.4696-1.00773.9470.01730.96377e-040.0985
119-11.9135-0.6884.51490.01410.99050.01790.1857
120-0.12.80110.08125.52110.01830.99690.41470.4147







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1090.124-0.071800.040500
1100.2069-0.10830.090.0780.05920.2433
1110.2655-0.24710.14240.3890.16920.4113
1120.3764-0.71150.28472.19010.67440.8212
1130.4024-0.72610.3732.53081.04571.0226
1140.593-1.24450.51824.14561.56231.2499
1150.8067-1.84410.70765.77532.16421.4711
1160.903-2.36250.91458.6892.97981.7262
1170.785-1.52460.98235.40613.24941.8026
1180.86-1.81651.06577.12693.63711.9071
1190.6937-1.52261.10728.48834.07812.0194
1200.4954-1.03571.10138.41664.43972.1071

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
109 & 0.124 & -0.0718 & 0 & 0.0405 & 0 & 0 \tabularnewline
110 & 0.2069 & -0.1083 & 0.09 & 0.078 & 0.0592 & 0.2433 \tabularnewline
111 & 0.2655 & -0.2471 & 0.1424 & 0.389 & 0.1692 & 0.4113 \tabularnewline
112 & 0.3764 & -0.7115 & 0.2847 & 2.1901 & 0.6744 & 0.8212 \tabularnewline
113 & 0.4024 & -0.7261 & 0.373 & 2.5308 & 1.0457 & 1.0226 \tabularnewline
114 & 0.593 & -1.2445 & 0.5182 & 4.1456 & 1.5623 & 1.2499 \tabularnewline
115 & 0.8067 & -1.8441 & 0.7076 & 5.7753 & 2.1642 & 1.4711 \tabularnewline
116 & 0.903 & -2.3625 & 0.9145 & 8.689 & 2.9798 & 1.7262 \tabularnewline
117 & 0.785 & -1.5246 & 0.9823 & 5.4061 & 3.2494 & 1.8026 \tabularnewline
118 & 0.86 & -1.8165 & 1.0657 & 7.1269 & 3.6371 & 1.9071 \tabularnewline
119 & 0.6937 & -1.5226 & 1.1072 & 8.4883 & 4.0781 & 2.0194 \tabularnewline
120 & 0.4954 & -1.0357 & 1.1013 & 8.4166 & 4.4397 & 2.1071 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66016&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]109[/C][C]0.124[/C][C]-0.0718[/C][C]0[/C][C]0.0405[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]110[/C][C]0.2069[/C][C]-0.1083[/C][C]0.09[/C][C]0.078[/C][C]0.0592[/C][C]0.2433[/C][/ROW]
[ROW][C]111[/C][C]0.2655[/C][C]-0.2471[/C][C]0.1424[/C][C]0.389[/C][C]0.1692[/C][C]0.4113[/C][/ROW]
[ROW][C]112[/C][C]0.3764[/C][C]-0.7115[/C][C]0.2847[/C][C]2.1901[/C][C]0.6744[/C][C]0.8212[/C][/ROW]
[ROW][C]113[/C][C]0.4024[/C][C]-0.7261[/C][C]0.373[/C][C]2.5308[/C][C]1.0457[/C][C]1.0226[/C][/ROW]
[ROW][C]114[/C][C]0.593[/C][C]-1.2445[/C][C]0.5182[/C][C]4.1456[/C][C]1.5623[/C][C]1.2499[/C][/ROW]
[ROW][C]115[/C][C]0.8067[/C][C]-1.8441[/C][C]0.7076[/C][C]5.7753[/C][C]2.1642[/C][C]1.4711[/C][/ROW]
[ROW][C]116[/C][C]0.903[/C][C]-2.3625[/C][C]0.9145[/C][C]8.689[/C][C]2.9798[/C][C]1.7262[/C][/ROW]
[ROW][C]117[/C][C]0.785[/C][C]-1.5246[/C][C]0.9823[/C][C]5.4061[/C][C]3.2494[/C][C]1.8026[/C][/ROW]
[ROW][C]118[/C][C]0.86[/C][C]-1.8165[/C][C]1.0657[/C][C]7.1269[/C][C]3.6371[/C][C]1.9071[/C][/ROW]
[ROW][C]119[/C][C]0.6937[/C][C]-1.5226[/C][C]1.1072[/C][C]8.4883[/C][C]4.0781[/C][C]2.0194[/C][/ROW]
[ROW][C]120[/C][C]0.4954[/C][C]-1.0357[/C][C]1.1013[/C][C]8.4166[/C][C]4.4397[/C][C]2.1071[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66016&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66016&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
1090.124-0.071800.040500
1100.2069-0.10830.090.0780.05920.2433
1110.2655-0.24710.14240.3890.16920.4113
1120.3764-0.71150.28472.19010.67440.8212
1130.4024-0.72610.3732.53081.04571.0226
1140.593-1.24450.51824.14561.56231.2499
1150.8067-1.84410.70765.77532.16421.4711
1160.903-2.36250.91458.6892.97981.7262
1170.785-1.52460.98235.40613.24941.8026
1180.86-1.81651.06577.12693.63711.9071
1190.6937-1.52261.10728.48834.07812.0194
1200.4954-1.03571.10138.41664.43972.1071



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