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 ┴ Full()Related
sourcePortfolioOptimisers.factory Method
factory(ce::CorrelationCovariance, w::ObsWeights) -> CorrelationCovarianceReturn a new CorrelationCovariance estimator with observation weights w applied to the underlying covariance estimator.
Arguments
ce: Covariance estimator.w: Observation weights vectorobservations × 1.
Returns
ce: New covariance estimator of the same type as the argument, with the new weights applied.
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