SDP Constraints: private API
PortfolioOptimisers.weights_prefix — Function
weights_prefix(model::JuMP.Model, prefix::Symbol)Returns the Model State namespace that owns the weights registered under prefix.
One lifted matrix $\mathbf{W}$ belongs to one weight vector, and so do the marks that describe the measures and the phylogenies built on it, variance_flag, rc_variance and sdp_phylogeny. A build that registers weights it did not make also registers w_owner, the namespace that owns them. A later block of a JuMP head, such as the block of a programme Allocation Set in a leader's model, registers the model's own w under its namespace blk_i_ with the owner Symbol(""). A build under DependentVariableTracking registers the weights of its enclosing build under its tracking prefix, with the owner of those weights. So the set's ceiling, the inner measures of the tracking build and the head's measures read one $\mathbf{W}$ and one set of marks. A prefix without w_owner owns itself. An IndependentVariableTracking prefix is one of these, because the benchmark shifts its weights.
Arguments
model::JuMP.Model: The JuMP optimisation model.prefix: The Model State namespace that the weights are registered under.
Returns
owner::Symbol: Thew_ownerentry underprefixwhen there is one, andprefixotherwise.
Related
PortfolioOptimisers.mark_objective_variance! — Function
mark_objective_variance!(
model::Model,
prefix::Symbol,
settings::RiskMeasureSettings
)
Mark variance_flag on the weights under prefix when the variance is a positive term of the objective's risk.
The mark goes to the namespace that owns the weights, weights_prefix. A variance that is only a bound marks nothing. Under MaximumRatio the same condition makes a lifted variance state its term on the lift of set_sdp_objective_lift!, sdp_objective_lift_flag, and the phylogeny then reads that lift. The inner variance of a RiskTrackingRiskMeasure or a RiskTrackingError marks nothing either, because the constructors of both clear the inner rke. The function reads one variance at a time. mark_risk_minimised! reads the role of the objective, and set_sdp_phylogeny_constraints! omits its penalty only when both marks are present.
Mathematical definition
The PSD cone of set_sdp_constraints! bounds $\mathbf{W}$ from below only, and the phylogeny rows leave its diagonal free:
\[\begin{align} \mathbf{W} \succeq \frac{\boldsymbol{w}\boldsymbol{w}^\intercal}{k}\,, \qquad \mathbf{A} \odot \mathbf{W} = \mathbf{0}\,, \qquad A_{ii} = 0\,. \end{align}\]
So the step $\mathbf{W} + t\,\boldsymbol{e}_i\boldsymbol{e}_i^\intercal$ with $t \geq 0$ satisfies both, and it changes a variance term by
\[\begin{align} s\,\mathrm{tr}\left(\boldsymbol{\Sigma}\left(\mathbf{W} + t\,\boldsymbol{e}_i\boldsymbol{e}_i^\intercal\right)\right) - s\,\mathrm{tr}(\boldsymbol{\Sigma}\mathbf{W}) = s\,t\,\Sigma_{ii}\,. \end{align}\]
A variance that the objective minimises with $s > 0$ therefore puts a price on the growth of $\mathbf{W}$, as the phylogeny's penalty $p\,\mathrm{tr}(\mathbf{W})$ does. A bound puts no price on it. The inner variance of a tracking measure enters the model as $|\mathrm{tr}(\boldsymbol{\Sigma}\mathbf{W}) - r_b k|$, which falls as $\mathbf{W}$ grows while the portfolio's variance is below the benchmark's.
Where:
- $\mathbf{W}$: The symmetric $N \times N$ lifted matrix of the weights.
- $\mathbf{A}$: The relatedness matrix of a semidefinite phylogeny, symmetric with a zero diagonal.
- $\boldsymbol{e}_i$: The $i$-th unit vector.
- $t$: The size of the step.
- $s$: The scale of the variance in the objective,
settings.scale. - $\boldsymbol{\Sigma}$: The covariance matrix of the variance.
- $p$: The penalty of the semidefinite phylogeny.
- $r_b$: The variance of the benchmark.
- $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
- $k$: Variable that scales the budget in the homogenised problem.
Arguments
model::JuMP.Model: The JuMP optimisation model.prefix: The Model State namespace of the build. The mark goes to its owner,weights_prefix.settings: The variance's settings. The mark needssettings.rkeandsettings.scale > 0.
Returns
nothing.
Related
PortfolioOptimisers.mark_sdp_phylogeny! — Function
mark_sdp_phylogeny!(
model::Model,
plgs::Union{Nothing, AbstractPhylogenyConstraintResult, AbstractVector{<:AbstractPhylogenyConstraintResult}};
prefix
)
Mark sdp_phylogeny on the weights under prefix when plgs holds a SemiDefinitePhylogeny.
The mark goes to the namespace that owns the weights, weights_prefix. So a block after the first, which registers the weights of the model with the owner Symbol(""), marks the weights of the head. set_block_constraints! calls the function in phase 1 of each block, before the risk step of the owner. assemble_jump_model! also calls it for each block after the first before phase 1 of the head, because a tracking error of the head builds its variance in that phase. sdp_variance_flag! reads the mark, so a variance on the weights takes the semidefinite formulation when any block on them holds a semidefinite phylogeny. The variance then states its term on the lifted matrix that the rows of set_sdp_phylogeny_constraints! bind, and a variance that the objective minimises holds that matrix down.
The mark belongs to the weights and not to one block, because the rows of every block bind the one lifted matrix of the weights. In the model of a leader, the block of a ProgrammeAllocationSet comes after the block of the head. A variance of the head with the second-order cone would leave the lift of the rows of the set to no term. The variance also marks variance_flag, so the rows would get no penalty either, and they would bind nothing.
Arguments
model::JuMP.Model: The JuMP optimisation model.plgs: The phylogeny constraints of the block,nothing, one result, or a vector of results.prefix::Symbol: The Model State namespace of the block. The mark goes to its owner,weights_prefix.
Returns
nothing.
Related
PortfolioOptimisers.mark_risk_minimised! — Function
mark_risk_minimised!(model::JuMP.Model, obj::ObjectiveFunction)Mark risk_minimised when the objective obj minimises the risk term.
assemble_jump_model! calls it after the return constraints, when a MaximumRatio has chosen its form. A variance with the mark of mark_objective_variance! holds the lifted matrix down only when the objective minimises it.
MinimumRiskminimises the risk.MaximumUtilityminimises it whenl > 0.MaximumRatiominimises it in the return form. The risk form registerssr_risk, and the risk is then a bound.- Every other objective, such as
MaximumReturn, leaves the risk out of the objective.
Arguments
model::JuMP.Model: The JuMP optimisation model.obj: The objective that the model builds.
Returns
nothing.
Related
PortfolioOptimisers.set_sdp_constraints! — Function
set_sdp_constraints!(model::Model; prefix) -> Any
Add the positive semidefinite (PSD) cone that lifts the portfolio weights to a matrix variable.
The matrix belongs to the namespace that owns the weights under prefix, weights_prefix, so weights registered twice have one $\mathbf{W}$. A second call for the same owner returns the first call's matrix and adds nothing.
Mathematical definition
\[\begin{align} \mathbf{M} &= \begin{bmatrix} \mathbf{W} & \boldsymbol{w} \\ \boldsymbol{w}^\intercal & k \end{bmatrix} \succeq 0 \\ &\quad\Leftrightarrow\quad \mathbf{W} \succeq \frac{\boldsymbol{w}\boldsymbol{w}^\intercal}{k} \quad \text{for } k > 0\,. \end{align}\]
The equivalence is the Schur complement of $k$. At $k = 0$ the cone forces $\boldsymbol{w} = \mathbf{0}$.
Where:
- $\mathbf{M}$: The bordered $(N + 1) \times (N + 1)$ matrix.
- $\mathbf{W}$: The symmetric $N \times N$ lifted matrix of the weights.
- $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
- $k$: Variable that scales the budget in the homogenised problem. It is $1$ under a unit budget,
effective_k.
JuMP formulation
Variables
w: read, the weights under the owner's namespace.k: read througheffective_k.W: created, a symmetric $N \times N$ matrix, registered asWunder the owner's namespace.
Expressions
M: $\mathbf{M}$, the bordered matrix above.
Constraints
M_PSD: $s_c \mathbf{M} \in \mathcal{S}_{+}^{N + 1}$.
Where:
- $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
- $\mathcal{S}_{+}^{N + 1}$: The cone of positive semidefinite $(N + 1) \times (N + 1)$ matrices.
- Each name carries the owner's namespace as a prefix. It is empty in a head.
Arguments
model::JuMP.Model: The JuMP optimisation model.prefix: The Model State namespace of the build. The entries go to its owner,weights_prefix.
Returns
W: The lifted matrix, a symmetric $N \times N$ matrix of JuMP variables.
Related
PortfolioOptimisers.set_sdp_frc_constraints! — Function
set_sdp_frc_constraints!(model::Model) -> Any
Add the positive semidefinite (PSD) cone that lifts the decision vector of a FactorRiskContribution to a matrix variable.
It is set_sdp_constraints! on the decision vector $\boldsymbol{z}$. That vector is the factor weights $\boldsymbol{w}_1$ when flag = false, and the factor weights followed by the off-factor weights $\boldsymbol{w}_2$ when flag = true. A second call returns the first call's matrix and adds nothing.
The lift covers the whole decision vector because the asset weights are $\mathbf{P} \boldsymbol{z}$, with $\mathbf{P}$ the basis of set_factor_risk_contribution_constraints!. So $\mathrm{tr}(\mathbf{P}^\intercal \mathbf{\Sigma} \mathbf{P} \mathbf{W}_z)$ is the variance of the asset weights at rank one. A lift of $\boldsymbol{w}_1$ alone gives the variance of $\mathbf{B}_1 \boldsymbol{w}_1$ only, and omits the off-factor weights. The leading $N_f \times N_f$ block of $\mathbf{W}_z$ is a lift of $\boldsymbol{w}_1$ by itself, because a principal submatrix of a PSD matrix is PSD. The factor phylogeny reads that block.
Mathematical definition
\[\begin{align} \mathbf{M}_z &= \begin{bmatrix} \mathbf{W}_z & \boldsymbol{z} \\ \boldsymbol{z}^\intercal & k \end{bmatrix} \succeq 0 \\ &\quad\Leftrightarrow\quad \mathbf{W}_z \succeq \frac{\boldsymbol{z}\boldsymbol{z}^\intercal}{k} \quad \text{for } k > 0\,, \\ \boldsymbol{z} &= \begin{cases} \boldsymbol{w}_1 & \text{if } \texttt{flag} = \texttt{false}\,, \\ \begin{bmatrix} \boldsymbol{w}_1 \\ \boldsymbol{w}_2 \end{bmatrix} & \text{if } \texttt{flag} = \texttt{true}\,. \end{cases} \end{align}\]
Where:
- $\mathbf{M}_z$: The bordered $(N_z + 1) \times (N_z + 1)$ matrix.
- $\mathbf{W}_z$: The symmetric $N_z \times N_z$ lifted matrix of the decision vector.
- $\boldsymbol{z}$: The decision vector, of length $N_z$. $N_z = N_f$ when
flag = false, and $N_z = N$ whenflag = true. - $\boldsymbol{w}_1$: Factor weights of
FactorRiskContribution, one entry for each of the $N_f$ factors. The asset weights are $\mathbf{B}_1 \boldsymbol{w}_1$, with $\mathbf{B}_1$ the pseudoinverse of $\mathbf{B}^\intercal$, plus an off-factor block whenflag = true. - $\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.
- $k$: Variable that scales the budget in the homogenised problem.
JuMP formulation
Variables
w1: read, the factor weights.w2: read when present, the off-factor weights.k: read throughget_k.frc_W: created, a symmetric $N_z \times N_z$ matrix.
Expressions
frc_M: $\mathbf{M}_z$, the bordered matrix above.
Constraints
frc_M_PSD: $s_c \mathbf{M}_z \in \mathcal{S}_{+}^{N_z + 1}$.
Where:
- $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
- $\mathcal{S}_{+}^{N_z + 1}$: The cone of positive semidefinite $(N_z + 1) \times (N_z + 1)$ matrices.
Arguments
model::JuMP.Model: The JuMP optimisation model.
Returns
frc_W: The lifted matrix, a symmetric $N_z \times N_z$ matrix of JuMP variables.
Related
PortfolioOptimisers.set_sdp_lift_corner! — Function
set_sdp_lift_corner!(model::JuMP.Model, obj::ObjectiveFunction, pr::AbstractPriorResult)Register sdp_corner, the corner that a lifted variance takes under MaximumRatio when its corner is nothing.
The head calls it after set_maximum_ratio_factor_variables! and before the risk builders. Every other objective registers nothing, and a variance then states its objective term on the lift with the corner $k$, because $k$ is the constant $1$. So the entry also tells a builder that the objective is a ratio. set_sdp_objective_lift! reads it.
The corner sets the scale of the lifted matrix $\mathbf{W}_c$, which is $k^{2} / c$ times a matrix of rank one, and not the weights. The best corner is the $k$ of the solution. The return form fixes $k = \mathrm{ohf} / (\mathrm{ret} - r_f)$, so the function divides ohf by the size of a return. The default ohf is that size, so the corner is $1$ when obj.ohf is nothing.
Mathematical definition
\[\begin{align} c &= \begin{cases} 1 & \text{if } \texttt{obj.ohf} = \texttt{nothing}\,, \\ \dfrac{\mathrm{ohf}}{\min\left(10^{3},\, \max\left(10^{-3},\, \frac{1}{N} \sum_{j=1}^{N} \lvert \mu_j \rvert\right)\right)} & \text{otherwise}\,. \end{cases} \end{align}\]
Where:
- $c$: The derived corner.
- $\mathrm{ohf}$: Normalisation factor of the ratio problem, the model's
:ohf. It is positive. Here it is the statedobj.ohf. - $\mu_j$: Entry $j$ of the expected returns of the prior,
pr.mu. The normalisation ofset_maximum_ratio_normalisation!reads the characteristic of the return terms, which the model resolves after the risk builders. The prior's vector is its value when a single term states no vector of its own. - $N$: Number of assets.
Arguments
model::JuMP.Model: The JuMP optimisation model.obj: The objective. Only aMaximumRatioregisters the corner.pr: Prior result.
Returns
nothing.
Related
PortfolioOptimisers.assert_one_lift_corner — Function
assert_one_lift_corner(c_lift::Number, c::Number)Check that a measure asks the lift for the corner that the lift already holds.
The lift of the objective belongs to one weight vector, as $\mathbf{W}$ does, so every measure on those weights reads one matrix and one corner. The corner does not change the weights, so the measures need not agree on it for the answer. The function refuses a disagreement, because the model can honour only one corner and must not drop the other in silence.
Validation
c_lift == c. Otherwise the function raises anArgumentError.
Returns
nothing.
Related
PortfolioOptimisers.set_sdp_objective_lift! — Function
set_sdp_objective_lift!(
model::Model,
corner::Union{Nothing, Number};
prefix
) -> Any
Add the lift with a constant corner that the objective term of a lifted variance reads under MaximumRatio, and return its lifted matrix.
set_sdp_constraints! states $\mathbf{W} \succeq \boldsymbol{y}\boldsymbol{y}^\intercal / k$. A risk term that is linear in $\mathbf{W}$ then has degree one in $(\boldsymbol{y}, k)$, so MaximumRatio divides the excess return by the risk itself, not by its square root. This lift puts the constant $c$ in the corner, so a term that is linear in $\mathbf{W}_c$ has degree two and gives the ratio of the square root, as the second-order cone variance does. The bound of the measure stays on $\mathbf{W}$, because the row $R \leq u\,k$ needs degree one.
The lift belongs to the namespace that owns the weights under prefix, weights_prefix, as $\mathbf{W}$ does. A second call for the same owner returns the first call's matrix and adds nothing. A semidefinite phylogeny on the same weights reads $\mathbf{W}_c$ when the objective minimises the risk, set_sdp_phylogeny_constraints!.
Mathematical definition
\[\begin{align} \mathbf{M}_c &= \begin{bmatrix} \mathbf{W}_c & \boldsymbol{y} \\ \boldsymbol{y}^\intercal & c \end{bmatrix} \succeq 0 \quad\Leftrightarrow\quad c\,\mathbf{W}_c \succeq \boldsymbol{y}\boldsymbol{y}^\intercal\,. \end{align}\]
Where:
- $\mathbf{M}_c$: The bordered $(N + 1) \times (N + 1)$ matrix.
- $\mathbf{W}_c$: The symmetric $N \times N$ lifted matrix of the objective.
- $c$: The corner,
cornerwhen it is a number and thesdp_cornerofset_sdp_lift_corner!when it isnothing. - $\boldsymbol{y} = k \boldsymbol{w}$: Homogenised weights, the weight variable of the model under the ratio objective.
A term of the objective reads $\mathbf{W}_c$, which is $\boldsymbol{y}\boldsymbol{y}^\intercal / c$ at rank one. So the term is $1 / c$ times the quadratic form in $\boldsymbol{y}$. A constant factor does not move the maximiser of the ratio, and a corner near $k$ keeps the term near the scale of the risk at $k = 1$. A term that is $\boldsymbol{y}^\intercal \mathbf{\Sigma} \boldsymbol{y}$ itself is of the order of $k^{2}$, and a small ohf puts it below the tolerance of the solver.
JuMP formulation
Variables
w: read, the weights under the owner's namespace.lift_W: created, $\mathbf{W}_c$, a symmetric $N \times N$ matrix.
Expressions
lift_M: $\mathbf{M}_c$.
Constraints
lift_M_PSD: $s_c \mathbf{M}_c \in \mathcal{S}_{+}^{N + 1}$.
Where:
- $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
- $\mathcal{S}_{+}^{N + 1}$: The cone of positive semidefinite $(N + 1) \times (N + 1)$ matrices.
- Each name carries the owner's namespace as a prefix. It is empty in a head.
lift_cornerrecords $c$.
Arguments
model::JuMP.Model: The JuMP optimisation model.corner: Thecornerof the measure, a number ornothing.
Keyword arguments
prefix::Symbol: The Model State namespace of the build. The entries go to its owner,weights_prefix.
Validation
- Every call for one owner resolves to one corner,
assert_one_lift_corner.
Returns
W: $\mathbf{W}_c$, a symmetric $N \times N$ matrix of JuMP variables.
Related
PortfolioOptimisers.set_sdp_frc_objective_lift! — Function
set_sdp_frc_objective_lift!(
model::Model,
corner::Union{Nothing, Number}
) -> Any
Add the lift with a constant corner of the decision vector of a FactorRiskContribution, and return its lifted matrix.
It is set_sdp_objective_lift! on the decision vector $\boldsymbol{z}$ of set_sdp_frc_constraints!. A second call returns the first call's matrix and adds nothing. The factor phylogeny reads the leading $N_f \times N_f$ block of $\mathbf{W}_c$ when the objective minimises the risk, set_sdp_frc_phylogeny_constraints!.
Mathematical definition
\[\begin{align} \mathbf{M}_c &= \begin{bmatrix} \mathbf{W}_c & \boldsymbol{z} \\ \boldsymbol{z}^\intercal & c \end{bmatrix} \succeq 0 \quad\Leftrightarrow\quad c\,\mathbf{W}_c \succeq \boldsymbol{z}\boldsymbol{z}^\intercal\,. \end{align}\]
Where:
- $\mathbf{M}_c$: The bordered $(N_z + 1) \times (N_z + 1)$ matrix.
- $\mathbf{W}_c$: The symmetric $N_z \times N_z$ lifted matrix of the objective.
- $\boldsymbol{z}$: The decision vector, the factor weights, followed by the off-factor weights when
flag = true. - $c$: The corner,
cornerwhen it is a number and thesdp_cornerofset_sdp_lift_corner!when it isnothing.
JuMP formulation
Variables
w1: read, the factor weights.w2: read when present, the off-factor weights.lift_frc_W: created, $\mathbf{W}_c$, a symmetric $N_z \times N_z$ matrix.
Expressions
lift_frc_M: $\mathbf{M}_c$.
Constraints
lift_frc_M_PSD: $s_c \mathbf{M}_c \in \mathcal{S}_{+}^{N_z + 1}$.
Where:
- $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
- $\mathcal{S}_{+}^{N_z + 1}$: The cone of positive semidefinite $(N_z + 1) \times (N_z + 1)$ matrices.
lift_frc_cornerrecords $c$.
Arguments
model::JuMP.Model: The JuMP optimisation model.corner: Thecornerof the measure, a number ornothing.
Validation
- Every call resolves to one corner,
assert_one_lift_corner.
Returns
W: $\mathbf{W}_c$, a symmetric $N_z \times N_z$ matrix of JuMP variables.
Related
PortfolioOptimisers.set_sdp_phylogeny_constraints! — Function
set_sdp_phylogeny_constraints!(
model::Model,
plgs::Union{Nothing, AbstractPhylogenyConstraintResult, AbstractVector{<:AbstractPhylogenyConstraintResult}};
prefix
)
Add the rows of each SemiDefinitePhylogeny in plgs on the lifted matrix of the weights.
A semidefinite phylogeny asks that no two linked assets both carry weight. The rows state this on $\mathbf{W}$, and the penalty $p\,\mathrm{tr}(\mathbf{W})$ holds $\mathbf{W}$ down to $\boldsymbol{w}\boldsymbol{w}^\intercal / k$. The function omits the penalty when a variance on the same weights carries the mark of mark_objective_variance! and the objective carries the mark of mark_risk_minimised!, because that variance then puts the same price on the growth of $\mathbf{W}$. A variance that is only a bound, or the inner variance of a tracking measure, keeps the penalty. The function does nothing when plgs holds no SemiDefinitePhylogeny.
Under MaximumRatio a variance in the objective can state its term on the lift of set_sdp_objective_lift!, $\mathbf{W}_c$, and not on $\mathbf{W}$. Nothing then holds $\mathbf{W}$ down, and rows on it bind nothing. So when the objective minimises the risk and that lift exists, the rows read $\mathbf{W}_c$ and the function adds no penalty. The lift exists only for a term that also marks variance_flag. The rows are homogeneous in the matrix, so they hold on either lift.
Algorithm
- Return when
plgsholds noSemiDefinitePhylogeny. - Find
owner, the namespace that owns the weights, withweights_prefix. - When the model carries
risk_minimisedand the liftlift_Wofowner, take that lift asW, and mark it held down. - Otherwise get the lifted matrix
Wfromset_sdp_constraints!, which builds it once for the owner of the weights. It is held down when the model carries bothrisk_minimisedand thevariance_flagofowner. - For each semidefinite entry at position
iofplgs, register the rowsdp_plg_<i>. Skip an entry of another kind. A single entry has position 1. - When
Wis not held down, register the penaltysdp_plg_p_<i>and add it to the objective penalty withadd_to_objective_penalty!.
JuMP formulation
Variables
W: read, the lifted matrix ofset_sdp_constraints!under the owner of the weights, or the liftlift_Wofset_sdp_objective_lift!as step 3 states.
Expressions
sdp_plg_p_<i>: $p\,\mathrm{tr}(\mathbf{W})$, added to the objective penalty. It is absent whenWis held down.
Constraints
sdp_plg_<i>: $s_c\,\mathbf{A} \odot \mathbf{W} = \mathbf{0}$.
Where:
- $\mathbf{W}$: The symmetric $N \times N$ lifted matrix of the weights, $\mathbf{W} \succeq \boldsymbol{w}\boldsymbol{w}^\intercal / k$.
- $\mathbf{A}$: The relatedness matrix of the entry, symmetric with a zero diagonal.
- $p$: The penalty of the entry.
- $i$: Position of the entry in
plgs, or1for a single entry. Each name carriesprefix. - $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
- $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
- $k$: Variable that scales the budget in the homogenised problem.
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 exact rows are $A_{ij}\,w_i w_j = 0$, so at most one asset of a linked pair carries weight. The rows
sdp_plg_<i>bind $\mathbf{W}$ in place of $\boldsymbol{w}\boldsymbol{w}^\intercal / k$. So the weights that they admit include every weight vector that the exact rows admit, and can hold both assets of a linked pair. - The rows are tight when $\mathbf{W} = \boldsymbol{w}\boldsymbol{w}^\intercal / k$, a matrix of rank one. The rows do not force this. The penalty
sdp_plg_p_<i>, or a variance that the objective minimises, puts a price on the growth of $\mathbf{W}$. With $p = 0$ and no such variance, nothing holds $\mathbf{W}$ down. - The penalty is at least $p \lVert \boldsymbol{w} \rVert_2^2 / k$, so it also spreads the weights. A large $p$ can therefore leave $\mathbf{W}$ above rank one and put weight on both assets of a linked pair.
Arguments
model::JuMP.Model: The JuMP optimisation model.plgs: The phylogeny constraints,nothing, one result, or a vector of results.prefix::Symbol: The Model State namespace of the rows and the penalty,Symbol("")for a head's own. The lifted matrix and thevariance_flagthat the function reads belong to the weights,weights_prefix. So a programme Allocation Set's phylogeny in a leader's model reads the leader's $\mathbf{W}$, and only its rows carry the prefix.
Returns
nothing.
Related
PortfolioOptimisers.set_sdp_frc_phylogeny_constraints! — Function
set_sdp_frc_phylogeny_constraints!(
model::Model,
plgs::Union{Nothing, AbstractPhylogenyConstraintEstimator, AbstractPhylogenyConstraintResult, AbstractVector{<:Union{AbstractPhylogenyConstraintEstimator, AbstractPhylogenyConstraintResult}}}
)
Add the rows of each SemiDefinitePhylogeny in plgs on the lifted matrix of the factor weights of a FactorRiskContribution.
It is set_sdp_phylogeny_constraints! on the factor weights, with the same rule for the penalty and for the lift of the objective, lift_frc_W of set_sdp_frc_objective_lift!. The head calls it after assemble_jump_model!, so the marks of the variance and of the objective are present when the function reads them. It reads them in the head's own namespace. The function does nothing when plgs holds no SemiDefinitePhylogeny.
Algorithm
- Return when
plgsholds noSemiDefinitePhylogeny. - When the model carries
risk_minimisedand the liftlift_frc_W, take the leading block of that lift over the factor weights, and mark it held down. - Otherwise get the lifted matrix
frc_Wfromset_sdp_frc_constraints!, and take its leading block over the factor weights. It is held down when the model carries bothrisk_minimisedandvariance_flag. - For each semidefinite entry at position
iofplgs, register the rowfrc_sdp_plg_<i>. Skip an entry of another kind. - When the block is not held down, register the penalty
frc_sdp_plg_p_<i>and add it to the objective penalty withadd_to_objective_penalty!.
JuMP formulation
Variables
frc_W: read, the lifted matrix ofset_sdp_frc_constraints!, orlift_frc_Wofset_sdp_frc_objective_lift!as step 2 states.
Expressions
frc_sdp_plg_p_<i>: $p\,\mathrm{tr}(\mathbf{W}_f)$, added to the objective penalty. It is absent when the block is held down.
Constraints
frc_sdp_plg_<i>: $s_c\,\mathbf{A} \odot \mathbf{W}_f = \mathbf{0}$.
Where:
- $\mathbf{W}_f$: The leading $N_f \times N_f$ block of
frc_W, the lifted matrix of the factor weights, $\mathbf{W}_f \succeq \boldsymbol{w}_1\boldsymbol{w}_1^\intercal / k$. It is the whole offrc_Wwhenflag = false. - $\boldsymbol{w}_1$: Factor weights of
FactorRiskContribution, one entry for each of the $N_f$ factors. The asset weights are $\mathbf{B}_1 \boldsymbol{w}_1$, with $\mathbf{B}_1$ the pseudoinverse of $\mathbf{B}^\intercal$, plus an off-factor block whenflag = true. - $\mathbf{A}$: The relatedness matrix of the entry over the factors, symmetric with a zero diagonal.
- $p$: The penalty of the entry.
- $i$: Position of the entry in
plgs, or1for a single entry. - $s_c$: Constraint scale. It multiplies both sides of a row, so a positive value leaves the feasible set unchanged.
- $k$: Variable that scales the budget in the homogenised problem.
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 rows
frc_sdp_plg_<i>bind $\mathbf{W}_f$ in place of $\boldsymbol{w}_1\boldsymbol{w}_1^\intercal / k$, as the rows ofset_sdp_phylogeny_constraints!bind $\mathbf{W}$. So the factor weights that they admit can hold both factors of a linked pair. - The rows are tight when $\mathbf{W}_f = \boldsymbol{w}_1\boldsymbol{w}_1^\intercal / k$. The penalty
frc_sdp_plg_p_<i>, or a variance that the objective minimises, holds $\mathbf{W}_f$ down, and it spreads the factor weights as the asset penalty spreads the weights.
Arguments
model::JuMP.Model: The JuMP optimisation model.plgs: The phylogeny constraints on the factors,nothing, one result, or a vector of results.
Returns
nothing.
Related