Relaxed risk budgeting: private API

PortfolioOptimisers.RelaxedRiskBudgetingAlgorithm — Type
abstract type RelaxedRiskBudgetingAlgorithm <: OptimisationAlgorithm

Supertype of the three models of RelaxedRiskBudgeting.

Each subtype selects the cones that bound the variable $\psi$ of the model. The models are Models (A), (B) and (C) of [244], and the # Mathematical definition of RelaxedRiskBudgeting states them.

Related

References

  • [244] V. Gambeta and R. Kwon. Risk return trade-off in relaxed risk parity portfolio optimization. Journal of Risk and Financial Management 13, 237 (2020). Section 3.
source
PortfolioOptimisers.relaxed_risk_budgeting_td_defaults — Function
relaxed_risk_budgeting_td_defaults(

) -> @NamedTuple{rba::AssetRiskBudgeting{Nothing, Nothing, LogRiskBudgeting{Nothing}}}

Return the static defaults of the fields of RelaxedRiskBudgeting that can hold a TimeDependent schedule.

The constructor reads them when it checks a schedule through assert_time_dependent_substitution, and time_dependent_field_defaults returns them. So the value of each field outside a fold loop is stated in one place. A field whose static default is nothing is not in the result.

Returns

  • NamedTuple: (; rba = AssetRiskBudgeting()).

Related

source
PortfolioOptimisers.set_relaxed_risk_budgeting_alg_constraints! — Function
set_relaxed_risk_budgeting_alg_constraints!(alg, model::JuMP.Model, n::Integer,
                                            Gw::VecJuMPScalar, z::VecJuMPScalar,
                                            sigma_z::MatNum) -> Nothing

Add the cones that bound $\psi$ in the model that alg selects.

The method dispatches on alg. Model (A) adds one cone. Models (B) and (C) add the regulating term $\rho$ and two cones. The # Mathematical definition of RelaxedRiskBudgeting states the three models.

JuMP formulation

Variables

  • psi: $\psi$, read from the model.
  • rho: $\rho \geq 0$, created by Models (B) and (C).

Constraints

Where:

  • $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
  • $\mathcal{K}_{q} = \{(t, \boldsymbol{x}) : t \geq \lVert \boldsymbol{x} \rVert_{q}\}$: Norm cone of order $q$. $\mathcal{K}_{2}$ is the second-order cone.
  • $n$: Number of entries of the budget.
  • $\mathbf{G} \boldsymbol{w}$: The vector Gw, whose norm is the standard deviation of the portfolio.
  • $\boldsymbol{z}$, $\mathbf{\Sigma}_{z}$: The decision vector z and its covariance matrix sigma_z.
  • $\lambda$: Penalty alg.p.

Arguments

  • alg: The model, a RelaxedRiskBudgetingAlgorithm.
  • model::JuMP.Model: The JuMP optimisation model.
  • n: Number of entries of the budget.
  • Gw: The covariance factor times the weights. Its norm is the standard deviation of the portfolio.
  • z: The decision vector that the penalty of Model (C) reads. It is the weights for AssetRiskBudgeting. For FactorRiskBudgeting it is the factor weights, followed by the off-factor weights when flag = true.
  • sigma_z: Covariance matrix of z.

Returns

  • nothing.

Related

source
PortfolioOptimisers._set_relaxed_risk_budgeting_constraints! — Method
_set_relaxed_risk_budgeting_constraints!(model, rrb, x, A, w, sigma, chol = nothing,
                                         z = w, sigma_z = sigma)

Add the variables, the cones of the budget and the cones on $\psi$ of a RelaxedRiskBudgeting to the model.

Each budgeted weight $x_{i}$ takes one cone with its marginal risk $\zeta_{i} = [\mathbf{A} \boldsymbol{w}]_{i}$, so $x_{i} \zeta_{i}$ is its contribution to the variance. The function then takes the covariance factor $\mathbf{G}$ of sigma, and adds the cones of rrb.alg through set_relaxed_risk_budgeting_alg_constraints!. The callers pass these values:

CallerxAwsigma
AssetRiskBudgetingasset weights$\mathbf{\Sigma}$asset weights$\mathbf{\Sigma}$
FactorRiskBudgeting, flag = falsefactor weights$\mathbf{B}_1^\intercal \mathbf{\Sigma} \mathbf{B}_1$factor weights$\mathbf{B}_1^\intercal \mathbf{\Sigma} \mathbf{B}_1$
FactorRiskBudgeting, flag = truefactor weights$\mathbf{B}_1^\intercal \mathbf{\Sigma}$asset weights$\mathbf{\Sigma}$

JuMP formulation

Variables

  • psi: $\psi \geq 0$.
  • gamma: $\gamma \geq 0$.
  • zeta: $\boldsymbol{\zeta} \geq \boldsymbol{0}$, one entry for each entry of x.

Expressions

  • risk: $\psi - \gamma$, which the objective MinimumRisk minimises.

