Skip to content
13

Lower Tail Dependence Covariance

PortfolioOptimisers.LowerTailDependenceCovariance Type
julia
struct LowerTailDependenceCovariance{__T_ve, __T_alpha, __T_ex} <: AbstractCovarianceEstimator

Lower tail dependence covariance estimator.

LowerTailDependenceCovariance implements a robust covariance estimator based on lower tail dependence, which measures the co-movement of asset returns in the lower quantiles (i.e., during joint drawdowns or adverse events). This estimator is particularly useful for capturing dependence structures relevant to risk management and stress scenarios.

Fields

  • ve: Variance estimator.

  • alpha: Quantile level for the lower tail.

  • ex: Parallel execution strategy.

Constructors

julia
LowerTailDependenceCovariance(;
    ve::AbstractVarianceEstimator = SimpleVariance(),
    alpha::Number = 0.05,
    ex::FLoops.Transducers.Executor = ThreadedEx()
) -> LowerTailDependenceCovariance

Keywords correspond to the struct's fields.

Validation

  • 0 < alpha < 1.

Examples

julia
julia> LowerTailDependenceCovariance()
LowerTailDependenceCovariance
     ve ┼ SimpleVariance
        │          me ┼ SimpleExpectedReturns
        │             │   w ┴ nothing
        │           w ┼ nothing
        │   corrected ┴ Bool: true
  alpha ┼ Float64: 0.05
     ex ┴ Transducers.ThreadedEx{@NamedTuple{}}: Transducers.ThreadedEx()

Related

source
PortfolioOptimisers.factory Method
julia
factory(ce::LowerTailDependenceCovariance, w::ObsWeights) -> LowerTailDependenceCovariance

Return a new LowerTailDependenceCovariance estimator with observation weights w applied to the underlying variance estimator.

Arguments

  • ce: Covariance estimator.

  • w: Observation weights vector observations × 1.

Returns

  • ce: New covariance estimator of the same type as the argument, with the new weights applied.

Examples

julia
julia> ce = LowerTailDependenceCovariance();

julia> factory(ce, StatsBase.Weights([0.2, 0.3, 0.5]))
LowerTailDependenceCovariance
     ve ┼ SimpleVariance
        │          me ┼ SimpleExpectedReturns
        │             │   w ┴ StatsBase.Weights{Float64, Float64, Vector{Float64}}: [0.2, 0.3, 0.5]
        │           w ┼ StatsBase.Weights{Float64, Float64, Vector{Float64}}: [0.2, 0.3, 0.5]
        │   corrected ┴ Bool: true
  alpha ┼ Float64: 0.05
     ex ┴ Transducers.ThreadedEx{@NamedTuple{}}: Transducers.ThreadedEx()

Related

source
Statistics.cov Method
julia
Statistics.cov(ce::LowerTailDependenceCovariance, X::MatNum; dims::Int = 1, kwargs...)

Compute the lower tail dependence covariance matrix using a LowerTailDependenceCovariance estimator.

This method computes the lower tail dependence (LTD) covariance matrix for the input data matrix X using the quantile level and parallel execution strategy specified in ce. The LTD covariance focuses on the co-movement of asset returns in the lower tail, making it robust to extreme events and particularly relevant for risk-sensitive applications.

Arguments

  • ce: Lower tail dependence covariance estimator.

  • X: Data matrix of asset returns (observations × assets).

  • dims: Dimension along which to perform the computation.

  • kwargs...: Additional keyword arguments passed to the variance estimator.

Returns

  • sigma::Matrix{<:Number}: Symmetric matrix of lower tail dependence covariances.

Validation

  • dims is either 1 or 2.

Examples

julia
julia> ce = LowerTailDependenceCovariance();

julia> X = [0.01 0.02; 0.03 0.04; 0.02 0.03];

julia> cov(ce, X)
2×2 Matrix{Float64}:
 0.0001  0.0001
 0.0001  0.0001

Related

source
Statistics.cor Method
julia
Statistics.cor(ce::LowerTailDependenceCovariance, X::MatNum; dims::Int = 1, kwargs...)

Compute the lower tail dependence correlation matrix using a LowerTailDependenceCovariance estimator.

This method computes the lower tail dependence (LTD) correlation matrix for the input data matrix X using the quantile level and parallel execution strategy specified in ce. The LTD correlation quantifies the probability that pairs of assets experience joint drawdowns or adverse events, as measured by their co-movement in the lower tail.

Arguments

  • ce: Lower tail dependence covariance estimator.

  • X: Data matrix of asset returns (observations × assets).

  • dims: Dimension along which to perform the computation.

  • kwargs...: Additional keyword arguments.

Returns

  • rho::Matrix{<:Number}: Symmetric matrix of lower tail dependence correlation coefficients.

Validation

  • dims is either 1 or 2.

Examples

julia
julia> ce = LowerTailDependenceCovariance();

julia> X = [0.01 0.02; 0.03 0.04; 0.02 0.03];

julia> cor(ce, X)
2×2 Matrix{Float64}:
 1.0  1.0
 1.0  1.0

Related

source
PortfolioOptimisers.port_opt_view Method
julia
port_opt_view(
    ce::LowerTailDependenceCovariance,
    i,
    args...
) -> LowerTailDependenceCovariance{<:AbstractVarianceEstimator, <:Number, <:Transducers.Executor}

Gets the view of the covariance estimator for the i-th element(s).

Arguments

  • ce: Covariance estimator.

  • i: Index or indices to view.

Returns

  • ce: New covariance estimator of the same type as the argument, for the new view.

Related

source
PortfolioOptimisers.lower_tail_dependence Function
julia
lower_tail_dependence(X::MatNum; alpha::Number = 0.05,
                      ex::FLoops.Transducers.Executor = SequentialEx())

Compute the lower tail dependence matrix for a set of asset returns.

The lower tail dependence (LTD) between two assets quantifies the probability that both assets experience returns in their respective lower tails (i.e., joint drawdowns or adverse events), given a specified quantile level alpha. This function estimates the LTD matrix for all pairs of assets in the input matrix X, which is particularly useful for risk management and stress testing.

Mathematical definition

For a quantile level α(0,1) and k=Tα, let q^i denote the empirical α-quantile of asset i (the k-th order statistic). The lower tail dependence between assets i and j is estimated as:

λ^ij=1kt=1T1[xtiq^i and xtjq^j].

The resulting matrix is symmetric with entries clamped to [0,1].

Where:

  • λ^ij: Lower tail dependence estimate between assets i and j.

  • T: Number of observations.

  • α: Significance level (left tail probability), α(0,1).

  • k=Tα: Number of observations in the lower tail.

  • xti: Return of asset i at time t.

  • q^i: Empirical α-quantile of asset i.

Arguments

  • X: Data matrix of asset returns (observations × assets).

  • alpha: Quantile level for the lower tail.

  • ex: Parallel execution strategy.

Returns

  • rho::Matrix{<:Number}: Symmetric matrix of lower tail dependence coefficients, where rho[i, j] is the estimated LTD between assets i and j.

Details

For each pair of assets (i, j), the LTD is estimated as the proportion of observations where both asset i and asset j have returns less than or equal to their respective empirical alpha-quantiles, divided by the number of observations in the lower tail (ceil(Int, T * alpha), where T is the number of observations).

The resulting matrix is symmetric and all values are clamped to [0, 1].

Related

source