Vous êtes sur la page 1sur 20

MScFE 610 Econometrics C18-S4

SUBMISSION 3
Group 5 - E

Prepared By

1. Paras Mani Dhakal


2. George Osir Odhiambo
3. Vishnu Vardhan Reddy Raghupathy
4. Raghav Sharma
5. Francis Ssali

January, 2019

====================== Submission #3 Starts here ======================


3.3.1 Extreme event analysis
Univariate analysis (Module 6): fit a generalized extreme value model to each of the asset
return series. A one-month investment horizon is suggested, but you may choose your own
investment horizon of choice. Be sure to clearly state the horizon you use.

a. Discuss the differences/similarities in the estimates.

b. Generate quantile plots to compare the fit of the GEV model across the different
assets.

We estimated the Maximum likelihood of the GEV model for the selected five assets using R. We chose a
block size of one month which entails 21 trading days. The redacted result for the estimation of the first
asset is to be presented fully while only parameter estimation results are tabulated for the remaining
assets as presented below.

First, we checked if the negative return series is from normal distribution so that we can use gumbel
distribution to fit extreme values of the series. But the p-value indicates, the data elements are not
sampled from normal distribution.

>shapiro.test(aapl_neg_log_df$AAPL.Close)
Shapiro-Wilk normality test

data: aapl_neg_log_df$AAPL.Close
W = 0.92899, p-value < 2.2e-16

Then we used gev function in “evir” package to fit GEV model for the negative return series. We use
negative return series so that the focus is on modelling extreme negative returns of stocks. We have
mentioned only major observations from the fitted model. We can see that the xi > 0, block maxima
seems to follow Frechet distribution.

>gev(aapl_neg_log,block = 21)
$block
[1] 21

$par.ests
xi sigma mu
0.17155980 0.01376886 0.02379295

$par.ses
xi sigma mu
0.061383279 0.000990269 0.001324841
$varcov
[,1] [,2] [,3]
[1,] 3.767907e-03 -1.266166e-07 -2.168025e-05
[2,] -1.266166e-07 9.806327e-07 6.900765e-07
[3,] -2.168025e-05 6.900765e-07 1.755205e-06

We then plotted QQ plot to see that the smaller end of the block maxima is captured perfectly using GEV.
But the larger values are not modelled properly. Thus, extreme negative values are not being modelled by
GEV approach.

> plot.gev(GEV)

Make a plot selection (or 0 to exit):

1: plot: Scatterplot of Residuals


2: plot: QQplot of Residuals

Selection: 2

Assuming that the modelled GEV is perfect, we tried to get the return level that the modelled GEV series
will exceed for a range of subperiods. The resultant plot shows us the return level for every subperiod
level and 95% confidence interval range.
>rl = data.frame()
>for( i in 2:60) {
rl = rbind(rl,rlevel.gev(GEV,k.blocks = i,add = TRUE))
}
>matplot(rl, type = c("l"),pch=1,col = 1:3) #plot

The figure shows that the range of return values kept increasing indicating the inaccuracy in modelling in
case of extreme values of returns.

The same process is repeated for rest of the stocks. The concise results are mentioned below:

BA:

$par.ests
xi sigma mu
0.27392797 0.01074707 0.02243609

$par.ses
xi sigma mu
0.0938515603 0.0008725469 0.0011050591

$varcov
[,1] [,2] [,3]
[1,] 8.808115e-03 -1.423412e-05 -4.130429e-05
[2,] -1.423412e-05 7.613381e-07 6.313758e-07
[3,] -4.130429e-05 6.313758e-07 1.221156e-06
CAT:

$par.ests
xi sigma mu
0.19320251 0.01458700 0.02521578

$par.ses
xi sigma mu
0.091679940 0.001180670 0.001506511
$varcov
[,1] [,2] [,3]
[1,] 8.405211e-03 -2.930026e-05 -5.866106e-05
[2,] -2.930026e-05 1.393982e-06 1.087571e-06
[3,] -5.866106e-05 1.087571e-06 2.269576e-06
MSFT:

$par.ests
xi sigma mu
0.27131203 0.01119432 0.02044486

$par.ses
xi sigma mu
0.0780917425 0.0008653214 0.0011064330

$varcov
[,1] [,2] [,3]
[1,] 6.098320e-03 -2.060949e-06 -2.708247e-05
[2,] -2.060949e-06 7.487812e-07 5.955095e-07
[3,] -2.708247e-05 5.955095e-07 1.224194e-06
UNH:

$par.ests
xi sigma mu
0.33653744 0.01180134 0.02188484

