Get startedGet started for free

Do improved estimates lead to improved performance?

Let us hypothesize that using a robust estimate of the variance-covariance matrix will outperform the sample variance covariance matrix. In theory, better estimates should lead to better results. We will use the moments_robust() function that was defined in chapter 3 and the portfolio specification from the last exercise.

This exercise is part of the course

Intermediate Portfolio Analysis in R

View Course

Exercise instructions

  • Run the optimization using the moments_robust() function to estimate moments. The optimization backtest will use the same parameters used previously, quarterly rebalancing with training period and rolling window to use 5 years of data. Assign the results to a variable named opt_rebal_rb_robust.
  • Chart the weights.
  • Chart the component percentage contribution to risk.
  • Compute the portfolio returns using Return.portfolio(). Assign the returns to a variable named returns_rb_robust.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Run the optimization
opt_rebal_rb_robust <- optimize.portfolio.rebalancing(R = ___, 
                                                      momentFUN = ___,
                                                      portfolio = ___, 
                                                      optimize_method = "random", rp = rp,
                                                      trace = TRUE,
                                                      rebalance_on = ___, 
                                                      training_period = ___,
                                                      rolling_window = ___)

# Chart the weights


# Chart the percentage contribution to risk
chart.RiskBudget(___, match.col = "StdDev", risk.type = ___)

# Compute the portfolio returns
returns_rb_robust <- Return.portfolio(R = ___, weights = ___)
colnames(returns_rb_robust) <- "rb_robust"
Edit and Run Code