MM covariance

PortfolioOptimisers.BisquareReweighting — Type
struct BisquareReweighting{__T_eff, __T_target} <: AbstractRobustReweighting

Fits 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 efficiency eff tunes the constant of the M-step, a subtype of AbstractEfficiencyTarget.

Constructors

BisquareReweighting(;    eff::Number = 0.95,    target::AbstractEfficiencyTarget = ShapeEfficiency()) -> BisquareReweighting

Keywords 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.
source
PortfolioOptimisers.MMCovariance — Type
struct MMCovariance{__T_s, __T_rw, __T_q, __T_cache} <: AbstractRobustCovarianceEstimator

Estimates 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:

  1. The S estimate s, see SCovariance. It gives the breakdown point and the scale.
  2. The M-step rw from the S estimate, with the scale fixed, see BisquareReweighting. 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, an SCovariance. It gives the breakdown point and the scale.
  • rw: M-step of the second part of the MM estimate, a BisquareReweighting. It gives the efficiency.
  • q: Probability of the cut-off of the squared distance above which an observation is an outlier, 0 < q < 1. See robust_outliers.
  • cache: Optional partial-fit state. It is nothing until partial_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. factory keeps it unchanged, because a factory call resolves the configuration, not the sample. port_opt_view copies the entries of the selected assets into a new state, so the viewed estimator holds the state of those assets alone. obs_weights_view removes 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) -> MMCovariance

Keywords correspond to the struct's fields.

Validation

  • 0 < q < 1.
  • isnothing(s.cache).

Propagated parameters

factory passes its arguments on to these @fprop fields:

  • s: Recursively updated through factory.
  • cache: Carried unchanged through factory.

View parameters

port_opt_view takes the view of these @vprop fields at the selected indices:

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.975

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.
  • [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.
source
StatsAPI.fit — Method
StatsAPI.fit(ce::MMCovariance, X::MatNum; dims::Int = 1, mean = nothing, kwargs...)
    -> RobustCovarianceResult

Fits the MM estimate of MMCovariance to the data.

Algorithm

  1. Fit the S estimate ce.s with its StatsAPI.fit, with dims, mean and kwargs.
  2. Orient X with dims_oriented.
  3. Do the M-step of ce.rw from the S estimate with bisquare_mstep. The centre is fixed when the mean keyword or the me of ce.s is not nothing.

Arguments

  • ce: The MM covariance estimator.
  • X: Data matrix observations × assets if the dims keyword does not exist or dims = 1, assets × observations when dims = 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 the me of ce.s.

Validation

  • The validation of StatsAPI.fit of SCovariance.
  • The weighted scatter of each M-step is positive definite. Otherwise, the method raises the DomainError of unit_determinant!.

Returns

  • res::RobustCovarianceResult: The fit. The weight of an observation is its bisquare weight in the M-step.

Related

source

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).