Tracking risk measure
PortfolioOptimisers.RiskTrackingError Type
struct RiskTrackingError{__T_tr, __T_r, __T_err, __T_alg} <: AbstractTrackingRepresents the Risk Tracking Error configuration for benchmark weight tracking.
RiskTrackingError specifies that tracking error against a benchmark should be measured as a risk quantity (rather than a norm). It wraps a WeightsTracking benchmark, a risk measure r, a scalar error tolerance err, and a tracking algorithm alg.
Fields
tr: Benchmark weights tracking specification.r: Risk measure used to compute the tracking error.err: Scalar error tolerance (non-negative finite number).alg: Tracking algorithm (IndependentVariableTrackingorDependentVariableTracking).
Constructors
RiskTrackingError(;
tr::WeightsTracking,
r::AbstractBaseRiskMeasure = StandardDeviation(),
err::Number = 0.0,
alg::VariableTracking = IndependentVariableTracking()
) -> RiskTrackingErrorKeywords correspond to the struct's fields.
Validation
erris validated withassert_nonempty_nonneg_finite_val.
Related
PortfolioOptimisers.TrackingRiskMeasure Type
struct TrackingRiskMeasure{__T_settings, __T_tr, __T_alg} <: RiskMeasureRepresents the Tracking Error risk measure.
TrackingRiskMeasure penalises portfolio deviation from a benchmark by computing a norm of the difference between portfolio returns and a benchmark return series or benchmark weights. The tracking error can be defined using returns-based or weights-based benchmarks, and the norm is configurable.
Mathematical Definition
Let
Other norms can be selected via the alg field.
Fields
settings: Risk measure configuration.tr: Tracking algorithm specifying the benchmark (weights- or returns-based).alg: Norm type for the tracking error (L2Tracking,SquaredL2Tracking, etc.).
Constructors
TrackingRiskMeasure(;
settings::RiskMeasureSettings = RiskMeasureSettings(),
tr::AbstractTrackingAlgorithm,
alg::NormTracking = L2Tracking()
) -> TrackingRiskMeasureKeywords correspond to the struct's fields.
Functor
(r::TrackingRiskMeasure)(w::VecNum, X::MatNum, fees = nothing)Computes the Tracking Error of a portfolio weight vector w.
Arguments
w::VecNum: Portfolio weights vector.X::MatNum: Asset returns matrix (). fees: Optional fee structure.
Examples
julia> TrackingRiskMeasure(; tr = ReturnsTracking(; w = [0.1, -0.2, 0.3]))
TrackingRiskMeasure
settings ┼ RiskMeasureSettings
│ scale ┼ Float64: 1.0
│ ub ┼ nothing
│ rke ┴ Bool: true
tr ┼ ReturnsTracking
│ w ┴ Vector{Float64}: [0.1, -0.2, 0.3]
alg ┼ L2Tracking
│ ddof ┴ Int64: 1Related
PortfolioOptimisers.RiskTrackingRiskMeasure Type
struct RiskTrackingRiskMeasure{__T_settings, __T_tr, __T_r, __T_alg} <: RiskMeasureRepresents the Risk Tracking risk measure.
RiskTrackingRiskMeasure computes the deviation of portfolio risk from a benchmark portfolio risk, using any base risk measure. Two modes are supported:
Independent (
IndependentVariableTracking): computes the risk of the weight difference. Dependent (
DependentVariableTracking): computes the absolute difference between the portfolio risk and the benchmark risk.
Mathematical Definition
Independent mode:
Dependent mode:
where
Fields
settings: Risk measure configuration.tr: Benchmark weights tracking specification.r: Risk measure for computing the tracking deviation.alg: Tracking mode (IndependentVariableTrackingorDependentVariableTracking).
Constructors
RiskTrackingRiskMeasure(;
settings::RiskMeasureSettings = RiskMeasureSettings(),
tr::WeightsTracking,
r::AbstractBaseRiskMeasure = Variance(),
alg::VariableTracking = IndependentVariableTracking()
) -> RiskTrackingRiskMeasureKeywords correspond to the struct's fields.
Functor
(r::RiskTrackingRiskMeasure)(w::VecNum, X::MatNum, fees = nothing)Computes the Risk Tracking deviation of a portfolio weight vector w.
Arguments
w::VecNum: Portfolio weights vector.X::MatNum: Asset returns matrix (). fees: Optional fee structure.
Examples
julia> RiskTrackingRiskMeasure(; tr = WeightsTracking(; w = [0.5, 0.5]))
RiskTrackingRiskMeasure
settings ┼ RiskMeasureSettings
│ scale ┼ Float64: 1.0
│ ub ┼ nothing
│ rke ┴ Bool: true
tr ┼ WeightsTracking
│ fees ┼ nothing
│ w ┼ Vector{Float64}: [0.5, 0.5]
│ fixed ┴ Bool: false
r ┼ Variance
│ settings ┼ RiskMeasureSettings
│ │ scale ┼ Int64: 1
│ │ ub ┼ nothing
│ │ rke ┴ Bool: false
│ sigma ┼ nothing
│ chol ┼ nothing
│ rc ┼ nothing
│ alg ┴ SquaredSOCRiskExpr()
alg ┴ IndependentVariableTracking()Related
PortfolioOptimisers.TrRM Type
const TrRM = Union{<:TrackingRiskMeasure, <:RiskTrackingRiskMeasure}Union of tracking risk measures used for dispatch on factory methods and expected risk computations.
Related
source