Brownian Distance Variance Constraints
The methods below are public. The other names of this topic are private, and the private page documents them.
PortfolioOptimisers.set_risk_constraints! — Method
set_risk_constraints!(
model::Model,
,
r::BrownianDistanceVariance,
opt::Union{AbstractProgrammeAllocationSet, RiskJuMPOptimisationEstimator},
pr::AbstractPriorResult,
args...;
prefix,
kwargs...
) -> Any
Add the BrownianDistanceVariance bound of the net portfolio returns to model, and return its risk expression.
r.alg1 selects the risk expression, and r.alg2 selects the rows that tie the distance matrix to the returns. When the objective minimises the risk, bdvariance_risk equals the functor of the measure at the solved weights.
The build is keyed on prefix alone, with no measure index. A second call with the same prefix uses the registered expression and builds no rows. The settings of the first BrownianDistanceVariance take effect, and a second measure logs a warning, because its bound and its scale have no effect.
Algorithm
- When
bdvariance_riskis registered underprefix, go to step 6. - Read the net portfolio return series
net_Xwithset_net_portfolio_returns!, and its lengthT. - Create
Dt, and registerDx, the matrix of the pairwise differences ofnet_X. - Register the risk expression of
r.alg1withset_brownian_distance_risk_constraint!. - Add the rows of
r.alg2withset_brownian_distance_variance_constraints!. - Convert the bound in
r.settingsto the units of a deviation withvariance_risk_bounds_val, and take the expression that it acts on fromset_brownian_distance_bounds_expr!. The risk expression has degree two in the weights, and the row ofset_risk_upper_bound!multiplies the bound by $k$, so under a ratio objective the bound holds only on an expression of degree one. - Add the bound on the deviation and the risk expression with
set_unindexed_risk_bounds_and_expression!, and return the risk expression.
JuMP formulation
Variables
Dt: created, the symmetric $T \times T$ matrix $\mathbf{D}$.bdvariance_dev: created byset_brownian_distance_bounds_expr!whenr.settingsholds a bound, the square root of the risk expression.
Expressions
Dx: $\boldsymbol{\Delta} = \hat{\boldsymbol{r}} \boldsymbol{1}^\intercal - \boldsymbol{1} \hat{\boldsymbol{r}}^\intercal$.
The two calls register bdvariance_risk and the rows, and their docstrings state them. Each name carries the namespace prefix.
Where:
- $\mathbf{D}$: Symmetric matrix variable of the distances between the portfolio returns.
- $\boldsymbol{\Delta}$: Matrix of the differences $\Delta_{ij} = \hat{r}_i - \hat{r}_j$.
- $\hat{\boldsymbol{r}}$: The net portfolio returns
net_X, $T \times 1$. - $\boldsymbol{1}$: Column vector of ones, $T \times 1$.
- $T$: Number of observations.
Relaxation
The encoding is not exact: the entries below bound the quantity instead of reproducing it, and the bound is tight only under the condition stated here.
bdvariance_risklies at or above $\mathrm{BDVar}(\hat{\boldsymbol{r}})$, and is tight when the objective minimises the risk. The two calls state the reasons.- $\mathrm{BDVar}(\hat{\boldsymbol{r}})$ lies at or above the distance variance of $\hat{\boldsymbol{r}}$. It is tight only for a constant series.
Arguments
model::JuMP.Model: The JuMP optimisation model.::Any: The index of the measure in the risk vector. The method does not read it.r::BrownianDistanceVariance: The measure, read foralg1,alg2andsettings.opt::RiskConstraintOwner: The owner of the risk constraint, a risk-based JuMP optimisation estimator or a programme Allocation Set.pr::AbstractPriorResult: Prior result containing the returns matrixX.
Keyword arguments
prefix::Symbol: Model State namespace of the build (default: empty, i.e. the bare key).
Returns
bdvariance_risk: The risk expression.
Related