LoGo

struct LoGo{__T_de, __T_sim<:AbstractNonNegativeSimilarityMatrixAlgorithm, __T_pdm} <: InverseMatrixSparsificationAlgorithm

Sparsifies the inverse covariance matrix on the cliques of an information filtering network.

LoGo selects the LoGo method of [130] as the algorithm of a MatrixProcessing estimator. The method builds a Triangulated Maximally Filtered Graph (TMFG) on a similarity matrix of the assets, and it computes the precision matrix from the covariance blocks of the cliques of the graph. de gives the distance matrix, and sim maps it to the similarity matrix.

What is sparse is the precision, not the covariance

J_LoGo sums the inverse of each clique block and subtracts the inverse of each separator block. The result is exactly zero at each pair that no edge of the network joins.

logo! then writes the inverse of that precision matrix into sigma, so the caller gets a dense matrix. The filtering states which pairs are conditionally independent given the other assets, and only the precision matrix holds that statement.

The graph comes from sim, not from the likelihood

Algorithm 1 of [130] builds the TMFG by the log-likelihood. At each step it inserts the vertex that maximises $\log\det\hat{\mathbf{R}}_{S} - \log\det\hat{\mathbf{R}}_{C}$. The same work states that a TMFG on the squared correlations approximates that choice to second order in the correlations. This type builds the TMFG with PMFG_T2s on the similarity matrix of sim, and its default similarity is neither of the two. [130] returns the precision matrix. The inversion and the repair by pdm come from this library alone.

Fields

  • de: Distance matrix estimator.
  • sim: Similarity matrix algorithm that maps the distance matrix to the weights of the PMFG. The PMFG cannot take a negative weight, so the field takes the non-negative family alone, and the constructor refuses AngularSimilarity.
  • pdm: Positive definite matrix estimator.

Constructors

LoGo(;    de::AbstractDistanceEstimator = Distance(; alg = CanonicalDistance()),    sim::AbstractNonNegativeSimilarityMatrixAlgorithm = MaximumDistanceSimilarity(),    pdm::Option{<:AbstractPosdefEstimator} = Posdef()) -> LoGo

Keywords correspond to the struct's fields.

Examples

julia> LoGo()LoGo   de ┼ Distance      │   power ┼ nothing      │     alg ┴ CanonicalDistance()  sim ┼ MaximumDistanceSimilarity()  pdm ┼ Posdef      │      alg ┼ UnionAll: NearestCorrelationMatrix.Newton      │   kwargs ┴ @NamedTuple{}: NamedTuple()

Related

References

  • [130] W. Barfuss, G. P. Massara, T. Di Matteo and T. Aste. Parsimonious modeling with information filtering networks. Phys. Rev. E 94, 062306 (2016). Section II.C, Equation 4 and Algorithm 1.
source
PortfolioOptimisers.matrix_processing_algorithm! — Method
matrix_processing_algorithm!(je::LoGo, sigma::MatNum,
                             X::MatNum; dims::Int = 1, kwargs...)

Apply the LoGo (Local-Global) transformation to sigma in place, as the :alg step of matrix_processing!.

The method runs logo! on sigma and returns sigma. When je.pdm is not nothing, logo! repairs the result to the nearest positive definite matrix.

LoGo satisfies the contract of the AbstractMatrixProcessingAlgorithm family with this method. The pipeline calls matrix_processing_algorithm!(alg, sigma, X; kwargs...) on its algorithm, the algorithm writes into sigma, and the method returns sigma. src/04_MatrixProcessing/04_MatrixProcessing.jl holds the family, and this file declares one method of it.

Algorithm

  1. Pass every argument to logo!, which does the steps and the checks of the transformation.
  2. Return sigma.

Arguments

  • je: The LoGo algorithm. Its field pdm holds the positive definite repair, so the method takes no pdm argument.
  • sigma: N × N covariance or correlation matrix. The method writes the result into it.
  • X: T × N data matrix when dims is 1, and N × T when dims is 2.
  • dims: Dimension along which the computation runs.
  • kwargs...: Keyword arguments that logo! passes to distance.

Validation

  • Every check of logo! applies. The error comes from step 1.

Returns

  • sigma::MatNum: The input matrix sigma, which now holds the LoGo covariance matrix.

Related

source

References

[130]
W. Barfuss, G. P. Massara, T. Di Matteo and T. Aste. Parsimonious modeling with information filtering networks. Phys. Rev. E 94, 062306 (2016).