Processed covariance
PortfolioOptimisers.ProcessedCovariance — Function
ProcessedCovariance(;
ce::StatsBase.CovarianceEstimator = Covariance(),
alg::Option{<:AbstractMatrixProcessingAlgorithm} = nothing,
pdm::Option{<:AbstractPosdefEstimator} = Posdef(),
) -> PortfolioOptimisersCovariance
ProcessedCovariance(
ce::StatsBase.CovarianceEstimator,
alg::Option{<:AbstractMatrixProcessingAlgorithm},
pdm::Option{<:AbstractPosdefEstimator},
) -> PortfolioOptimisersCovarianceReturns a PortfolioOptimisersCovariance that projects the covariance matrix to the positive definite cone and then applies a matrix processing algorithm of the caller. A MatrixProcessing applies the two steps in that order.
matrix_processing! in src/04_MatrixProcessing/04_MatrixProcessing.jl states what an AbstractMatrixProcessingAlgorithm does to the matrix. posdef! in src/04_MatrixProcessing/01_PosdefMatrix.jl states the mathematics of the projection.
Algorithm
- Build a
MatrixProcessingfrompdmandalg, withorder = (:pdm, :alg). - Return a
PortfolioOptimisersCovariancethat holdsceand that estimator.
The order field sets the composition. Statistics.cov runs ce first. Then it projects the matrix onto the positive definite cone, and it applies alg last. For the reverse order, build the MatrixProcessing directly.
Arguments
ce: Covariance estimator.alg: The optional matrix processing algorithm that runs after the projection. Ifalgisnothing, the projection is the only step.pdm: Optional positive definite matrix estimator.
Returns
ce::PortfolioOptimisersCovariance: The composite estimator that appliesalgto the matrix thatcecomputes.
Examples
julia> ProcessedCovariance()PortfolioOptimisersCovariance ce ┼ Covariance │ me ┼ SimpleExpectedReturns │ │ w ┴ nothing │ ce ┼ GeneralCovariance │ │ ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true) │ │ w ┴ nothing │ alg ┼ FullMoment() │ w ┴ nothing mp ┼ MatrixProcessing │ pdm ┼ Posdef │ │ alg ┼ UnionAll: NearestCorrelationMatrix.Newton │ │ kwargs ┴ @NamedTuple{}: NamedTuple() │ dn ┼ nothing │ dt ┼ nothing │ alg ┼ nothing │ order ┴ Tuple{Symbol, Symbol}: (:pdm, :alg)Related