LoGo
PortfolioOptimisers.LoGo — Type
struct LoGo{__T_de, __T_sim<:AbstractNonNegativeSimilarityMatrixAlgorithm, __T_pdm} <: InverseMatrixSparsificationAlgorithmSparsifies 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 refusesAngularSimilarity.
pdm: Positive definite matrix estimator.
Constructors
LoGo(; de::AbstractDistanceEstimator = Distance(; alg = CanonicalDistance()), sim::AbstractNonNegativeSimilarityMatrixAlgorithm = MaximumDistanceSimilarity(), pdm::Option{<:AbstractPosdefEstimator} = Posdef()) -> LoGoKeywords 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
InverseMatrixSparsificationAlgorithmAbstractDistanceEstimatorAbstractNonNegativeSimilarityMatrixAlgorithmAbstractSimilarityMatrixAlgorithmMaximumDistanceSimilarityExponentialSimilarityGeneralExponentialSimilarity
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.
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
- Pass every argument to
logo!, which does the steps and the checks of the transformation. - Return
sigma.
Arguments
je: The LoGo algorithm. Its fieldpdmholds the positive definite repair, so the method takes nopdmargument.sigma:N × Ncovariance or correlation matrix. The method writes the result into it.X:T × Ndata matrix whendimsis1, andN × Twhendimsis2.dims: Dimension along which the computation runs.kwargs...: Keyword arguments thatlogo!passes todistance.
Validation
- Every check of
logo!applies. The error comes from step 1.
Returns
sigma::MatNum: The input matrixsigma, which now holds the LoGo covariance matrix.
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).