Minimum variance portfolio weights
A portfolio invested in two stocks is not realistic. A more realistic example is to consider an equity portfolio invested in two diversified exchange traded funds (ETFs), like an ETF invested in US stocks and an ETF invested in EU stocks. In this exercise you need to use the GARCH estimation output available as usgarchfit
and eugarchfit
to compute the weights of the US ETF in the minimum variance portfolio invested in the US and EU ETF using the formula
This exercise is part of the course
GARCH Models in R
Exercise instructions
- Compute the standardized US and EU returns, together with their correlation.
- Compute the covariance and variance of the US and EU returns.
- Compute the minimum variance weights and plot them.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Compute the standardized US and EU returns, together with their correlation
stdusret <- residuals(usgarchfit, standardize = TRUE)
stdeuret <- ___
useucor <- as.numeric(___(___, ___))
print(useucor)
# Compute the covariance and variance of the US and EU returns
useucov <- ___ * sigma(___) * ___
usvar <- ___
euvar <- ___
# Compute the minimum variance weight of the US ETF in the US-EU ETF portfolio
usweight <- (euvar - ___) / (usvar + ___ - 2 * ___)
plot(usweight)