Base robust covariance: private API

PortfolioOptimisers.robust_centre — Function
robust_centre(me::Option{<:AbstractExpectedReturnsEstimator}, X::MatNum; mean = nothing,
              kwargs...) -> Option{<:VecNum}

Returns the fixed centre of a robust fit, or nothing for a joint location.

The mean keyword wins over me, as for Covariance. With neither, the fit estimates its own location.

Arguments

  • me: The expected returns estimator of the robust estimator, or nothing.
  • X: The data matrix, observations × assets.
  • mean: Optional precomputed centre of the data.
  • kwargs...: More keyword arguments for the expected returns estimator.

Returns

  • mu::Option{<:VecNum}: The fixed centre, or nothing.

Related

source
PortfolioOptimisers.assert_robust_rows — Function
assert_robust_rows(n::Integer, p::Integer, what::AbstractString)

Refuses a sample with too few observations for a robust scatter.

A robust scatter of p assets needs more than p observations in the set that defines it. Otherwise the matrix is singular. MCDCovariance passes the number of observations, because its subset holds more than p observations exactly when the sample does. TylerCovariance passes the number of observations with a weight that is not zero. SCovariance passes the size h of its start subsets.

Arguments

  • n: The number of observations that define the scatter.
  • p: The number of assets.
  • what: The name of n in the message.

Validation

  • n > p. Otherwise, the function raises a DomainError that names n, p and the limit.

Returns

  • nothing.

Related

source