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},
) -> PortfolioOptimisersCovarianceConvenience constructor. Returns a PortfolioOptimisersCovariance configured to apply positive definite projection then a custom matrix processing algorithm, in that order, via MatrixProcessing.
matrix_processing! in src/04_MatrixProcessing/04_MatrixProcessing.jl states what an AbstractMatrixProcessingAlgorithm does to the matrix, and posdef! in src/04_MatrixProcessing/01_PosdefMatrix.jl states the mathematics of the projection.
Algorithm
- Build a
MatrixProcessingfrompdmandalg, withorder = (:pdm, :alg). - Return a
PortfolioOptimisersCovariancecarryingceand that estimator.
order is what fixes the composition: Statistics.cov runs ce first, then projects the matrix onto the positive definite cone, and applies alg last. A caller who needs the reverse order builds the MatrixProcessing itself.
Arguments
ce: Covariance estimator.alg: Optional matrix processing algorithm applied after the projection. Ifnothing, the projection is the only step.pdm: Optional positive definite matrix estimator.
Returns
ce::PortfolioOptimisersCovariance: Composite estimator that appliesalgto the matrixcecomputes.
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