Rank Covariances
PortfolioOptimisers.RankCovarianceEstimator
— Typeabstract type RankCovarianceEstimator <: AbstractCovarianceEstimator end
Abstract supertype for all rank-based covariance estimators in PortfolioOptimisers.jl.
All concrete types implementing rank-based covariance estimation algorithms (such as Kendall's tau or Spearman's rho) should subtype RankCovarianceEstimator
. This enables a consistent interface for rank-based covariance estimators throughout the package and allows for flexible extension and dispatch.
Related
PortfolioOptimisers.KendallCovariance
— Typestruct KendallCovariance{T1} <: RankCovarianceEstimator
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::AbstractVarianceEstimator
: Variance estimator used to compute marginal standard deviations.
Constructor
KendallCovariance(; ve::AbstractVarianceEstimator = SimpleVariance())
Construct a KendallCovariance
object with the specified variance estimator.
Related
PortfolioOptimisers.KendallCovariance
— MethodKendallCovariance(; ve::AbstractVarianceEstimator = SimpleVariance())
Construct a KendallCovariance
estimator for robust rank-based covariance or correlation estimation using Kendall's tau.
This constructor creates a KendallCovariance
object using the specified variance estimator. The estimator computes the covariance matrix by combining the Kendall's tau rank correlation matrix with the marginal standard deviations.
Arguments
ve::AbstractVarianceEstimator
: Variance estimator.
ReturnsResult
KendallCovariance
: A configured Kendall's tau-based covariance estimator.
Examples
julia> ce = KendallCovariance()
KendallCovariance
ve | SimpleVariance
| me | SimpleExpectedReturns
| | w | nothing
| w | nothing
| corrected | Bool: true
Related
Statistics.cor
— Methodcor(::KendallCovariance, X::AbstractMatrix; 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::KendallCovariance
: Kendall's tau-based covariance estimator.X::AbstractMatrix
: Data matrix of asset returns (observations × assets).dims::Int
: Dimension along which to compute the correlation.kwargs...
: Additional keyword arguments (currently unused).
ReturnsResult
rho::Matrix{Float64}
: Symmetric matrix of Kendall's tau rank correlation coefficients.
Validation
- Asserts that
dims
is either1
or2
.
Related
Statistics.cov
— Methodcov(ce::KendallCovariance, X::AbstractMatrix; 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::KendallCovariance
: Kendall's tau-based covariance estimator.X::AbstractMatrix
: Data matrix of asset returns (observations × assets).dims::Int
: Dimension along which to compute the covariance.kwargs...
: Additional keyword arguments passed to the variance estimator.
ReturnsResult
sigma::Matrix{Float64}
: Symmetric matrix of Kendall's tau rank covariances.
Validation
- Asserts that
dims
is either1
or2
.
Related
PortfolioOptimisers.SpearmanCovariance
— Typestruct SpearmanCovariance{T1} <: RankCovarianceEstimator
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::AbstractVarianceEstimator
: Variance estimator used to compute marginal standard deviations.
Constructor
SpearmanCovariance(; ve::AbstractVarianceEstimator = SimpleVariance())
Construct a SpearmanCovariance
object with the specified variance estimator.
Related
PortfolioOptimisers.SpearmanCovariance
— MethodSpearmanCovariance(; ve::AbstractVarianceEstimator = SimpleVariance())
Construct a SpearmanCovariance
estimator for robust rank-based covariance or correlation estimation using Spearman's rho.
This constructor creates a SpearmanCovariance
object using the specified variance estimator. The estimator computes the covariance matrix by combining the Spearman's rho rank correlation matrix with the marginal standard deviations.
Arguments
ve::AbstractVarianceEstimator
: Variance estimator.
ReturnsResult
SpearmanCovariance
: A configured Spearman's rho-based covariance estimator.
Examples
julia> ce = SpearmanCovariance()
SpearmanCovariance
ve | SimpleVariance
| me | SimpleExpectedReturns
| | w | nothing
| w | nothing
| corrected | Bool: true
Related
Statistics.cor
— Methodcor(::SpearmanCovariance, X::AbstractMatrix; 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::SpearmanCovariance
: Spearman's rho-based covariance estimator.X::AbstractMatrix
: Data matrix of asset returns (observations × assets).dims::Int
: Dimension along which to compute the correlation (1 = columns/assets, 2 = rows). Default is1
.kwargs...
: Additional keyword arguments (currently unused).
ReturnsResult
rho::Matrix{Float64}
: Symmetric matrix of Spearman's rho rank correlation coefficients.
Validation
- Asserts that
dims
is either1
or2
.
Related
Statistics.cov
— Methodcov(ce::SpearmanCovariance, X::AbstractMatrix; 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::SpearmanCovariance
: Spearman's rho-based covariance estimator.X::AbstractMatrix
: Data matrix of asset returns (observations × assets).dims::Int
: Dimension along which to compute the covariance (1 = columns/assets, 2 = rows). Default is1
.kwargs...
: Additional keyword arguments passed to the variance estimator.
ReturnsResult
sigma::Matrix{Float64}
: Symmetric matrix of Spearman's rho rank covariances.
Validation
- Asserts that
dims
is either1
or2
.
Related