Risk Measure Tools
PortfolioOptimisers.no_bounds_risk_measure — Function
no_bounds_risk_measure(r, args...; kwargs...)Add a risk measure to a JuMP model without upper-bound constraints.
Generic function extended by concrete risk measure types.
Related
PortfolioOptimisers.no_bounds_no_risk_expr_risk_measure — Function
no_bounds_no_risk_expr_risk_measure(r, args...; kwargs...)Add a risk measure to a JuMP model without upper-bound constraints and without adding a risk expression variable.
Generic function extended by concrete risk measure types.
Related
PortfolioOptimisers.no_risk_expr_risk_measure — Function
no_risk_expr_risk_measure(r, args...; kwargs...)Return a copy of risk measure r with its risk-expression flag disabled while preserving its upper-bound constraint.
Generic function extended by concrete risk measure types. For hierarchical risk measures, returns r unchanged.
Related
PortfolioOptimisers.bounds_risk_measure — Function
bounds_risk_measure(r, ub, args...; kwargs...)Return a copy of risk measure r with its upper-bound constraint set to ub.
Generic function extended by concrete risk measure types. For hierarchical risk measures, returns r unchanged.
Related
PortfolioOptimisers.unit_scale_risk_measure — Function
unit_scale_risk_measure(r)Return a copy of risk measure r with its scale set to one(scale), preserving its upper bound and its rke flag. A measure that already carries a unit scale is returned unchanged, so the common path allocates nothing.
scale is a combination weight: it says how much this measure contributes to an aggregate built from several measures. One measure is not an aggregate, so the weight has nothing to weigh and the model drops it before it can reach the risk expression. Hierarchical risk measures are returned unchanged.
Arguments
r: Risk measure.
Returns
- Risk measure carrying a unit scale.
Related
PortfolioOptimisers.measure_label — Function
measure_label(r::AbstractBaseRiskMeasure) -> String
measure_label(rs::VecBaseRM) -> StringName a risk measure for an axis label, a title, or a legend entry.
One measure answers its own type name. A vector answers its elements' names joined by " + ".
The vector arm is the reason the helper exists. string(nameof(typeof(rs))) on a vector evaluates to "Vector" — a wrong label, silently, with no error — and seven plot sites spelled that expression inline. Writing the rule once means a future measure-taking plot inherits it.
Related
PortfolioOptimisers.MomentRiskMeasures — Type
const MomentRiskMeasures{T} = Union{<:LowOrderMoment{<:Any, T}, <:HighOrderMoment{<:Any, T}, <:Kurtosis{<:Any, T}, <:Skewness{<:Any, <:Any, <:Any, T}, <:ThirdCentralMoment{<:Any, T}}Parameterised union of the five central-moment risk measures sharing the same observation-weight (T) type parameter.
The members are LowOrderMoment, HighOrderMoment, Kurtosis, Skewness and ThirdCentralMoment. Each evaluates the same way — deviations from the centring target, then moment_risk — and each resolves a DynamicAbstractWeights the same way, so the four functor methods are written once here rather than four times per measure.
T selects the arm:
Option{<:StatsBase.AbstractWeights}: the weights are resolved, so the measure computes.<:DynamicAbstractWeights: the weights are not resolved, so the measure resolves them against the data it was handed and re-calls itself.
The rebuild replaces w and copies every other field, so it names no field list and cannot drop a field. The ten hand-written rebuilds it replaces did: Skewness reset its settings, and Kurtosis bound its rebuild to SemiMoment, which left a default Kurtosis carrying dynamic weights matching no method at all.
Related