The programme of a programme Allocation Set

set_allocation_set_constraints! adds the constraints of a ProgrammeAllocationSet to a JuMP model, in the order a JuMP optimiser adds them. The model is the projection of a raw step onto the set of allowed weights. A follow-the-leader rule adds the same constraints to the optimisation it solves again at each period, through a private function that registers them under other names, so the rule keeps its own constraints and gains those of the set. When the projection does not solve, the rule keeps the weights it had after the price moves of the period, so it trades nothing in that period.

PortfolioOptimisers.set_allocation_set_constraints! — Function
set_allocation_set_constraints!(model::JuMP.Model, set::BoundedAllocationSet, w::AbstractVector, X, pr = nothing)
set_allocation_set_constraints!(model::JuMP.Model, set::ProgrammeAllocationSet, w::AbstractVector, X)
set_allocation_set_constraints!(model::JuMP.Model, set::ProgrammeAllocationSet, w::AbstractVector, X, pr)

Adds the constraints of a resolved Allocation Set to the bare projection model.

The model must already hold w, k, the two scales and the observation count. On both kinds of set the function adds the weight bounds and the budget of one. On a ProgrammeAllocationSet it also adds every other kind of the set, through the builders a JuMP optimiser uses and in the order assemble_jump_model! runs them. assemble_allocation_set! lists that order.

projection_programme calls the five-argument form with the prior it fitted and reduced to the Investable Mask. The four-argument form fits the prior on X itself. A JuMP head does not call this function. Its Allocation Set Constraint calls add_allocation_set_constraints!, which runs the same builders under names that do not collide with the head's own. The prior must price every asset the model trades.

Algorithm

  1. In the four-argument form, fit the set's prior pr on X with allocation_set_prior, and call the five-argument form.
  2. Add the weight bounds, the budget of one, and the short and gross budgets with set_allocation_set_bounds!.
  3. On a programme set, add every other kind with assemble_allocation_set! under the empty prefix.

Arguments

  • model::JuMP.Model: The JuMP optimisation model.
  • set: The Allocation Set, resolved once per fold.
  • w: The Price-Adjusted Allocation the step trades from. It is the reference of the turnover ceilings and of a tracking benchmark that is not fixed.
  • X: The rows carrier the head holds through the period, a ReturnsResult, or nothing.
  • pr: The prior result that the slots which read the rows are built on, allocation_set_prior of the set on X, or nothing when the set reads no rows.

Validation

  • A slot that reads the rows, with X === nothing. The four-argument form throws an ArgumentError, because a projection gets the rows only inside an Online Update.
  • A prior whose Investable Mask leaves out an asset the model trades. assert_set_prior_priced throws an ArgumentError.

Returns

  • nothing.

Related

source