Mutual Information Covariance

PortfolioOptimisers.MutualInfoCovarianceType
struct MutualInfoCovariance{T1, T2, T3} <: AbstractCovarianceEstimator
    ve::T1
    bins::T2
    normalise::T3
end

Covariance estimator based on mutual information.

MutualInfoCovariance implements a robust covariance estimator that uses mutual information (MI) to capture both linear and nonlinear dependencies between asset returns. This estimator is particularly useful for identifying complex relationships that are not detected by traditional correlation-based methods. The MI matrix is optionally normalised and then rescaled by marginal standard deviations to produce a covariance matrix.

Fields

  • ve::AbstractVarianceEstimator: Variance estimator used to compute marginal standard deviations.
  • bins::Union{<:AbstractBins, <:Integer}: Binning algorithm or fixed number of bins for histogram-based MI estimation.
  • normalise::Bool: Whether to normalise the MI matrix.

Constructor

MutualInfoCovariance(; ve::AbstractVarianceEstimator = SimpleVariance(),
                      bins::Union{<:AbstractBins, <:Integer} = HacineGharbiRavier(),
                      normalise::Bool = true)

Creates a MutualInfoCovariance object with the specified variance estimator, binning strategy, and normalisation option.

Related

source
PortfolioOptimisers.MutualInfoCovarianceMethod
MutualInfoCovariance(; ve::AbstractVarianceEstimator = SimpleVariance(),
                      bins::Union{<:AbstractBins, <:Integer} = HacineGharbiRavier(),
                      normalise::Bool = true)

Construct a MutualInfoCovariance estimator for robust covariance or correlation estimation using mutual information.

This constructor creates a MutualInfoCovariance object using the specified variance estimator, binning algorithm (or fixed bin count), and normalisation flag. The estimator computes the covariance matrix by combining the mutual information matrix (optionally normalised) with the marginal standard deviations.

Arguments

  • ve::AbstractVarianceEstimator: Variance estimator.
  • bins::Union{<:AbstractBins, <:Integer}: Binning algorithm or fixed number of bins for MI estimation.
  • normalise::Bool: Whether to normalise the MI matrix.

ReturnsResult

  • MutualInfoCovariance: A configured mutual information-based covariance estimator.

Validation

  • If bins is an integer, asserts that bins > 0.

Examples

julia> ce = MutualInfoCovariance()
MutualInfoCovariance
         ve | SimpleVariance
            |          me | SimpleExpectedReturns
            |             |   w | nothing
            |           w | nothing
            |   corrected | Bool: true
       bins | HacineGharbiRavier()
  normalise | Bool: true

Related

source
Statistics.corMethod
cor(ce::MutualInfoCovariance, X::AbstractMatrix; dims::Int = 1, kwargs...)

Compute the mutual information (MI) correlation matrix using a MutualInfoCovariance estimator.

This method computes the pairwise mutual information correlation matrix for the input data matrix X, using the binning strategy and normalisation specified in ce. The MI correlation captures both linear and nonlinear dependencies between asset returns, making it robust to complex relationships that may not be detected by traditional correlation measures.

Arguments

  • ce::MutualInfoCovariance: Mutual information-based covariance estimator.
  • X::AbstractMatrix: Data matrix of asset returns (observations × assets).
  • dims::Int: Dimension along which to compute the correlation.
  • kwargs...: Additional keyword arguments (currently unused).

ReturnsResult

  • rho::Matrix{Float64}: Symmetric matrix of mutual information-based correlation coefficients.

Validation

  • Asserts that dims is either 1 or 2.

Related

source
Statistics.covMethod
cov(ce::MutualInfoCovariance, X::AbstractMatrix; dims::Int = 1, kwargs...)

Compute the mutual information (MI) covariance matrix using a MutualInfoCovariance estimator.

This method computes the pairwise mutual information covariance matrix for the input data matrix X, using the binning strategy and normalisation specified in ce. The MI covariance matrix is obtained by rescaling the MI correlation matrix by the marginal standard deviations, as estimated by the variance estimator in ce.

Arguments

  • ce::MutualInfoCovariance: Mutual information-based covariance estimator.
  • X::AbstractMatrix: Data matrix of asset returns (observations × assets).
  • dims::Int: Dimension along which to compute the covariance.
  • kwargs...: Additional keyword arguments passed to the variance estimator.

ReturnsResult

  • sigma::Matrix{Float64}: Symmetric matrix of mutual information-based covariances.

Validation

  • Asserts that dims is either 1 or 2.

Examples

Related

source