Exercise

# Exponentially weighted returns and risk

In this exercise, you're going to perform portfolio optimization with a slightly different way of estimating risk and returns; you're going to give more weight to recent data in the optimization.

This is a smart way to deal with stock data that is typically non-stationary, i.e., when the distribution changes over time. Implementation can be quickly done by changing the risk model you use to calculate `Sigma`

, and the returns calculation you use to get `mu`

. The stock prices dataset is available as `stock_prices`

. Let's try!

Instructions

**100 XP**

- Use the exponential weighted covariance matrix from
`risk_models`

and exponential weighted historical returns function from`expected_returns`

to calculate`Sigma`

and`mu`

. Set the span to 180 and the frequency (i.e. the trading days) to 252. - Calculate the efficient frontier with the new
`mu`

and`Sigma`

. - Calculate the weights for the maximum Sharpe ratio portfolio.
- Get the performance report.