- Advanced Modeling
Tags
- Data Visualisation
- Linear Regression
- R Programming
In this third post, I am going to build an ARMA-GARCH model for Dow Jones Industrial Average (DJIA) daily log-returns. You can read the first and second part which I published previously.
Packages
The packages being used in this post series are herein listed.
1 |
|
Getting Data
We upload the environment status as saved at the end of part 2.
1 |
|
This is the plot of DJIA daily log-returns.
1 |
|
Outliers Detection
The Return.clean function within Performance Analytics package is able to clean return time series from outliers. Here below we compare the original time series with the outliers adjusted one.
1 |
|
The prosecution of the analysis will be carried on with the original time series as a more conservative approach to volatility evaluation.
Correlation plots
Here below are the total and partial correlation plots.
1 |
|
1 |
|
Above correlation plots suggest some ARMA(p,q) model with p and q > 0. That will be verified within the prosecution of the present analysis.
Unit root tests
We run the Augmented Dickey-Fuller test as available within the urca package. The no trend and no drift test flavor is run.
1 |
|
ARCH effect test
Conditional Volatility
The conditional mean and variance are defined as:
[\mu_{t}\ :=\ E(r_{t} | \ F_{t-1}) \\sigma^2{t}\ :=\ Var(r{t} | \ F_{t-1})\ =\ E[(r_t-\mu_{t})^2 | F_{t-1}]] |
The conditional volatility can be computed as square root of the conditional variance. See ref. [4] for further details.
eGARCH Model
The attempts with sGARCH as variance model did not bring to result with significative coefficients. On the contrary, the exponential GARCH (eGARCH) variance model is capable to capture asymmetries within the volatility shocks.
To inspect asymmetries within the DJIA log returns, summary statistics and density plot are shown.
1 |
|
We go on proposing as variance model (for conditional variance) the eGARCH model. More precisely, we are about to model an ARMA-GARCH, with ARMA(2,2) as a mean model and exponential GARCH(1,1) as the variance model. Before doing that, we further emphasize how ARMA(0,0) is not satisfactory within this context.
ARMA-GARCH: ARMA(0,0) + eGARCH(1,1)
1 |
|
We show the original DJIA log-returns time series with the mean model fit (red line) and the conditional volatility (blue line).
1 |
|
Model Equation
Combining both ARMA(2,2) and eGARCH models we have:
[\begin{equation}\begin{cases}y_{t}\ -\ \phi_{1}y_{t-1}\ -\ \phi_{2}y_{t-2} =\ \phi_{0}\ +\ u_{t}\ +\ \theta_{1}u_{t-1}\ +\ \theta_{2}u_{t-2}\\u_{t}\ =\ \sigma_{t}\epsilon_{t},\ \ \ \ \ \epsilon_{t}=N(0,1)\\\ln(\sigma_{t}^2)\ =\ \omega\ + \sum_{j=1}^{q} (\alpha_{j} \epsilon_{t-j}^2\ + \gamma (\epsilon_{t-j} – E | \epsilon_{t-j} | )) +\ \sum_{i=1}^{p} \beta_{i} ln(\sigma_{t-1}^2)\end{cases}\end{equation}] |
Using the model resulting coefficients, it results as follows.
[\begin{equation}\begin{cases}y_{t}\ + 0.476\ y_{t-1}\ + 0.575\ y_{t-2} = \ u_{t}\ + 0.429\ u_{t-1}\ + 0.563\ u_{t-2}\\u_{t}\ =\ \sigma_{t}\epsilon_{t},\ \ \ \ \ \epsilon_{t}=N(0,1)\\\ln(\sigma_{t}^2)\ =\ -0.313\ -0.174 \epsilon_{t-1}^2\ + 0.189\ (\epsilon_{t-1} – E | \epsilon_{t-1} | )) +\ 0.966\ ln(\sigma_{t-1}^2)\end{cases}\end{equation}] |
Volatility Analysis
Here is the plot of conditional volatility as resulting from our ARMA(2,2) + eGARCH(1,1) model.
1 |
|
Line plots of conditional volatility by year are shown.
1 |
|
Conditional volatility box-plots by year are shown.
1 |
|
Afterwards 2008, the daily volatility basically tends to decrease. In the year 2017, the volatility was lower with respect any other year under analysis. On the contrary, on the year 2018, we experienced a remarkable increase of volatility with respect year 2017.
Saving the current enviroment for further analysis.
1 |
|
If you have any questions, please feel free to comment below.
References
-
Dow Jones Industrial Average
-
Skewness
-
Kurtosis
-
An introduction to analysis of financial data with R, Wiley, Ruey S. Tsay
-
Time series analysis and its applications, Springer ed., R.H. Shumway, D.S. Stoffer
-
Applied Econometric Time Series, Wiley, W. Enders, 4th ed.
-
Forecasting – Principle and Practice, Texts, R.J. Hyndman
Disclaimer
Any securities or databases referred in this post are solely for illustration purposes, and under no regard should the findings presented here be interpreted as investment advice or promotion of any particular security or source.
Related Post
- Leaf Plant Classification: Statistical Learning Model – Part 2
- NYC buses: C5.0 classification with R; more than 20 minute delay?
- NYC buses: Cubist regression with more predictors
- NYC buses: simple Cubist regression
- Visualization of NYC bus delays with R
Related