Detone covariance
PortfolioOptimisers.DetoneCovariance Type
struct DetoneCovariance{T1, T2, T3} <: AbstractCovarianceEstimator
ce::T1
detone::T2
pdm::T3
endA covariance estimator that applies a detoning algorithm and positive definite projection to the output of another covariance estimator. This type enables robust estimation of covariance matrices by first computing a base covariance, then applying detoning and positive definiteness corrections in sequence.
Fields
ce: The underlying covariance estimator to be detoned.detone: The detoning algorithm to apply to the covariance matrix.pdm: The positive definite matrix projection method.
Constructors
DetoneCovariance(; ce::AbstractCovarianceEstimator = Covariance(),
detone::Detone = Detone(), pdm::Option{<:Posdef} = Posdef())Keyword arguments correspond to the fields above.
Examples
julia> DetoneCovariance()
DetoneCovariance
ce ┼ Covariance
│ me ┼ SimpleExpectedReturns
│ │ w ┴ nothing
│ ce ┼ GeneralCovariance
│ │ ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)
│ │ w ┴ nothing
│ alg ┴ Full()
detone ┼ Detone
│ n ┼ Int64: 1
│ pdm ┼ Posdef
│ │ alg ┼ UnionAll: NearestCorrelationMatrix.Newton
│ │ kwargs ┴ @NamedTuple{}: NamedTuple()
pdm ┼ Posdef
│ alg ┼ UnionAll: NearestCorrelationMatrix.Newton
│ kwargs ┴ @NamedTuple{}: NamedTuple()Related
sourceStatistics.cov Method
cov(ce::DetoneCovariance, X::MatNum; dims = 1, kwargs...)Compute the detoned and positive definite projected covariance matrix for the data matrix X using the specified DetoneCovariance estimator.
Arguments
ce: TheDetoneCovarianceestimator specifying the base covariance estimator, detoning algorithm, and positive definite projection.X: The data matrix (observations × assets).dims: The dimension along which to compute the covariance.kwargs...: Additional keyword arguments passed to the underlying covariance estimator.
Returns
sigma::MatNum: detoned covariance matrix.
Validation
dims in (1, 2).
Details
Computes the covariance matrix using the base estimator in
ce.Transposes
Xifdims == 2to ensure variables are in columns.Ensures the covariance matrix is mutable.
Applies positive definite projection using the method in
ce.pdm.Applies the detoning algorithm in
ce.detone.Returns the processed covariance matrix.
Related
sourceStatistics.cor Method
cor(ce::DetoneCovariance, X::MatNum; dims = 1, kwargs...)Compute the detoned and positive definite projected correlation matrix for the data matrix X using the specified DetoneCovariance estimator.
Arguments
ce: TheDetoneCovarianceestimator specifying the base covariance estimator, detoning algorithm, and positive definite projection.X: The data matrix (observations × assets).dims: The dimension along which to compute the correlation.kwargs...: Additional keyword arguments passed to the underlying correlation estimator.
Returns
rho::MatNum: detoned correlation matrix.
Validation
dims in (1, 2).
Details
Computes the correlation matrix using the base estimator in
ce.Transposes
Xifdims == 2to ensure variables are in columns.Ensures the correlation matrix is mutable.
Applies positive definite projection using the method in
ce.pdm.Applies the detoning algorithm in
ce.detone.Returns the processed correlation matrix.
Related
source