PortfolioOptimisersCovariance
PortfolioOptimisers.PortfolioOptimisersCovariance Type
struct PortfolioOptimisersCovariance{T1, T2} <: AbstractCovarianceEstimator
ce::T1
mp::T2
endComposite covariance estimator with post-processing.
PortfolioOptimisersCovariance is a flexible container type that combines any covariance estimator with a matrix post-processing step. This enables users to apply additional transformations or corrections (such as shrinkage, regularisation, or projection to positive definite) to the covariance or correlation matrix after it is estimated.
Fields
ce: The underlying covariance estimator.mp: Matrix post-processing estimator.
Constructor
PortfolioOptimisersCovariance(; ce::AbstractCovarianceEstimator = Covariance(),
mp::AbstractMatrixProcessingEstimator = DefaultMatrixProcessing())Keyword arguments correspond to the fields above.
Examples
julia> PortfolioOptimisersCovariance()
PortfolioOptimisersCovariance
ce ┼ Covariance
│ me ┼ SimpleExpectedReturns
│ │ w ┴ nothing
│ ce ┼ GeneralCovariance
│ │ ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)
│ │ w ┴ nothing
│ alg ┴ Full()
mp ┼ DefaultMatrixProcessing
│ pdm ┼ Posdef
│ │ alg ┴ UnionAll: NearestCorrelationMatrix.Newton
│ denoise ┼ nothing
│ detone ┼ nothing
│ alg ┴ nothingRelated
sourceStatistics.cov Method
cov(ce::PortfolioOptimisersCovariance, X::AbstractMatrix; dims = 1, kwargs...)Compute the covariance matrix with post-processing using a PortfolioOptimisersCovariance estimator.
This method computes the covariance matrix for the input data matrix X using the underlying covariance estimator in ce, and then applies the matrix post-processing step specified by ce.mp. This enables workflows such as shrinkage, regularisation, or projection to positive definite after covariance estimation.
Arguments
ce: Composite covariance estimator with post-processing.X: Data matrix of asset returns (observations × assets).dims: Dimension along which to compute the covariance (1 = columns/assets, 2 = rows). Default is1.kwargs...: Additional keyword arguments passed to the underlying covariance estimator and matrix processing step.
Returns
sigma::Matrix{<:Real}: The processed covariance matrix.
Validation
dimsis either1or2.
Related
sourceStatistics.cor Method
cor(ce::PortfolioOptimisersCovariance, X::AbstractMatrix; dims = 1, kwargs...)Compute the correlation matrix with post-processing using a PortfolioOptimisersCovariance estimator.
This method computes the correlation matrix for the input data matrix X using the underlying covariance estimator in ce, and then applies the matrix post-processing step specified by ce.mp. This enables workflows such as shrinkage, regularisation, or projection to positive definite after correlation estimation.
Arguments
ce: Composite covariance estimator with post-processing.X: Data matrix of asset returns (observations × assets).dims: Dimension along which to compute the correlation (1 = columns/assets, 2 = rows). Default is1.kwargs...: Additional keyword arguments passed to the underlying covariance estimator and matrix processing step.
Returns
rho::Matrix{<:Real}: The processed correlation matrix.
Validation
dimsis either1or2.
Related
source