$par.ses
xi sigma mu
0.0783960633 0.0009420988 0.0011616067

$varcov
[,1] [,2] [,3]
[1,] 6.145943e-03 3.247914e-06 -2.616959e-05
[2,] 3.247914e-06 8.875501e-07 7.186870e-07
[3,] -2.616959e-05 7.186870e-07 1.349330e-06
From these results, all the stocks return series xi estimates are significant and greater than 0. Extreme
values follow Frechet distribution but we have to note that the estimates are somewhat close to 0.
Because of this, we are unable to see convex shape of the return level vs return period plot. From QQ
plots, MSFT and UNH stocks have most of the data captured using the GEV distribution.
Scatter Plots:
Almost all of the scatter plots are having elliptical shape, indicating that we can get a good fit with either
normal or t-copula. The exception being CAT & BA stocks scatterplot. We can infer from the grouping at
the positive extremes that clayton copula can be of better fit than other copulas.
For fitting a copula, we have used VineCopula function and mapped the return series to [0,1] range so
that the best fit model can be evaluated using the function BiCopSelect using min AIC criteria.

> u <- pobs(as.matrix(cbind(aapl_log, ba_log)))[,1]


> v <- pobs(as.matrix(cbind(aapl_log, ba_log)))[,2]
> selectedCopula <- BiCopSelect(u, v,familyset=NA)
> summary(selectedCopula)
Family
------
No: 2
Name: t

Parameter(s)
------------
par: 0.4
par2: 3.58
Dependence measures
-------------------
Kendall's tau: 0.26 (empirical = 0.26, p value < 0.01)
Upper TD: 0.22
Lower TD: 0.22

Fit statistics
--------------
logLik: 333.76
AIC: -663.53
BIC: -651.66

The best fit copula is t-copula. Similarly, we repeated the process for rest of the pairs and we got the
following best fit copulas:

STOC STOC Family BEST FIT Par Par2 Kendall's Tau


K1 K2 No

AAPL BA 2 t-copula 0.4 3.58 0.26 (empirical = 0.26, p


value < 0.01)

AAPL CAT 2 t-copula 0.46 4.34 0.31 (empirical = 0.3, p


value < 0.01)

AAPL MSFT 2 t-copula 0.5 3.01 0.33 (empirical = 0.33, p


value < 0.01)
AAPL UNH 2 t-copula 0.33 3.64 0.22 (empirical = 0.22, p
value < 0.01)

BA CAT 2 t-copula 0.58 3.71 0.39 (empirical = 0.39, p


value < 0.01)

BA MSFT 2 t-copula 0.48 3.47 0.32 (empirical = 0.31, p


value < 0.01)

BA UNH 2 t-copula 0.42 3.92 0.27 (empirical = 0.27, p


value < 0.01)

CAT MSFT 19 rotated BB7 1.5 0.46 0.33 (empirical = 0.33, p


copula (180 value < 0.01)
degrees; “survival
BB7”)

CAT UNH 2 t-copula 0.39 3.59 0.25 (empirical = 0.25, p


value < 0.01)

MSFT UNH 2 t-copula 0.39 3.67 0.26 (empirical = 0.25, p


value < 0.01)

3.3.2 Portfolio Construction

Following the procedures in Module 7, for every pair of assets construct and evaluate the
performance of each portfolio based on the end-of-sample data that you excluded in the
multivariate GARCH models you fitted in Submission 2 of the project. You should do this in the
following steps:

1. Use the forecasted expected returns, conditional variances and conditional correlations for
each pair of assets that you generated in Submission 2 of the project to construct the
minimum variance portfolio.

2. Compute the predicted expected return and standard deviation for each portfolio for a
three-month horizon.

3. Compare the predicted expected return and standard deviation for each portfolio to the
return and standard deviation that the portfolio would have attained using the last three
months of data that you excluded from the estimation in Submission 2.

a. E.g. how different is the predicted returns and variances of the various portfolios from
what actually occurred?
b. Were there any “extreme events” in the evaluation period that affects results?

We have used the DCC MGARCH model to determine the estimates to calculate T+1 return, variance
and covariance of a pair of stocks. We have removed the last 63 trading days data and performed the
following steps.
> data1= cbind(as.data.frame(aapl_log_2732), as.data.frame(ba_log_2732))
> xspec = ugarchspec(mean.model = list(armaOrder = c(1, 1)), variance.model = list(garchOrder = c(1,1),
model = 'sGARCH'), distribution.model = 'norm')
> uspec = multispec(replicate(2, xspec))
> spec1 = dccspec(uspec = uspec, dccOrder = c(1, 1), distribution = 'mvnorm')
> cl = makePSOCKcluster(4)
> multf = multifit(uspec, data1, cluster = cl)
> fit1 <- dccfit(spec1, data = data1, fit.control = list(eval.se = TRUE), fit = multf, cluster = cl)
> print(fit1)

