Risk budgeting: private API

PortfolioOptimisers.risk_budgeting_td_defaultsFunction
risk_budgeting_td_defaults(

) -> @NamedTuple{r::Variance{RiskMeasureSettings{Float64, Nothing, Bool}, Nothing, Nothing, Nothing, SquaredSOCRiskExpr}, rba::AssetRiskBudgeting{Nothing, Nothing, LogRiskBudgeting{Nothing}}}

Return the static defaults of the RiskBudgeting fields that may hold a TimeDependent.

Shared by the constructor's test-substitution pass and time_dependent_field_defaults, so the fold-less value of a field is declared once. Fields whose static default is nothing are omitted.

Related

source
PortfolioOptimisers.risk_budget_universe_keyFunction
risk_budget_universe_key(rba::RiskBudgetingAlgorithm,
                         N::Integer) -> Option{<:AbstractString}

Return the key of the universe a named risk budget resolves against, or nothing for the asset frame.

The budget vector is indexed by the variables the budget is over, so the universe naming it is a property of the algorithm rather than of the sets: AssetRiskBudgeting budgets the asset weights and takes the default axis, while FactorRiskBudgeting budgets the factor weights w1 and takes the factor axis its own re names, which factor_axis_key reads.

The axis is only read when rba.rkb is a RiskBudgetEstimator — a RiskBudget result carries its own vector and resolves no names, so an unread axis is left unvalidated, as it is in every other consumer of the declared axis. When it is read, factor_universe checks it against N, the number of factor weights, which is size(rr.L, 2): under a DimensionReductionRegression that is the reduced basis the risk is decomposed in and not the columns of F, so a budget named after the original factors is rejected here rather than by a bare DimensionMismatch further down.

Arguments

  • rba: Risk budgeting algorithm.
  • N: Number of budgeted variables, length(w) at the call site.

Returns

  • key::Option{<:AbstractString}: The universe key, or nothing to use sets.xkey.

Related

source
PortfolioOptimisers.set_risk_budgeting_constraints!Function
set_risk_budgeting_constraints!(model, rb, pr, wb, args...)

Add risk budgeting constraints and weight variables to the JuMP model.

Dispatches based on the risk budgeting algorithm and formulation. Sets up weight variables, logarithmic risk budget constraints, and weight bounds for the specified formulation (log, MIP, or factor-based).

Arguments

  • model::JuMP.Model: JuMP optimisation model.
  • rb::RiskBudgeting: Risk budgeting estimator configuration.
  • pr::AbstractPriorResult: Prior result with asset moments.
  • wb::WeightBounds: Weight bounds configuration.
  • args...: Additional arguments (e.g. returns data for factor risk budgeting).

Returns

  • Processed risk budgeting attributes.

Related

source
PortfolioOptimisers.set_rb_mip_w!Function
set_rb_mip_w!(model::JuMP.Model, X::MatNum)

Create long and short weight variables for MIP risk budgeting in the JuMP model.

Registers long lw, short sw weight variables and the derived expressions w = lw - sw and w_obj = lw + sw.

Because w is derived from the parts, this declares a WeightsFromParts decomposition contract for builders that pin the decomposition.

Arguments

  • model::JuMP.Model: JuMP optimisation model.
  • X::MatNum: Asset returns matrix (used to determine number of assets).

Returns

  • nothing.

Related

source