Base Moments

PortfolioOptimisers.AbstractExpectedReturnsEstimatorType
AbstractExpectedReturnsEstimator <: AbstractEstimator

Abstract supertype for all expected returns estimator types in PortfolioOptimisers.jl.

All concrete types that implement expected returns estimation (e.g., sample mean, Bayesian estimators) should subtype AbstractExpectedReturnsEstimator. This enables a consistent interface for expected returns estimation routines throughout the package.

Related

source
PortfolioOptimisers.AbstractExpectedReturnsAlgorithmType
AbstractExpectedReturnsAlgorithm <: AbstractAlgorithm

Abstract supertype for all expected returns algorithm types in PortfolioOptimisers.jl.

All concrete types that implement a specific algorithm for expected returns estimation (e.g., shrinkage, robust mean) should subtype AbstractExpectedReturnsAlgorithm. This allows for flexible extension and dispatch of expected returns estimation routines.

Related

source
PortfolioOptimisers.AbstractCovarianceEstimatorType
AbstractCovarianceEstimator <: StatsBase.CovarianceEstimator

Abstract supertype for all covariance estimator types in PortfolioOptimisers.jl.

All concrete types that implement covariance estimation (e.g., sample covariance, shrinkage estimators) should subtype AbstractCovarianceEstimator. This enables a consistent interface for covariance estimation routines throughout the package.

Related

source
PortfolioOptimisers.AbstractVarianceEstimatorType
AbstractVarianceEstimator <: AbstractCovarianceEstimator

Abstract supertype for all variance estimator types in PortfolioOptimisers.jl.

All concrete types that implement variance estimation (e.g., sample variance, robust variance estimators) should subtype AbstractVarianceEstimator. This enables a consistent interface for variance estimation routines and allows for flexible extension and dispatch within the package.

Related

source
PortfolioOptimisers.robust_covFunction
robust_cov(ce::StatsBase.CovarianceEstimator, X::AbstractMatrix, [w::AbstractWeights]; dims::Int = 1, mean = nothing, kwargs...)

Compute the covariance matrix robustly using the specified covariance estimator ce, data matrix X, and optional weights vector w.

This function attempts to compute the weighted covariance matrix using the provided estimator and keyword arguments. If an error occurs (e.g., due to unsupported keyword arguments), it retries with a reduced set of arguments for compatibility. This ensures robust weighted covariance estimation across different estimator types and StatsBase versions.

Arguments

  • ce::StatsBase.CovarianceEstimator: Covariance estimator to use.
  • X::AbstractMatrix: Data matrix.
  • w::AbstractWeights: Optional weights for each observation.
  • dims: Dimension along which to compute the covariance.
  • mean: Optional mean array to use for centering.
  • kwargs...: Additional keyword arguments passed to cov.

ReturnsResult

  • Covariance matrix as computed by the estimator and optional weights.

Related

source
PortfolioOptimisers.robust_corFunction
robust_cor(ce::StatsBase.CovarianceEstimator, X::AbstractMatrix, [w::AbstractWeights]; dims::Int = 1, mean = nothing, kwargs...)

Compute the correlation matrix robustly using the specified covariance estimator ce, data matrix X, and optional weights vector w.

This function attempts to compute the weighted correlation matrix using the provided estimator and keyword arguments. If an error occurs, it falls back to computing the weighted covariance matrix and then converts it to a correlation matrix. This ensures robust weighted correlation estimation across different estimator types and StatsBase versions.

Arguments

  • ce::StatsBase.CovarianceEstimator: Covariance estimator to use.
  • X::AbstractMatrix: Data matrix.
  • w::AbstractWeights: Optional weights for each observation.
  • dims: Dimension along which to compute the correlation.
  • mean: Optional mean array to use for centering.
  • kwargs...: Additional keyword arguments passed to cor.

ReturnsResult

  • Correlation matrix as computed by the estimator and optional weights.

Related

source