MM covariance
PortfolioOptimisers.BisquareReweighting — Type
struct BisquareReweighting{__T_eff, __T_target} <: AbstractRobustReweightingFits the location and the shape again with the soft weights of the bisquare function, with the scale of the raw fit fixed.
The M-step of [130] and [127] keeps the scale $s = \lvert \mathbf{\Sigma}_0 \rvert^{1/p}$ of the raw covariance $\mathbf{\Sigma}_0$, and solves the fixed point of a bisquare M-estimator of the location and of the shape of determinant one from the raw fit. Its constant $c^2$ is larger than the one of the raw fit, so the step gives the efficiency eff at the normal model to the part target of the estimate, see bisquare_efficiency. The raw fit gives the breakdown point, and the step keeps it. The weight of an observation falls from one at the centre to zero at $c^2$, see BisquareRho.
The step is the second part of MMCovariance. It also follows an MCDCovariance with rw = BisquareReweighting(), a soft reweighting in place of the hard weights of MCDReweighting. The scale of the MCD is consistent at the normal model, so the efficiency holds there too.
Fields
eff: Asymptotic efficiency of the shape of the M-step at the normal model, relative to the sample covariance,0 < eff < 1.
target: Part of the estimate whose efficiencyefftunes the constant of the M-step, a subtype ofAbstractEfficiencyTarget.
Constructors
BisquareReweighting(; eff::Number = 0.95, target::AbstractEfficiencyTarget = ShapeEfficiency()) -> BisquareReweightingKeywords correspond to the struct's fields.
Validation
0 < eff < 1.
Examples
julia> BisquareReweighting()BisquareReweighting eff ┼ Float64: 0.95 target ┴ ShapeEfficiency()Related
References
- [130] K. S. Tatsuoka and D. E. Tyler. On the uniqueness of S-functionals and M-functionals under nonelliptical distributions. The Annals of Statistics 28, 1219–1243 (2000). Not read. See
bisquare_mstep. - [127] M. Salibián-Barrera, S. Van Aelst and G. Willems. Principal components analysis based on multivariate MM estimators with fast and robust bootstrap. Journal of the American Statistical Association 101, 1198–1211 (2006). Not read. See
bisquare_efficiency.
PortfolioOptimisers.MMCovariance — Type
struct MMCovariance{__T_s, __T_rw, __T_q, __T_cache} <: AbstractRobustCovarianceEstimatorEstimates the location and the covariance of the returns with an MM estimator, which has a high breakdown point and a high efficiency at the normal model.
The MM estimator of [130] and [127] has two parts:
- The S estimate
s, seeSCovariance. It gives the breakdown point and the scale. - The M-step
rwfrom the S estimate, with the scale fixed, seeBisquareReweighting. It gives the efficiency.
The default gives the breakdown point one half and the efficiency 95 % of the shape. The estimate agrees with CovMMest of the R package rrcov, version 1.7-7, with the start method = "sdet".
StatsAPI.fit returns the location, the covariance, and the squared distance, the weight and the outlier flag of each observation in a RobustCovarianceResult. The weight of an observation is its bisquare weight in the M-step. cov returns the covariance of that fit.
The me of s fixes the centre of both parts, and a mean keyword does the same. The fit flags the outliers at the q of this estimator, whose default is the q of s. An Online wrapper reads the cache of this estimator, so the constructor refuses a cache on s.
The estimator has no exact update, so an Online wrapper refits it over the rows of its Sample Buffer, see SampleBufferState.
Fields
s: S estimator of the first part of the MM estimate, anSCovariance. It gives the breakdown point and the scale.
rw: M-step of the second part of the MM estimate, aBisquareReweighting. It gives the efficiency.
q: Probability of the cut-off of the squared distance above which an observation is an outlier,0 < q < 1. Seerobust_outliers.
cache: Optional partial-fit state. It isnothinguntilpartial_fit!writes one. When the caller gives no data matrix, the batch verb of the estimator reads it. Each propagation channel does one thing with it.factorykeeps it unchanged, because a factory call resolves the configuration, not the sample.port_opt_viewcopies the entries of the selected assets into a new state, so the viewed estimator holds the state of those assets alone.obs_weights_viewremoves it, because a state has no slice on the observation axis. Only a type with an observation-weights field has that channel. A type with no such field falls through to the identity method, so it keeps its state. A family whose state has no exact asset slice removes it on both axes and names the reason.
Constructors
MMCovariance(; s::SCovariance = SCovariance(), rw::BisquareReweighting = BisquareReweighting(), q::Number = s.q, cache::Option{<:AbstractPartialFitState} = nothing) -> MMCovarianceKeywords correspond to the struct's fields.
Validation
0 < q < 1.isnothing(s.cache).
Propagated parameters
factory passes its arguments on to these @fprop fields:
View parameters
port_opt_view takes the view of these @vprop fields at the selected indices:
s: Recursively viewed throughport_opt_view.cache: Sliced to the selected assets throughport_opt_view.
Examples
julia> MMCovariance()MMCovariance s ┼ SCovariance │ me ┼ nothing │ rho ┼ BisquareRho() │ bdp ┼ Float64: 0.5 │ alg ┼ DetS() │ q ┴ Float64: 0.975 rw ┼ BisquareReweighting │ eff ┼ Float64: 0.95 │ target ┴ ShapeEfficiency() q ┴ Float64: 0.975Related
References
- [130] K. S. Tatsuoka and D. E. Tyler. On the uniqueness of S-functionals and M-functionals under nonelliptical distributions. The Annals of Statistics 28, 1219–1243 (2000). Not read. See
bisquare_mstep. - [127] M. Salibián-Barrera, S. Van Aelst and G. Willems. Principal components analysis based on multivariate MM estimators with fast and robust bootstrap. Journal of the American Statistical Association 101, 1198–1211 (2006). Not read. See
bisquare_efficiency. - [125] R. A. Maronna, R. D. Martin, V. J. Yohai and M. Salibián-Barrera. Robust Statistics: Theory and Methods (with R). Second edition. Wiley (2019). Not read.
StatsAPI.fit — Method
StatsAPI.fit(ce::MMCovariance, X::MatNum; dims::Int = 1, mean = nothing, kwargs...)
-> RobustCovarianceResultFits the MM estimate of MMCovariance to the data.
Algorithm
- Fit the S estimate
ce.swith itsStatsAPI.fit, withdims,meanandkwargs. - Orient
Xwithdims_oriented. - Do the M-step of
ce.rwfrom the S estimate withbisquare_mstep. The centre is fixed when themeankeyword or themeofce.sis notnothing.
Arguments
ce: The MM covariance estimator.X: Data matrixobservations × assetsif thedimskeyword does not exist ordims = 1,assets × observationswhendims = 2.dims: Dimension along which the computation runs.mean: Optional precomputed centre of the data. A given centre fixes the location of the fit.kwargs...: More keyword arguments for themeofce.s.
Validation
- The validation of
StatsAPI.fitofSCovariance. - The weighted scatter of each M-step is positive definite. Otherwise, the method raises the
DomainErrorofunit_determinant!.
Returns
res::RobustCovarianceResult: The fit. The weight of an observation is its bisquare weight in the M-step.
Related
References
- [125]
- R. A. Maronna, R. D. Martin, V. J. Yohai and M. Salibián-Barrera. Robust Statistics: Theory and Methods (with R). Second Edition (Wiley, 2019).
- [127]
- M. Salibián-Barrera, S. Van Aelst and G. Willems. Principal components analysis based on multivariate MM estimators with fast and robust bootstrap. Journal of the American Statistical Association 101, 1198–1211 (2006).
- [130]
- K. S. Tatsuoka and D. E. Tyler. On the uniqueness of S-functionals and M-functionals under nonelliptical distributions. The Annals of Statistics 28, 1219–1243 (2000).