1. Learn
  2. /
  3. Courses
  4. /
  5. Quantitative Risk Management in Python

Exercise

Real-time risk management

It's time to use what you've learned about neural networks to perform (almost!) real-time risk management.

A 14-day rolling window of asset returns provides enough data to create a time series of minimum volatility portfolios using Modern Portfolio Theory, as you saw in Chapter 2. These minimum_vol portfolio weights are the training values for a neural network. This is a (1497 x 4) matrix.

The input is the matrix of weekly average_asset_returns, corresponding to each efficient portfolio. This is a (1497 x 4) matrix.

Create a Sequential neural network with the proper input dimension and two hidden layers. Training this network would take too long, so you'll use an available pre_trained_model of identical type to predict portfolio weights for a new asset price vector.

Instructions

100 XP
  • Create a Sequential neural network with two hidden layers, one input layer and one output layer.
  • Use the pre_trained_model to predict what the minimum volatility portfolio would be, when new asset data asset_returns is presented.