Median Absolute Deviation Risk
PortfolioOptimisers.MedianCenteringFunction Type
abstract type MedianCenteringFunction <: AbstractAlgorithmAbstract supertype for centering functions used in the Median Absolute Deviation risk measure.
Related Types
sourcePortfolioOptimisers.MedianCentering Type
struct MedianCentering <: MedianCenteringFunctionCentres the returns series using the (weighted) median before computing the Median Absolute Deviation.
Related Types
sourcePortfolioOptimisers.MeanCentering Type
struct MeanCentering <: MedianCenteringFunctionCentres the returns series using the (weighted) mean before computing the Median Absolute Deviation.
Related Types
sourcePortfolioOptimisers.MedAbsDevMu Type
const MedAbsDevMu = Union{<:Num_VecNum_VecScalar, <:MedianCenteringFunction}Union of valid centring-target types for MedianAbsoluteDeviation.
Accepts a numeric scalar/vector target or a MedianCenteringFunction (e.g. mean or median centering).
Related
sourcePortfolioOptimisers.MedianAbsoluteDeviation Type
struct MedianAbsoluteDeviation{__T_settings, __T_w, __T_mu, __T_flag} <: HierarchicalRiskMeasureRepresents the Median Absolute Deviation (MAD) risk measure for hierarchical portfolio optimisation.
MedianAbsoluteDeviation computes the median (or mean) absolute deviation of portfolio returns about a specified centre, providing a robust alternative to variance for measuring dispersion.
Mathematical Definition
Let
When flag = true (default), the result is scaled by a consistency factor
Fields
settings: Hierarchical risk measure configuration.w: Optional observation weights.mu: Centre of the deviation (centering function, scalar, vector, orVecScalar).flag: Iftrue, applies the consistency correction factor.
Constructors
MedianAbsoluteDeviation(;
settings::HierarchicalRiskMeasureSettings = HierarchicalRiskMeasureSettings(),
w::Option{<:ObsWeights} = nothing,
mu::MedAbsDevMu = MedianCentering(),
flag::Bool = true
) -> MedianAbsoluteDeviationKeywords correspond to the struct's fields.
Validation
If
muis aVecNum:!isempty(mu)andall(isfinite, mu).If
muis aNumber:isfinite(mu).If
wis notnothing:!isempty(w).
Functor
(r::MedianAbsoluteDeviation)(w::VecNum, X::MatNum, fees = nothing)Computes the MAD of the portfolio returns series.
Arguments
w::VecNum: Portfolio weights vector.X::MatNum: Asset returns matrix (). fees: Optional fee structure.
Examples
julia> MedianAbsoluteDeviation()
MedianAbsoluteDeviation
settings ┼ HierarchicalRiskMeasureSettings
│ scale ┴ Float64: 1.0
w ┼ nothing
mu ┼ MedianCentering()
flag ┴ Bool: trueRelated
source