Risk Measure Tools
PortfolioOptimisers.no_bounds_risk_measure — Function
no_bounds_risk_measure(r)Return a copy of risk measure r with no bound, and with its scale and its risk-expression flag kept.
Generic function extended by concrete risk measure types. It builds no model. A HierarchicalRiskMeasure and a NonOptimisationRiskMeasure return unchanged.
Related
PortfolioOptimisers.no_bounds_no_risk_expr_risk_measure — Function
no_bounds_no_risk_expr_risk_measure(r)Return a copy of risk measure r with no bound, with its risk-expression flag disabled and with a unit scale.
Generic function extended by concrete risk measure types. It builds no model. A HierarchicalRiskMeasure and a NonOptimisationRiskMeasure return unchanged.
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, and with its bound and its scale kept.
Generic function extended by concrete risk measure types. A HierarchicalRiskMeasure and a NonOptimisationRiskMeasure return unchanged.
Related
PortfolioOptimisers.bounds_risk_measure — Function
bounds_risk_measure(r, ub, args...; kwargs...)Return a copy of risk measure r with its bound set to ub.
Generic function extended by concrete risk measure types. The bound is the ub of a RiskMeasureSettings, and the lb of a MaxRiskMeasureSettings. A HierarchicalRiskMeasure and a NonOptimisationRiskMeasure return unchanged.
Related
PortfolioOptimisers.unit_scale_risk_measure — Function
unit_scale_risk_measure(r::AbstractBaseRiskMeasure)Return a copy of the risk measure r with scale = one(scale), and keep its bound and rke.
scale weighs one measure against the other measures of a vector. One measure has no other measure to weigh against, so set_risk_constraints! takes this copy before it builds the risk of one measure. A field that the table does not name keeps its value.
| Measure | Changed | Kept |
|---|---|---|
RiskMeasure, VarianceSkewKurtosis, GenericValueatRiskRange and UncertaintySetVariance among them | settings.scale = one(settings.scale) | settings.ub, settings.rke, and every field of each child |
Skewness | settings.scale = one(settings.scale) | settings.lb, settings.rke |
HierarchicalRiskMeasure, NonOptimisationRiskMeasure | nothing | every field |
VarianceSkewKurtosis and GenericValueatRiskRange keep the scale of each child, because that scale weighs the term of the child inside its parent. A measure that already has a unit scale returns as r itself, with no copy.
Arguments
r: The risk measure.
Returns
r_new: The measure with a unitscale.
Examples
julia> r = ConditionalValueatRisk(; settings = RiskMeasureSettings(; ub = 0.1, scale = 2.0));julia> unit_scale_risk_measure(r).settingsRiskMeasureSettings scale ┼ Float64: 1.0 ub ┼ Float64: 0.1 rke ┴ Bool: trueRelated