*---------------------------------*
* DCC GARCH Fit *
*---------------------------------*

Distribution : mvnorm
Model : DCC(1,1)
No. Parameters : 15
[VAR GARCH DCC UncQ] : [0+12+2+1]
No. Series : 2
No. Obs. : 2732
Log-Likelihood : 14858.12
Av.Log-Likelihood : 5.44

Optimal Parameters
-----------------------------------
Estimate Std. Error t value Pr(>|t|)
[aapl_log_2732].mu 0.001554 0.000376 4.13124 0.000036
[aapl_log_2732].ar1 0.177390 0.351856 0.50416 0.614152
[aapl_log_2732].ma1 -0.152550 0.352839 -0.43235 0.665487
[aapl_log_2732].omega 0.000014 0.000004 3.46750 0.000525
[aapl_log_2732].alpha1 0.102972 0.025312 4.06811 0.000047
[aapl_log_2732].beta1 0.858817 0.010528 81.57736 0.000000
[ba_log_2732].mu 0.000932 0.000354 2.63300 0.008463
[ba_log_2732].ar1 -0.436022 0.477133 -0.91384 0.360802
[ba_log_2732].ma1 0.468935 0.468300 1.00136 0.316655
[ba_log_2732].omega 0.000008 0.000005 1.54234 0.122991
[ba_log_2732].alpha1 0.077369 0.018765 4.12294 0.000037
[ba_log_2732].beta1 0.897352 0.013703 65.48586 0.000000
[Joint]dcca1 0.061694 0.017364 3.55290 0.000381
[Joint]dccb1 0.859073 0.045590 18.84353 0.000000

Information Criteria
---------------------

Akaike -10.866
Bayes -10.834
Shibata -10.866
Hannan-Quinn -10.854

Elapsed time : 8.926208

Once we got the estimates, we have used forecast function to get the forecast for 1 period ahead without
any rolling period.

> dccf <- dccforecast(fit1,n.ahead = 1)


> dccf
> Ret <- fitted(dccf)[1,1:2,1]
> cov <- rcov(dccf)$`1977-06-25 05:30:00`[1:2, 1:2, 1]
> cor <- rcor(dccf)$`1977-06-25 05:30:00`[1:2, 1:2, 1]
> Ret
aapl_log_2732 ba_log_2732
0.0016281037 0.0009219301

> cov
aapl_log_2732 ba_log_2732
aapl_log_2732 0.0007331003 0.0002279306
ba_log_2732 0.0002279306 0.0005152433

Using these forecasted values, we determine the tangency portfolio using the formula

Assuming r0,uf ~= 0

Weight = 0.66315

Using the formula mentioned below expected return and variance for tangency portfolio came out to be
0.001390229 & 0.0004826888.

By forecasting the model for 63 days ahead, we find the expected return and standard deviation as
follows:
> dccf <- dccforecast(fit1,n.ahead = 63)
> dccf
> Ret_AAPL <- sum(fitted(dccf)[1:63,1,1])
> Ret_BA <- sum(fitted(dccf)[1:63,2,1])
> Ret_AAPL
[1] 0.0979656
> Ret_BA
[1] 0.05873578

Assuming the weightage is same throughout the preiod. We can calculate the return for the portfolio for
three month horizon to be:
> port_ret <- Ret_AAPL*weight + (1-weight)*Ret_BA
> port_ret
aapl_log_2732
0.08475104
Portfolio variance can be calculated as follows:
> cov <- rcov(dccf)$`1977-06-25 05:30:00`[1:2, 1:2, 63]
> cov
aapl_log_2732 ba_log_2732
aapl_log_2732 0.0003898766 0.0001294768
ba_log_2732 0.0001294768 0.0003466180
> port_var = weight^2 * cov[1,1] + (1-weight)^2 * cov[2,2]+2*weight*(1-weight)*cov[2,1]
> port_var
aapl_log_2732
0.0002686308

The same process is repeated for all the stock pairs.

References:
1. https://cran.r-project.org/web/packages/rmgarch/rmgarch.pdf
2. http://r.789695.n4.nabble.com/R-package-rmgarch-td4718358.html
3. https://cran.r-project.org/web/packages/VineCopula/VineCopula.pdf

Vous aimerez peut-être aussi