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 ofpe,bgt,retandsca, and of the slotwbof the block.
Related
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
- Check that every
UniverseSetsin the tree of the head names the columns ofrd, in order, withassert_universe_axis_order. The bundle checks the universes of theJuMPOptimiserof the head. This step reaches the universes that the head holds outside it, such as the universe of a risk budget. - When
imskisnothing, every asset is investable. Returnoptimiserandrdunchanged, with no allocation. - Take the returns matrix
Xfromrd.X, or frompr.Xwhenrdholds no matrix. When the head holds a fitted prior,port_opt_viewreads the matrix of that prior and ignoresX, so the two choices give the same view. - Find the positions
idx = findall(imsk)of the investable assets. Every other caller ofport_opt_viewpasses an index vector, so the function passes one too. - View
optimiseratidxwithport_opt_view. Then declare the names that the mask leaves out on the Non-Investable Axis of the sets that the head holds, withnon_investable_universe. The generic method returns a head with no such sets unchanged. A risk budget keyed by name resolves after this step. - View
rdatidx, 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:trueat every asset whose prior moments were finite. It isnothingwhen every asset was investable, and that sentinel is what skips both the reduction and the expansion.investable_maskderives it once from the full-universe prior result, and the result carries it, because the reduced prior can no longer yield it.
Validation
- The rules of
assert_universe_axis_order.
Returns
(optimiser, rd): Both restricted to the investable assets, or both unchanged.
Related