Risk budgeting: private API
PortfolioOptimisers.ProcessedRiskBudgetingAttributes — Type
abstract type ProcessedRiskBudgetingAttributes <: ProcessedAttributesAbstract supertype for processed risk budgeting attributes. Every collection of processed risk budgeting attributes should subtype this.
Related
PortfolioOptimisers.RiskBudgetingFormulation — Type
abstract type RiskBudgetingFormulation <: OptimisationAlgorithmAbstract supertype for risk budgeting optimisation formulations.
Related
PortfolioOptimisers.RiskBudgetingAlgorithm — Type
abstract type RiskBudgetingAlgorithm <: OptimisationAlgorithmAbstract supertype for risk budgeting algorithm specifications.
Related
PortfolioOptimisers.ProcessedFactorRiskBudgetingAttributes — Type
struct ProcessedFactorRiskBudgetingAttributes{__T_rkb, __T_b1, __T_rr} <: ProcessedRiskBudgetingAttributesProcessed factor risk budgeting attributes for intermediate computations.
Fields
rkb: Processed risk budget constraints vector.
b1: Factor-level risk budget vector.
rr: Regression result used for factor loading estimation.
Related
PortfolioOptimisers.ProcessedAssetRiskBudgetingAttributes — Type
struct ProcessedAssetRiskBudgetingAttributes{__T_rkb} <: ProcessedRiskBudgetingAttributesProcessed asset risk budgeting attributes for intermediate computations.
Fields
rkb: Processed asset risk budget constraints vector.
Related
PortfolioOptimisers.risk_budgeting_td_defaults — Function
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
PortfolioOptimisers.risk_budget_universe_key — Function
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, ornothingto usesets.xkey.
Related
PortfolioOptimisers._set_risk_budgeting_constraints! — Method
_set_risk_budgeting_constraints!(model, rb, ...)Internal function to set risk budgeting constraints in the JuMP model.
Configures the equality constraints ensuring each asset's marginal risk contribution equals its budget target.
Arguments
model: JuMP model.rb:RiskBudgetingoptimiser configuration.- Additional risk and budget parameters.
Returns
nothing.
Related
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
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