Correlation covariance
PortfolioOptimisers.CorrelationCovariance Type
struct CorrelationCovariance{__T_ce} <: AbstractCovarianceEstimatorA covariance estimator that returns the correlation matrix as both the covariance and correlation.
CorrelationCovariance wraps another covariance estimator and delegates both cov and cor calls to the underlying estimator's cor method. This is useful when a correlation matrix is needed in contexts that accept a covariance estimator.
Fields
ce: Covariance estimator.
Constructors
CorrelationCovariance(;
ce::StatsBase.CovarianceEstimator = Covariance()
) -> CorrelationCovarianceKeywords correspond to the struct's fields.
Examples
julia> CorrelationCovariance()
CorrelationCovariance
ce ┼ Covariance
│ me ┼ SimpleExpectedReturns
│ │ w ┴ nothing
│ ce ┼ GeneralCovariance
│ │ ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)
│ │ w ┴ nothing
│ alg ┴ FullMoment()Related
sourceStatistics.cov Method
Statistics.cov(ce::CorrelationCovariance, X::MatNum; dims::Int = 1,
kwargs...)Compute the correlation matrix using the underlying estimator.
This method delegates to Statistics.cor(ce.ce, X; dims = dims, kwargs...), returning the correlation matrix as the "covariance". This is useful when a correlation matrix is required in a context that accepts a covariance estimator.
Arguments
ce: Correlation covariance estimator.X: Data matrix of asset returns (observations × assets).dims: Dimension along which to perform the computation.kwargs...: Additional keyword arguments passed to the underlying estimator.
Returns
rho::MatNum: Correlation matrixfeatures x features.
Related
sourceStatistics.cor Method
Statistics.cor(ce::CorrelationCovariance, X::MatNum; dims::Int = 1,
kwargs...)Compute the correlation matrix using the underlying estimator.
This method delegates to Statistics.cor(ce.ce, X; dims = dims, kwargs...).
Arguments
ce: Correlation covariance estimator.X: Data matrix of asset returns (observations × assets).dims: Dimension along which to perform the computation.kwargs...: Additional keyword arguments passed to the underlying estimator.
Returns
rho::MatNum: Correlation matrixfeatures x features.
Related
source