Skip to content
11

Rank Covariances

PortfolioOptimisers.KendallCovariance Type
julia
struct KendallCovariance{T1} <: RankCovarianceEstimator
    ve::T1
end

Robust covariance estimator based on Kendall's tau rank correlation.

KendallCovariance implements a covariance estimator that uses Kendall's tau rank correlation to measure the monotonic association between pairs of asset returns. This estimator is robust to outliers and non-Gaussian data, making it suitable for financial applications where heavy tails or non-linear dependencies are present.

Fields

  • ve: Variance estimator used to compute marginal standard deviations.

Constructor

julia
KendallCovariance(; ve::AbstractVarianceEstimator = SimpleVariance())

Keyword arguments correspond to the fields above.

Examples

julia
julia> KendallCovariance()
KendallCovariance
  ve ┼ SimpleVariance
     │          me ┼ SimpleExpectedReturns
     │             │     w ┼ nothing
     │             │   idx ┴ nothing
     │           w ┼ nothing
     │   corrected ┴ Bool: true

Related

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

Compute the Kendall's tau rank covariance matrix using a KendallCovariance estimator.

This method computes the covariance matrix for the input data matrix X by combining the Kendall's tau rank correlation matrix with the marginal standard deviations estimated by the variance estimator in ce. This approach is robust to outliers and non-Gaussian data.

Arguments

  • ce: Kendall's tau-based covariance estimator.

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

  • dims: Dimensions along which to perform the computation.

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

Returns

  • sigma::Matrix{<:Number}: Symmetric matrix of Kendall's tau rank covariances.

Validation

  • dims is either 1 or 2.

Related

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

Compute the Kendall's tau rank correlation matrix using a KendallCovariance estimator.

This method computes the pairwise Kendall's tau rank correlation matrix for the input data matrix X. Kendall's tau measures the monotonic association between pairs of asset returns and is robust to outliers and non-Gaussian data.

Arguments

  • ce: Kendall's tau-based covariance estimator.

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

  • dims: Dimensions along which to perform the computation.

  • kwargs...: Additional keyword arguments (currently unused).

Returns

  • rho::Matrix{<:Number}: Symmetric matrix of Kendall's tau rank correlation coefficients.

Validation

  • dims is either 1 or 2.

Related

source
PortfolioOptimisers.SpearmanCovariance Type
julia
struct SpearmanCovariance{T1} <: RankCovarianceEstimator
    ve::T1
end

Robust covariance estimator based on Spearman's rho rank correlation.

SpearmanCovariance implements a covariance estimator that uses Spearman's rho rank correlation to measure the monotonic association between pairs of asset returns. This estimator is robust to outliers and non-Gaussian data, making it suitable for financial applications where heavy tails or non-linear dependencies are present.

Fields

  • ve: Variance estimator used to compute marginal standard deviations.

Constructor

julia
SpearmanCovariance(; ve::AbstractVarianceEstimator = SimpleVariance())

Keyword arguments correspond to the fields above.

Examples

julia
julia> SpearmanCovariance()
SpearmanCovariance
  ve ┼ SimpleVariance
     │          me ┼ SimpleExpectedReturns
     │             │     w ┼ nothing
     │             │   idx ┴ nothing
     │           w ┼ nothing
     │   corrected ┴ Bool: true

Related

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

Compute the Spearman's rho rank covariance matrix using a SpearmanCovariance estimator.

This method computes the covariance matrix for the input data matrix X by combining the Spearman's rho rank correlation matrix with the marginal standard deviations estimated by the variance estimator in ce. This approach is robust to outliers and non-Gaussian data.

Arguments

  • ce: Spearman's rho-based covariance estimator.

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

  • dims: Dimensions along which to perform the computation.

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

Returns

  • sigma::Matrix{<:Number}: Symmetric matrix of Spearman's rho rank covariances.

Validation

  • dims is either 1 or 2.

Related

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

Compute the Spearman's rho rank correlation matrix using a SpearmanCovariance estimator.

This method computes the pairwise Spearman's rho rank correlation matrix for the input data matrix X. Spearman's rho measures the monotonic association between pairs of asset returns and is robust to outliers and non-Gaussian data.

Arguments

  • ce: Spearman's rho-based covariance estimator.

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

  • dims: Dimensions along which to perform the computation.

  • kwargs...: Additional keyword arguments (currently unused).

Returns

  • rho::Matrix{<:Number}: Symmetric matrix of Spearman's rho rank correlation coefficients.

Validation

  • dims is either 1 or 2.

Related

source
PortfolioOptimisers.RankCovarianceEstimator Type
julia
abstract type RankCovarianceEstimator <: AbstractCovarianceEstimator end

Abstract supertype for all rank-based covariance estimators in PortfolioOptimisers.jl.

All concrete and/or abstract types implementing rank-based covariance estimation algorithms should be subtypes of RankCovarianceEstimator.

Related

source