Variance Skew Kurtosis
PortfolioOptimisers.MaxRiskMeasureSettings Type
struct MaxRiskMeasureSettings{__T_scale, __T_lb, __T_rke} <: JuMPRiskMeasureSettingsSettings type for configuring risk measures that expose a lower bound (maximisation direction).
Encapsulates scaling, lower bounds, and risk evaluation flags for risk measures such as Skewness that are maximised in optimisation routines. The lb field holds an optional lower bound on the risk expression; when set, the optimiser enforces the risk is at least that value.
Fields
scale: Scaling factor applied to the risk measure.lb: Lower bound(s) for the risk measure. Can be a scalar, vector, orFrontier.rke: Whether to include the risk measure value in theJuMPrisk expression.
Constructors
MaxRiskMeasureSettings(;
scale::Number = 1.0,
lb::Option{<:RkRtBounds} = nothing,
rke::Bool = true,
) -> MaxRiskMeasureSettingsKeywords correspond to the struct's fields.
Validation
isfinite(scale).
Examples
julia> MaxRiskMeasureSettings()
MaxRiskMeasureSettings
scale ┼ Float64: 1.0
lb ┼ nothing
rke ┴ Bool: trueRelated
sourcePortfolioOptimisers.Skewness Type
struct Skewness{__T_settings, __T_ve, __T_sk, __T_w, __T_mu} <: NonOptimisationRiskMeasureRepresents the standardised Skewness risk measure.
Skewness computes the third standardised central moment (skewness) of portfolio returns. Positive skewness is preferred (the distribution is skewed towards more positive values), so bigger_is_better returns true for this measure.
Mathematical definition
Let
Where:
: Standardised skewness of portfolio returns. : Portfolio returns vector . : Number of observations. : Specified centre of the distribution. : Centred deviation at period . : Standard deviation of returns.
Fields
settings: Risk measure settings.ve: Variance estimator.sk: Coskewness matrixfeatures × features^2.w: Optional portfolio weights.mu: Optional mean for centering.
Constructors
Skewness(;
settings::MaxRiskMeasureSettings = MaxRiskMeasureSettings(),
ve::AbstractVarianceEstimator = SimpleVariance(),
sk::Option{<:MatNum} = nothing,
w::Option{<:ObsWeights} = nothing,
mu::Option{<:Num_VecNum_VecScalar} = nothing
) -> SkewnessKeywords correspond to the struct's fields.
Validation
If
skis notnothing:!isempty(sk)andsize(sk, 1)^2 == size(sk, 2).If
muis aVecNum:!isempty(mu).If
wis notnothing:!isempty(w).
Functor
(r::Skewness)(w::VecNum, X::MatNum, fees = nothing)Computes the skewness of the portfolio returns.
Arguments
w: Portfolio weights vectorassets × 1.X::MatNum: Asset returns matrix (). fees: Optional fee structure.
Examples
julia> Skewness()
Skewness
settings ┼ MaxRiskMeasureSettings
│ scale ┼ Float64: 1.0
│ lb ┼ nothing
│ rke ┴ Bool: true
ve ┼ SimpleVariance
│ me ┼ SimpleExpectedReturns
│ │ w ┴ nothing
│ w ┼ nothing
│ corrected ┴ Bool: true
sk ┼ nothing
w ┼ nothing
mu ┴ nothingRelated
PortfolioOptimisers.bigger_is_better Method
bigger_is_better(_::Skewness) -> BoolReturn true because higher skewness is preferred over lower skewness.
Related
sourcePortfolioOptimisers.factory Method
factory(
r::Skewness,
pr::HighOrderPrior,
args...;
kwargs...
) -> Skewness{MaxRiskMeasureSettings{Float64, Nothing, Bool}, <:AbstractVarianceEstimator}Create an instance of Skewness by selecting observation weights and expected returns from the risk-measure instance or falling back to the prior result.
Related
sourcePortfolioOptimisers.factory Method
factory(r::Skewness, pr::LowOrderPrior, args...; kwargs...)Create an instance of Skewness from a LowOrderPrior result, selecting observation weights and expected returns while preserving the coskewness matrix from the risk measure.
Related
sourcePortfolioOptimisers.port_opt_view Method
port_opt_view(
r::Skewness{<:Any, <:Any, <:Nothing},
i,
args...
) -> Skewness{MaxRiskMeasureSettings{Float64, Nothing, Bool}, <:AbstractVarianceEstimator, Nothing}Return a view of Skewness r sliced to asset indices i.
Slices the expected returns mu for cluster-based optimisation.
Related
sourcePortfolioOptimisers.port_opt_view Method
port_opt_view(
r::Skewness{<:Any, <:Any, <:AbstractMatrix{<:Union{var"#s20", var"#s19"} where {var"#s20"<:Number, var"#s19"<:AbstractJuMPScalar}}},
i,
args...
) -> Skewness{MaxRiskMeasureSettings{Float64, Nothing, Bool}, <:AbstractVarianceEstimator}Return a view of Skewness r sliced to asset indices i, also slicing the coskewness matrix sk.
Related
PortfolioOptimisers.no_risk_expr_risk_measure Method
no_risk_expr_risk_measure(
r::Skewness
) -> Skewness{MaxRiskMeasureSettings{__T_scale, __T_lb, Bool}, <:AbstractVarianceEstimator} where {__T_scale, __T_lb}Return a copy of Skewness r with rke = false, disabling its contribution to the JuMP objective expression.
Related
sourcePortfolioOptimisers.no_bounds_no_risk_expr_risk_measure Method
no_bounds_no_risk_expr_risk_measure(
r::Skewness
) -> Skewness{MaxRiskMeasureSettings{Int64, Nothing, Bool}, <:AbstractVarianceEstimator}
no_bounds_no_risk_expr_risk_measure(
r::Skewness,
) -> Skewness{MaxRiskMeasureSettings{Int64, Nothing, Bool}, <:AbstractVarianceEstimator}Return a copy of Skewness r with rke = false and lb = nothing, removing bounds and disabling its contribution to the JuMP objective expression.
Related
sourcePortfolioOptimisers.bounds_risk_measure Method
bounds_risk_measure(
r::Skewness,
ub::Number
) -> Skewness{MaxRiskMeasureSettings{var"#s179", var"#s1791", Bool}, <:AbstractVarianceEstimator} where {var"#s179"<:Number, var"#s1791"<:Number}Return a copy of Skewness r with the lower bound set to ub.
Related
sourcePortfolioOptimisers.VarianceSkewKurtosis Type
struct VarianceSkewKurtosis{__T_settings, __T_vr, __T_sk, __T_kt} <: RiskMeasureComposite risk measure combining variance, skewness, and kurtosis into a single expression.
VarianceSkewKurtosis encodes the joint SDP formulation
Mathematical definition
Where:
: Portfolio variance (via Variance).: Standardised portfolio skewness (via Skewness).: Portfolio kurtosis (via Kurtosis).: Respective scale factors from each sub-measure's settings.
Fields
settings: Risk measure settings.vr: Variance risk measure component.sk: Skewness risk measure component.kt: Kurtosis risk measure component.
Constructors
VarianceSkewKurtosis(;
settings::RiskMeasureSettings = RiskMeasureSettings(),
vr::Variance = Variance(),
sk::Skewness = Skewness(),
kt::Kurtosis = Kurtosis()
) -> VarianceSkewKurtosisKeywords correspond to the struct's fields.
Examples
julia> r = VarianceSkewKurtosis()
VarianceSkewKurtosis
settings ┼ RiskMeasureSettings
│ scale ┼ Float64: 1.0
│ ub ┼ nothing
│ rke ┴ Bool: true
vr ┼ Variance
│ settings ┼ RiskMeasureSettings
│ │ scale ┼ Float64: 1.0
│ │ ub ┼ nothing
│ │ rke ┴ Bool: false
│ sigma ┼ nothing
│ chol ┼ nothing
│ rc ┼ nothing
│ alg ┴ SquaredSOCRiskExpr()
sk ┼ Skewness
│ settings ┼ MaxRiskMeasureSettings
│ │ scale ┼ Float64: 1.0
│ │ lb ┼ nothing
│ │ rke ┴ Bool: false
│ ve ┼ SimpleVariance
│ │ me ┼ SimpleExpectedReturns
│ │ │ w ┴ nothing
│ │ w ┼ nothing
│ │ corrected ┴ Bool: true
│ sk ┼ nothing
│ w ┼ nothing
│ mu ┴ nothing
kt ┼ Kurtosis
│ settings ┼ RiskMeasureSettings
│ │ scale ┼ Float64: 1.0
│ │ ub ┼ nothing
│ │ rke ┴ Bool: false
│ w ┼ nothing
│ mu ┼ nothing
│ kt ┼ nothing
│ N ┼ nothing
│ alg1 ┼ Full()
│ alg2 ┴ SOCRiskExpr()Functor
(r::VarianceSkewKurtosis)(w::VecNum, X::MatNum, fees = nothing)Computes the variance skewness kurtosis composite risk measure of the portfolio returns.
Arguments
w: Portfolio weights vectorassets × 1.X::MatNum: Asset returns matrix (). fees: Optional fee structure.
Related
sourcePortfolioOptimisers.factory Method
factory(
r::VarianceSkewKurtosis,
pr::AbstractPriorResult,
args...;
kwargs...
) -> VarianceSkewKurtosis{RiskMeasureSettings{__T_scale, __T_ub, __T_rke}, Variance{__T_settings, __T_sigma, __T_chol, __T_rc, __T_alg}, Skewness{__T_settings1, __T_ve, __T_sk, __T_w, __T_mu}, Kurtosis{__T_settings2, __T_w1, __T_mu1, __T_kt, __T_N, __T_alg1, __T_alg2}} where {__T_scale, __T_ub, __T_rke, __T_settings, __T_sigma, __T_chol, __T_rc, __T_alg, __T_settings1, __T_ve, __T_sk, __T_w, __T_mu, __T_settings2, __T_w1, __T_mu1, __T_kt, __T_N, __T_alg1, __T_alg2}Create an instance of VarianceSkewKurtosis by delegating factory to each sub-measure component.
Related
sourcePortfolioOptimisers.port_opt_view Method
port_opt_view(
r::VarianceSkewKurtosis,
i,
args...
) -> VarianceSkewKurtosis{RiskMeasureSettings{__T_scale, __T_ub, __T_rke}, Variance{__T_settings, __T_sigma, __T_chol, __T_rc, __T_alg}, Skewness{__T_settings1, __T_ve, __T_sk, __T_w, __T_mu}, Kurtosis{__T_settings2, __T_w1, __T_mu1, __T_kt, __T_N, __T_alg1, __T_alg2}} where {__T_scale, __T_ub, __T_rke, __T_settings, __T_sigma, __T_chol, __T_rc, __T_alg, __T_settings1, __T_ve, __T_sk, __T_w, __T_mu, __T_settings2, __T_w1, __T_mu1, __T_kt, __T_N, __T_alg1, __T_alg2}Return a view of VarianceSkewKurtosis r sliced to asset indices i by delegating port_opt_view to each sub-measure component.
Related
sourcePortfolioOptimisers.supports_precomputed_returns Method
supports_precomputed_returns(r::Skewness) -> AnyReturn whether Skewness r supports precomputed-return evaluation.
Delegates to weight_independent_target on r.mu: true iff the target is Nothing, a Number, or a MedianCenteringFunction; false for per-asset targets.
Related
sourcePortfolioOptimisers.supports_precomputed_returns Method
supports_precomputed_returns(
_::VarianceSkewKurtosis
) -> BoolReturn false: VarianceSkewKurtosis carries a weights-only variance term r.vr(w) with no bare-series form.
Related
source