Constraints

  • crrp: $s_{c} (\boldsymbol{\zeta} - \mathbf{A} \boldsymbol{w}) = \boldsymbol{0}$.
  • crrp_soc[i]: $s_{c} (x_{i} + \zeta_{i}, 2 \gamma \sqrt{b_{i}}, x_{i} - \zeta_{i}) \in \mathcal{K}_{2}$, which is $x_{i} \zeta_{i} \geq b_{i} \gamma^{2}$ with $x_{i} + \zeta_{i} \geq 0$.
  • The rows of set_relaxed_risk_budgeting_alg_constraints!.

Where:

  • $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
  • $\mathcal{K}_{q} = \{(t, \boldsymbol{x}) : t \geq \lVert \boldsymbol{x} \rVert_{q}\}$: Norm cone of order $q$. $\mathcal{K}_{2}$ is the second-order cone.
  • $\boldsymbol{x}$, $\mathbf{A}$, $\boldsymbol{w}$: The arguments x, A and w.
  • $n$: Number of entries of the budget, length(x).
  • $b_{i}$: Share of entry $i$ in the budget, its entry divided by the sum of the entries. The chain of the # Mathematical definition of RelaxedRiskBudgeting needs shares that sum to one, and a RiskBudget built by hand keeps its own sum.

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.

  • The row crrp_soc[i] holds gamma at or below $\min_{i} \sqrt{x_{i} \zeta_{i} / b_{i}}$, and the cones of rrb.alg hold psi at or above the standard deviation of the portfolio. So risk lies at or above the gap between the standard deviation and the least scaled contribution.
  • For BasicRelaxedRiskBudgeting, with no off-factor weights, the bound is tight, and risk is zero, exactly when $x_{i} \zeta_{i} = b_{i} \boldsymbol{w}^\intercal \mathbf{\Sigma} \boldsymbol{w}$ for every $i$. The minimum reaches it when no other row of the model binds at that portfolio.
  • For the regularised models, psi also bounds the regulating term, so the bound is not tight. At a portfolio that meets the budget, risk is at least $(\sqrt{n + 1} - 1)$ times the standard deviation in Model (B).

Arguments

  • model::JuMP.Model: The JuMP optimisation model.
  • rrb::RelaxedRiskBudgeting: The optimiser. The function reads its budget, alg, mtx_sqrt and opt.strict.
  • x::VecJuMPScalar: The budgeted weights, one entry for each entry of the budget.
  • A::MatNum: The matrix that maps w to the marginal risks of x.
  • w::VecJuMPScalar: The weights whose standard deviation the cones on $\psi$ read.
  • sigma::MatNum: Covariance matrix of w.
  • chol::Option{<:MatNum}: Covariance factor of sigma, with chol' * chol == sigma. When it is nothing, the function takes the transpose of the square root of sigma that matrix_square_root gives under rrb.mtx_sqrt.
  • z::VecJuMPScalar: The decision vector that the penalty of RegularisedPenalisedRelaxedRiskBudgeting reads: w, or the factor weights followed by the off-factor weights when flag = true.
  • sigma_z::MatNum: Covariance matrix of z.

Validation

  • The budget has one entry for each entry of x. Otherwise a DimensionMismatch names both lengths.

Returns

  • rkb::RiskBudget: The budget that the cones read.

Related

source
PortfolioOptimisers.set_relaxed_risk_budgeting_constraints! — Function
set_relaxed_risk_budgeting_constraints!(model, rrb, pr, wb, args...)
set_relaxed_risk_budgeting_constraints!(model, rrb, pr, wb, rd::ReturnsResult)

Add the weights and the cones of the model of a RelaxedRiskBudgeting to the model.

The method dispatches on rrb.rba. Each method registers the weights and calls _set_relaxed_risk_budgeting_constraints! with the vectors and the matrices that its budget reads. The weight bounds and the budgets come next, in phase 1 of the block of the head, set_block_constraints!, which assemble_jump_model! runs. The table of _set_relaxed_risk_budgeting_constraints! states the values that each method passes.

JuMP formulation

Variables

Constraints

Where:

  • $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
  • $\boldsymbol{w}_{1}$: Factor weights.
  • $\boldsymbol{w}_2$: Off-factor weights, one entry for each direction of the null space of $\mathbf{B}^\intercal$. There are $N - N_f$ of them when $\mathbf{B}$ has full column rank.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.
  • rrb: The optimiser.
  • pr: Prior result.
  • wb::WeightBounds: Weight bound specification containing lower and upper bounds.
  • rd: Returns data that FactorRiskBudgeting reads when it fits the loadings. The asset method does not read it.

Validation

Returns

Related

source

References

[244]
V. Gambeta and R. Kwon. Risk Return Trade-Off in Relaxed Risk Parity Portfolio Optimization. Journal of Risk and Financial Management 13, 237 (2020).