Skip to content
13

Risk budgeting

PortfolioOptimisers.RiskBudgetingResult Type
julia
struct RiskBudgetingResult{__T_oe, __T_pa, __T_prb, __T_retcode, __T_sol, __T_model, __T_fb} <: NonFiniteAllocationOptimisationResult

Result 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

source
PortfolioOptimisers.ProcessedFactorRiskBudgetingAttributes Type
julia
struct ProcessedFactorRiskBudgetingAttributes{__T_rkb, __T_b1, __T_rr} <: AbstractResult

Processed factor risk budgeting attributes for intermediate computations.

Related

source
PortfolioOptimisers.ProcessedAssetRiskBudgetingAttributes Type
julia
struct ProcessedAssetRiskBudgetingAttributes{__T_rkb} <: AbstractResult

Processed asset risk budgeting attributes for intermediate computations.

Related

source
PortfolioOptimisers.RiskBudgetingFormulation Type
julia
abstract type RiskBudgetingFormulation <: OptimisationAlgorithm

Abstract supertype for risk budgeting optimisation formulations.

Related Types

source
PortfolioOptimisers.LogRiskBudgeting Type
julia
struct LogRiskBudgeting{T} <: RiskBudgetingFormulation

Log-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

source
PortfolioOptimisers.MixedIntegerRiskBudgeting Type
julia
struct MixedIntegerRiskBudgeting <: RiskBudgetingFormulation

Mixed-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

source
PortfolioOptimisers.RiskBudgetingAlgorithm Type
julia
abstract type RiskBudgetingAlgorithm <: OptimisationAlgorithm

Abstract supertype for risk budgeting algorithm specifications.

Related Types

source
PortfolioOptimisers.AssetRiskBudgeting Type
julia
struct AssetRiskBudgeting{__T_rkb, __T_sets, __T_alg} <: RiskBudgetingAlgorithm

Asset-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 when rkb is a RiskBudgetEstimator).

  • alg: Risk budgeting formulation.

Constructors

julia
AssetRiskBudgeting(;
    rkb::Option{<:RkbE_Rkb} = nothing,
    sets::Option{<:AssetSets} = nothing,
    alg::RiskBudgetingFormulation = LogRiskBudgeting()
) -> AssetRiskBudgeting

Keywords correspond to the struct's fields.

Related

source
PortfolioOptimisers.FactorRiskBudgeting Type
julia
struct FactorRiskBudgeting{__T_re, __T_rkb, __T_sets, __T_flag} <: RiskBudgetingAlgorithm

Factor-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 when rkb is a RiskBudgetEstimator).

  • flag: If true, includes the idiosyncratic component in the budget.

Constructors

julia
FactorRiskBudgeting(;
    re::RegE_Reg = StepwiseRegression(),
    rkb::Option{<:RkbE_Rkb} = nothing,
    sets::Option{<:AssetSets} = nothing,
    flag::Bool = true
) -> FactorRiskBudgeting

Keywords correspond to the struct's fields.

Related

source
PortfolioOptimisers.RiskBudgeting Type
julia
struct RiskBudgeting{__T_opt, __T_r, __T_rba, __T_wi, __T_fb} <: RiskJuMPOptimisationEstimator

Risk 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 (AssetRiskBudgeting or FactorRiskBudgeting).

  • wi: Initial weights for warm-starting.

  • fb: Fallback optimiser.

Constructors

julia
RiskBudgeting(;
    opt::JuMPOptimiser = JuMPOptimiser(),
    r::RM_VecRM = Variance(),
    rba::RiskBudgetingAlgorithm = AssetRiskBudgeting(),
    wi::Option{<:VecNum} = nothing,
    fb::Option{<:OptE_Opt} = nothing
) -> RiskBudgeting

Keywords correspond to the struct's fields.

Related

source
PortfolioOptimisers.risk_budgeting_algorithm_view Method
julia
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

Returns

  • Sliced risk budgeting algorithm.

Related

source
PortfolioOptimisers.risk_budgeting_algorithm_view Method
julia
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

  • FactorRiskBudgeting with the regression estimator sliced to cluster i.

Related

source
PortfolioOptimisers.set_risk_budgeting_constraints! Function
julia
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
julia
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

source
PortfolioOptimisers.optimise Function
julia
optimise(rb::RiskBudgeting{<:Any, <:Any, <:Any, <:Any, Nothing},
         rd::ReturnsResult = ReturnsResult(); dims::Int = 1,
         str_names::Bool = false, save::Bool = true, kwargs...) -> RiskBudgetingResult

Arguments

  • rb: The risk budgeting optimiser to use.

  • rd: The returns result to use. If isa(hec.opt.pe, AbstractPriorResult), rd is 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.

source