Base Moments
PortfolioOptimisers.Full
— TypeFull <: AbstractMomentAlgorithm
Full
is used to indicate that all available data points are included in the moment estimation process.
Related
PortfolioOptimisers.Semi
— TypeSemi <: AbstractMomentAlgorithm
Semi
is used for semi-moment estimators, where only observations below the mean (i.e., negative deviations) are considered.
Related
PortfolioOptimisers.AbstractExpectedReturnsEstimator
— TypeAbstractExpectedReturnsEstimator <: 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
PortfolioOptimisers.AbstractExpectedReturnsAlgorithm
— TypeAbstractExpectedReturnsAlgorithm <: 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
PortfolioOptimisers.AbstractCovarianceEstimator
— TypeAbstractCovarianceEstimator <: 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
PortfolioOptimisers.AbstractMomentAlgorithm
— TypeAbstractMomentAlgorithm <: AbstractAlgorithm
Abstract supertype for all moment algorithm types in PortfolioOptimisers.jl.
All concrete types that implement a specific algorithm for moment estimation (e.g., full, semi) should subtype AbstractMomentAlgorithm
. This allows for flexible extension and dispatch of moment estimation routines.
Related
PortfolioOptimisers.AbstractVarianceEstimator
— TypeAbstractVarianceEstimator <: 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
PortfolioOptimisers.robust_cov
— Functionrobust_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 tocov
.
ReturnsResult
- Covariance matrix as computed by the estimator and optional weights.
Related
PortfolioOptimisers.robust_cor
— Functionrobust_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 tocor
.
ReturnsResult
- Correlation matrix as computed by the estimator and optional weights.
Related