JuMP Optimiser (a): private API

PortfolioOptimisers.jump_optimiser_td_defaults — Function
jump_optimiser_td_defaults(

) -> @NamedTuple{pe::EmpiricalPrior{PortfolioOptimisersCovariance{Covariance{SimpleExpectedReturns{Nothing, Nothing, Nothing}, GeneralCovariance{SimpleCovariance, Nothing, Nothing}, FullMoment, Nothing, Nothing, Nothing}, MatrixProcessing{Posdef{UnionAll, @NamedTuple{}}, Nothing, Nothing, Nothing, NTuple{4, Symbol}}, Nothing}, SimpleExpectedReturns{Nothing, Nothing, Nothing}, Nothing, Nothing, Nothing, Nothing, Nothing}, bgt::Float64, ret::ArithmeticReturn{JuMPReturnsSettings{Float64, Nothing, Bool, Bool, Bool}, Nothing, Nothing, EigenFallbackSquareRoot}, sca::Nothing, wb::WeightBounds{Float64, Float64}}

Returns the static defaults of the JuMPOptimiser fields that can hold a TimeDependent.

The constructor reads them when it checks each entry of a schedule, and time_dependent_field_defaults returns them. So the value of a field outside every fold loop is declared once. A field whose static default is nothing is not in the tuple. A slot of the ConstraintBlock in cbe takes the default of constraint_block_td_defaults, under its flat name.

Returns

  • NamedTuple: The defaults of pe, bgt, ret and sca, and of the slot wb of the block.

Related

source
PortfolioOptimisers.investable_view — Function
investable_view(
    optimiser::JuMPOptimisationEstimator,
    rd::ReturnsResult,
    _::AbstractPriorResult,
    _::Nothing
) -> Tuple{JuMPOptimisationEstimator, ReturnsResult}

Restricts an optimiser head and its returns data to the assets that an Investable Mask keeps.

resolve_jump_optimiser restricts the prior result and every constraint result of the bundle. It cannot restrict the values that the head holds outside the bundle, such as an initial weight vector, a risk measure with data for each asset, a tracking estimator or a custom constraint. These go from the head to assemble_jump_model! directly. So each head calls this function on itself and on rd before it builds a model.

The function does not report the reduction, because investable_reduction reports it once for the bundle.

Algorithm

  1. Check that every UniverseSets in the tree of the head names the columns of rd, in order, with assert_universe_axis_order. The bundle checks the universes of the JuMPOptimiser of the head. This step reaches the universes that the head holds outside it, such as the universe of a risk budget.
  2. When imsk is nothing, every asset is investable. Return optimiser and rd unchanged, with no allocation.
  3. Take the returns matrix X from rd.X, or from pr.X when rd holds no matrix. When the head holds a fitted prior, port_opt_view reads the matrix of that prior and ignores X, so the two choices give the same view.
  4. Find the positions idx = findall(imsk) of the investable assets. Every other caller of port_opt_view passes an index vector, so the function passes one too.
  5. View optimiser at idx with port_opt_view. Then declare the names that the mask leaves out on the Non-Investable Axis of the sets that the head holds, with non_investable_universe. The generic method returns a head with no such sets unchanged. A risk budget keyed by name resolves after this step.
  6. View rd at idx, and return the two views.

Arguments

  • optimiser::JuMPOptimisationEstimator: The optimiser head to view.
  • rd: The returns result to use.
  • pr: Prior result.
  • imsk: The Investable Mask the optimisation reduced on: true at every asset whose prior moments were finite. It is nothing when every asset was investable, and that sentinel is what skips both the reduction and the expansion. investable_mask derives it once from the full-universe prior result, and the result carries it, because the reduced prior can no longer yield it.

Validation

Returns

  • (optimiser, rd): Both restricted to the investable assets, or both unchanged.

Related

source