Risk budgeting
PortfolioOptimisers.RiskBudgetingResult Type
struct RiskBudgetingResult{__T_oe, __T_pa, __T_prb, __T_retcode, __T_sol, __T_model, __T_fb} <: NonFiniteAllocationOptimisationResultResult type for Risk Budgeting portfolio optimisation.
Fields
oe: Type of the optimisation estimator that produced this result.pa: Processed optimisation attributes.prb: Processed risk budgeting attributes.retcode: Optimisation return code.sol: JuMP model solution.model: The JuMP model.fb: Fallback result.
The w property is forwarded from sol.w.
Related
sourcePortfolioOptimisers.ProcessedFactorRiskBudgetingAttributes Type
struct ProcessedFactorRiskBudgetingAttributes{__T_rkb, __T_b1, __T_rr} <: AbstractResultProcessed factor risk budgeting attributes for intermediate computations.
Related
sourcePortfolioOptimisers.ProcessedAssetRiskBudgetingAttributes Type
struct ProcessedAssetRiskBudgetingAttributes{__T_rkb} <: AbstractResultProcessed asset risk budgeting attributes for intermediate computations.
Related
sourcePortfolioOptimisers.RiskBudgetingFormulation Type
abstract type RiskBudgetingFormulation <: OptimisationAlgorithmAbstract supertype for risk budgeting optimisation formulations.
Related Types
sourcePortfolioOptimisers.LogRiskBudgeting Type
struct LogRiskBudgeting{T} <: RiskBudgetingFormulationLog-barrier formulation for Risk Budgeting.
Uses a logarithmic objective to enforce the risk budget constraints. Can provide an optional orthant vector to allow for negative weights in specific assets.
Arguments
z::Option{<:VecInt}: Optional orthant vector defining which asset can have negative weights. If nothing all assets will have positive weights.
Related Types
sourcePortfolioOptimisers.MixedIntegerRiskBudgeting Type
struct MixedIntegerRiskBudgeting <: RiskBudgetingFormulationMixed-integer formulation for Risk Budgeting.
Uses binary variables and big-M constraints to enforce the risk budget constraints. This can find the minimal risk portfolio which meets the risk budgeting constraints by exploring all possible sign combinations of weights. This can be very expensive for large universes.
Related Types
sourcePortfolioOptimisers.RiskBudgetingAlgorithm Type
abstract type RiskBudgetingAlgorithm <: OptimisationAlgorithmAbstract supertype for risk budgeting algorithm specifications.
Related Types
sourcePortfolioOptimisers.AssetRiskBudgeting Type
struct AssetRiskBudgeting{__T_rkb, __T_sets, __T_alg} <: RiskBudgetingAlgorithmAsset-level Risk Budgeting algorithm.
AssetRiskBudgeting specifies the risk budget as a vector of asset-level risk targets, optionally grouped by asset sets.
Fields
rkb: Risk budget estimator or risk budget constraints.sets: Asset sets (required whenrkbis aRiskBudgetEstimator).alg: Risk budgeting formulation.
Constructors
AssetRiskBudgeting(;
rkb::Option{<:RkbE_Rkb} = nothing,
sets::Option{<:AssetSets} = nothing,
alg::RiskBudgetingFormulation = LogRiskBudgeting()
) -> AssetRiskBudgetingKeywords correspond to the struct's fields.
Related
sourcePortfolioOptimisers.FactorRiskBudgeting Type
struct FactorRiskBudgeting{__T_re, __T_rkb, __T_sets, __T_flag} <: RiskBudgetingAlgorithmFactor-level Risk Budgeting algorithm.
FactorRiskBudgeting specifies the risk budget at the factor level, using a factor model regression to decompose risk across factors and an idiosyncratic component.
Fields
re: Regression estimator for factor loadings.rkb: Risk budget estimator or risk budget constraints.sets: Asset sets (required whenrkbis aRiskBudgetEstimator).flag: Iftrue, includes the idiosyncratic component in the budget.
Constructors
FactorRiskBudgeting(;
re::RegE_Reg = StepwiseRegression(),
rkb::Option{<:RkbE_Rkb} = nothing,
sets::Option{<:AssetSets} = nothing,
flag::Bool = true
) -> FactorRiskBudgetingKeywords correspond to the struct's fields.
Related
sourcePortfolioOptimisers.RiskBudgeting Type
struct RiskBudgeting{__T_opt, __T_r, __T_rba, __T_wi, __T_fb} <: RiskJuMPOptimisationEstimatorRisk Budgeting (RB) portfolio optimiser.
RiskBudgeting allocates portfolio weights so that each asset (or factor) contributes a specified fraction of the total portfolio risk. It uses a logarithmic or mixed-integer formulation and can be combined with any risk measure.
Fields
opt: JuMP optimiser configuration.r: Risk measure or vector of risk measures.rba: Risk budgeting algorithm (AssetRiskBudgetingorFactorRiskBudgeting).wi: Initial weights for warm-starting.fb: Fallback optimiser.
Constructors
RiskBudgeting(;
opt::JuMPOptimiser = JuMPOptimiser(),
r::RM_VecRM = Variance(),
rba::RiskBudgetingAlgorithm = AssetRiskBudgeting(),
wi::Option{<:VecNum} = nothing,
fb::Option{<:OptE_Opt} = nothing
) -> RiskBudgetingKeywords correspond to the struct's fields.
Related
PortfolioOptimisers.risk_budgeting_algorithm_view Method
risk_budgeting_algorithm_view(r, i)Return a view or subset of a risk budgeting algorithm for cluster index i.
Used in hierarchical optimisation to slice risk budget and asset set configurations for each cluster.
Arguments
r: Risk budgeting algorithm (AssetRiskBudgetingorFactorRiskBudgeting).i: Cluster or asset index.
Returns
- Sliced risk budgeting algorithm.
Related
sourcePortfolioOptimisers.risk_budgeting_algorithm_view Method
risk_budgeting_algorithm_view(r::FactorRiskBudgeting, i)Return a view of a FactorRiskBudgeting algorithm for cluster index i.
Slices the regression estimator for the given cluster while keeping the risk budget, asset sets, and idiosyncratic flag unchanged.
Arguments
r::FactorRiskBudgeting: Factor-level risk budgeting algorithm.i: Cluster or asset index.
Returns
FactorRiskBudgetingwith the regression estimator sliced to clusteri.
Related
sourcePortfolioOptimisers.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
sourcePortfolioOptimisers.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.
Arguments
model::JuMP.Model: JuMP optimisation model.X::MatNum: Asset returns matrix (used to determine number of assets).
Returns
nothing.
Related
sourcePortfolioOptimisers.optimise Function
optimise(rb::RiskBudgeting{<:Any, <:Any, <:Any, <:Any, Nothing},
rd::ReturnsResult = ReturnsResult(); dims::Int = 1,
str_names::Bool = false, save::Bool = true, kwargs...) -> RiskBudgetingResultArguments
rb: The risk budgeting optimiser to use.rd: The returns result to use. Ifisa(hec.opt.pe, AbstractPriorResult),rdis not necessary if doing a standalone optimisation, but may be required/desired by fallbacks and/or clusterisation.dims: The dimension along which observations advance in time.str_names: Whether to use string names for the assets in the optimisation.save: Whether to save the JuMP model in the optimisation result.kwargs: Additional keyword arguments passed to the optimisation function.