Denoise covariance
PortfolioOptimisers.DenoiseCovariance — Function
DenoiseCovariance(;
ce::StatsBase.CovarianceEstimator = Covariance(),
dn::AbstractDenoiseEstimator = Denoise(),
pdm::Option{<:AbstractPosdefEstimator} = Posdef(),
) -> PortfolioOptimisersCovariance
DenoiseCovariance(
ce::StatsBase.CovarianceEstimator,
dn::AbstractDenoiseEstimator,
pdm::Option{<:AbstractPosdefEstimator},
) -> PortfolioOptimisersCovarianceConvenience constructor. Returns a PortfolioOptimisersCovariance configured to apply positive definite projection then denoising, in that order, via MatrixProcessing.
denoise! in src/04_MatrixProcessing/02_Denoise.jl states the mathematics of the denoising step, and posdef! in src/04_MatrixProcessing/01_PosdefMatrix.jl that of the projection.
Algorithm
- Build a
MatrixProcessingfrompdmanddn, withorder = (:pdm, :dn). - 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 denoises last. A caller who needs the reverse order builds the MatrixProcessing itself.
Arguments
ce: Covariance estimator.dn: Matrix denoising estimator.pdm: Optional positive definite matrix estimator.
Returns
ce::PortfolioOptimisersCovariance: Composite estimator that denoises the matrixcecomputes.
Examples
julia> DenoiseCovariance()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 ┼ Denoise │ │ pdm ┼ Posdef │ │ │ alg ┼ UnionAll: NearestCorrelationMatrix.Newton │ │ │ kwargs ┴ @NamedTuple{}: NamedTuple() │ │ alg ┼ ShrunkDenoise │ │ │ alpha ┴ Float64: 0.0 │ │ args ┼ Tuple{}: () │ │ kwargs ┼ @NamedTuple{}: NamedTuple() │ │ kernel ┼ typeof(AverageShiftedHistograms.Kernels.gaussian): AverageShiftedHistograms.Kernels.gaussian │ │ m ┼ Int64: 10 │ │ n ┴ Int64: 1000 │ dt ┼ nothing │ alg ┼ nothing │ order ┴ Tuple{Symbol, Symbol}: (:pdm, :dn)Related