Non-Optimisation Risk Measures
PortfolioOptimisers.MeanReturn Type
struct MeanReturn{__T_w, __T_flag} <: NonOptimisationRiskMeasureRepresents a simple mean return measure for use in non-optimisation contexts.
MeanReturn computes the arithmetic (or geometric, when flag = true) mean of portfolio returns. It is used as the numerator in risk-adjusted performance ratios such as MeanReturnRiskRatio.
Mathematical Definition
For flag = false (arithmetic mean):
For flag = true (log-return mean):
For observation-weighted samples, the weighted mean is used instead.
Fields
w: Optional observation weights.flag: Iftrue, log-transforms returns before averaging.
Constructors
MeanReturn(;
w::Option{<:ObsWeights} = nothing,
flag::Bool = false
) -> MeanReturnKeywords correspond to the struct's fields.
Validation
- If
wis notnothing:!isempty(w).
Functor
(r::MeanReturn)(x::VecNum)Computes the mean return of a portfolio returns vector x.
Arguments
x::VecNum: Portfolio returns vector.
Examples
julia> MeanReturn()
MeanReturn
w ┼ nothing
flag ┴ Bool: falseRelated
sourcePortfolioOptimisers.MeanReturnRiskRatio Type
struct MeanReturnRiskRatio{__T_rt, __T_rk, __T_rf} <: NonOptimisationRiskMeasureRepresents a mean return to risk ratio measure.
MeanReturnRiskRatio computes the ratio of the mean portfolio return (minus a risk-free rate) to a risk measure, used for performance analysis and comparison. It generalises the Sharpe ratio by allowing any risk measure in the denominator.
Mathematical Definition
where rt), rk).
Fields
rt: Mean return estimator.rk: Risk measure for the denominator.rf: Risk-free rate.
Constructors
MeanReturnRiskRatio(;
rt::MeanReturn = MeanReturn(),
rk::AbstractBaseRiskMeasure = ConditionalValueatRisk(),
rf::Number = 0.0
) -> MeanReturnRiskRatioKeywords correspond to the struct's fields.
Related
sourcePortfolioOptimisers.ThirdCentralMoment Type
struct ThirdCentralMoment{__T_w, __T_mu} <: NonOptimisationRiskMeasureRepresents the Third Central Moment risk measure.
ThirdCentralMoment computes the third central moment of portfolio returns about a specified centre. It is used as a measure of the asymmetry (skewness) of the return distribution in higher-order portfolio optimisation.
Mathematical Definition
Let
For observation-weighted samples, the weighted mean is used.
Fields
w: Optional observation weights.mu: Centre (centering value, vector, orVecScalar).
Constructors
ThirdCentralMoment(;
w::Option{<:ObsWeights} = nothing,
mu::Option{<:Num_VecNum_VecScalar} = nothing
) -> ThirdCentralMomentKeywords correspond to the struct's fields.
Validation
If
muis aVecNum:!isempty(mu).If
wis notnothing:!isempty(w).
Functor
(r::ThirdCentralMoment)(w::VecNum, X::MatNum, fees = nothing)Computes the third central moment of the portfolio returns.
Arguments
w::VecNum: Portfolio weights vector.X::MatNum: Asset returns matrix (). fees: Optional fee structure.
Examples
julia> ThirdCentralMoment()
ThirdCentralMoment
w ┼ nothing
mu ┴ nothingRelated
sourcePortfolioOptimisers.Skewness Type
struct Skewness{__T_ve, __T_w, __T_mu} <: NonOptimisationRiskMeasureRepresents the standardised Skewness risk measure.
Skewness computes the third standardised central moment (skewness) of portfolio returns. Negative skewness indicates a return distribution with a heavier left tail.
Mathematical Definition
Let
Fields
ve: Variance estimator for computing. w: Optional observation weights.mu: Centre (centering value, vector, orVecScalar).
Constructors
Skewness(;
ve::AbstractVarianceEstimator = SimpleVariance(),
w::Option{<:ObsWeights} = nothing,
mu::Option{<:Num_VecNum_VecScalar} = nothing
) -> SkewnessKeywords correspond to the struct's fields.
Validation
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::VecNum: Portfolio weights vector.X::MatNum: Asset returns matrix (). fees: Optional fee structure.
Examples
julia> Skewness()
Skewness
ve ┼ SimpleVariance
│ me ┼ SimpleExpectedReturns
│ │ w ┴ nothing
│ w ┼ nothing
│ corrected ┴ Bool: true
w ┼ nothing
mu ┴ nothingRelated
sourcePortfolioOptimisers.TCM_Sk Type
const TCM_Sk{T1, T2} = Union{...}Parameterised union of ThirdCentralMoment and Skewness sharing the same observation-weight (T1) and target-mean (T2) type parameters.
Used for unified dispatch on moment-target calculation methods.
Related
source