Lean  $LEAN_TAG$
QuantConnect.Algorithm.Framework.Portfolio.RiskParityPortfolioOptimizer Class Reference

Provides an implementation of a risk parity portfolio optimizer that calculate the optimal weights with the weight range from 0 to 1 and equalize the risk carried by each asset More...

Inheritance diagram for QuantConnect.Algorithm.Framework.Portfolio.RiskParityPortfolioOptimizer:
[legend]

Public Member Functions

 RiskParityPortfolioOptimizer (double? lower=null, double? upper=null)
 Initialize a new instance of RiskParityPortfolioOptimizer More...
 
double[] Optimize (double[,] historicalReturns, double[] budget=null, double[,] covariance=null)
 Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns More...
 

Protected Member Functions

double[] RiskParityNewtonMethodOptimization (int numberOfVariables, double[,] covariance, double[] budget, double tolerance=1e-11, int maximumIteration=15000)
 Newton method of minimization More...
 

Detailed Description

Provides an implementation of a risk parity portfolio optimizer that calculate the optimal weights with the weight range from 0 to 1 and equalize the risk carried by each asset

Definition at line 27 of file RiskParityPortfolioOptimizer.cs.

Constructor & Destructor Documentation

◆ RiskParityPortfolioOptimizer()

QuantConnect.Algorithm.Framework.Portfolio.RiskParityPortfolioOptimizer.RiskParityPortfolioOptimizer ( double?  lower = null,
double?  upper = null 
)

Initialize a new instance of RiskParityPortfolioOptimizer

Parameters
lowerThe lower bounds on portfolio weights
upperThe upper bounds on portfolio weights

Definition at line 37 of file RiskParityPortfolioOptimizer.cs.

Member Function Documentation

◆ Optimize()

double [] QuantConnect.Algorithm.Framework.Portfolio.RiskParityPortfolioOptimizer.Optimize ( double  historicalReturns[,],
double[]  budget = null,
double  covariance[,] = null 
)

Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns

Parameters
historicalReturnsMatrix of annualized historical returns where each column represents a security and each row returns for the given date/time (size: K x N).
budgetRisk budget vector (size: K x 1).
covarianceMulti-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).
Returns
Array of double with the portfolio weights (size: K x 1)

Implements QuantConnect.Algorithm.Framework.Portfolio.IPortfolioOptimizer.

Definition at line 50 of file RiskParityPortfolioOptimizer.cs.

Here is the call graph for this function:

◆ RiskParityNewtonMethodOptimization()

double [] QuantConnect.Algorithm.Framework.Portfolio.RiskParityPortfolioOptimizer.RiskParityNewtonMethodOptimization ( int  numberOfVariables,
double  covariance[,],
double[]  budget,
double  tolerance = 1e-11,
int  maximumIteration = 15000 
)
protected

Newton method of minimization

Parameters
numberOfVariablesThe number of variables (size of weight vector).
covarianceCovariance matrix (size: K x K).
budgetThe risk budget (size: K x 1).
toleranceTolerance level of objective difference with previous steps to accept minimization result.
maximumIterationMaximum iteration per optimization.
Returns
Array of double of argumented minimization

Definition at line 79 of file RiskParityPortfolioOptimizer.cs.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: