MM-Estimator

The MM-Estimator is a robust covariance that stays reliable when almost half the periods are outliers while losing little efficiency for normal returns: an S-estimator of high breakdown followed by an M-step that raises its efficiency to 95% in its shape, the correlations and the ratios of the variances (Tatsuoka and Tyler, 2000; Salibián-Barrera, Van Aelst and Willems, 2006; Maronna, Martin, Yohai and Salibián-Barrera, 2019).

The formula for the MM-Estimator starts from Tukey’s bisquare function rho of the Mahalanobis distance d with constant c, and the squared distance of every period for a location m and scatter V, with \(y_{t} = r_{t} - m\):

\[\rho(d) = 1 - \left(1 - \left(\frac{d}{c}\right)^{2}\right)^{3} \quad \text{if } d \leq c\] \[\rho(d) = 1 \quad \text{if } d > c\] \[d_{t}^{2} = y'_{t} \cdot V^{-1} \cdot y_{t}\]

The S-step takes the scatter V with the smallest scale s that solves the equation below for the N assets and T periods, and the M-step then reweights the periods with the same function with a larger c at that scale:

\[\operatorname{mean}\left(\rho\left(\frac{d_{t}}{\sqrt{s}}\right)\right) = \frac{1 - \frac{N}{T}}{2}\]

Both steps are iteratively reweighted means and covariances, with weights that fall to zero for periods far from the bulk; the estimate describes the ordinary co-movement of the assets and ignores the periods that do not fit it.

Its parameters can be set, and it can be shown as a correlation matrix. The covariance matrix holds the variance of every asset and the covariance of every pair, the risk input of the mean-variance analysis of Markowitz (1952). With N assets it holds N (N + 1) / 2 numbers to estimate, and when N is not small compared to the number of periods T, the sample estimate is noisy and ill-conditioned: its smallest eigenvalues come out too small, and an optimizer that inverts it puts large weights on the combinations of assets that only look safe in the sample. The estimators differ in how they deal with this: by shrinking towards a structured target, by cleaning the eigenvalues, by weighting recent periods, by counting only large moves or by resisting outliers. Every estimate is annualized with the number of periods in a year.

Also known as: MM covariance, robust MM-estimator.

In the Finance Toolkit this is get_covariance_estimate with method="mm", the same function as Covariance Estimate.

Example · AAPL, MSFT, JNJ, XOM · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_covariance_estimate:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AAPL", "MSFT", "JNJ", "XOM"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.portfolio.get_covariance_estimate(method="mm")

Which returns:

References

  • Paper Tatsuoka, K. S. and Tyler, D. E. (2000). “On the Uniqueness of S-Functionals and M-Functionals under Nonelliptical Distributions.” The Annals of Statistics, 28(4), 1219-1243.
  • Paper Salibián-Barrera, M., Van Aelst, S. and Willems, G. (2006). “Principal Components Analysis Based on Multivariate MM Estimators with Fast and Robust Bootstrap.” Journal of the American Statistical Association, 101(475), 1198-1211.
  • Paper Maronna, R. A., Martin, R. D., Yohai, V. J. and Salibián-Barrera, M. (2019). “Robust Statistics: Theory and Methods (with R).” 2nd edition, Wiley.
  • Library Shares similar logic as PortfolioAnalytics (R)’s custom.covRob.MM (MM-Estimator)
Share