MM covariance: private API

PortfolioOptimisers.mm_constant — Function
mm_constant(rw::BisquareReweighting, p::Integer) -> Number

Returns the tuning constant $c^2$ of the bisquare function at which the part rw.target of the M-step has the efficiency rw.eff at the normal model.

The efficiency of bisquare_efficiency rises with $c^2$, so a bisection finds the constant. The interval starts at $[p/2, p]$. Its lower bound halves and its upper bound doubles until it holds the constant.

Arguments

  • rw: The reweighting step.
  • p: The number of assets.

Returns

  • c2::Number: The tuning constant.

Related

source
PortfolioOptimisers.bisquare_mstep — Function
bisquare_mstep(rw::BisquareReweighting, X::MatNum, mu::VecNum, sigma::MatNum,
               fixed::Bool, q::Number, maxsteps::Integer) -> RobustCovarianceResult

Does the M-step of BisquareReweighting from the location mu and the covariance sigma of a raw fit.

Algorithm

  1. Take the constant $c^2$ of mm_constant, the shape $\mathbf{\Sigma}_0 / s$ of determinant one with unit_determinant!, and the scale $s = \lvert \mathbf{\Sigma}_0 \rvert^{1/p}$ as the ratio of a diagonal entry of the covariance and of the shape.
  2. Repeat at most maxsteps times:
    1. Take the weight of each observation, srho_weight of BisquareRho at its squared distance in the metric of the shape, divided by s.
    2. Take the weighted mean and the weighted scatter of determinant one with weighted_shape.
    3. Stop when the relative change of the shape and the change of the location in the metric of the scatter are both below sqrt(eps), see shape_converged.
  3. Warn when the steps do not converge, and keep the last iterate.
  4. Build the fit of the covariance s times the shape with srho_fit, with the weights at $c^2$.

Arguments

  • rw: The reweighting step.
  • X: The data matrix, observations × assets.
  • mu: The location of the raw fit.
  • sigma: The covariance of the raw fit.
  • fixed: Whether the centre is fixed at mu.
  • q: The probability of the cut-off of the outliers.
  • maxsteps: The largest number of steps, S_MAX_ITER in a fit.

Validation

  • sigma is positive definite, and so is the weighted scatter of each step. Otherwise, the method raises the DomainError of unit_determinant!.

Returns

  • res::RobustCovarianceResult: The fit.

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. The fixed point agrees with the R package rrcov, version 1.7-7.
source
PortfolioOptimisers.show_fields — Method
show_fields(
    _::MMCovariance
) -> Tuple{Symbol, Symbol, Symbol}

Renders every field of an MMCovariance except cache.

A cache holds the state of an incremental fit, not a part of the configuration. Set set_show_nothing_fields!(:MMCovariance, true) to render it.

Arguments

  • ::MMCovariance: The estimator, read for its type alone.

Returns

  • fields::Tuple: The names of the fields to render, (:s, :rw, :q).

Related

source

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