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 is a composable algorithm type for estimating sparse inverse covariance matrices using the Planar Maximally Filtered Graph (PMFG) and clique-based decomposition, as described in [54]. It combines a distance estimator and a similarity matrix algorithm, both validated and extensible, to produce a robust, interpretable sparse precision matrix for use in portfolio optimization and risk management.
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, and the matrix that comes out is exactly zero wherever the network carries no edge.
sigma is then replaced by the inverse of that precision matrix, so what the caller receives is dense. The filtering is a statement about which pairs are conditionally independent given the rest, and it survives only in the precision.
Fields
de: Distance matrix estimator.
sim: Similarity matrix algorithm. The PMFG cannot take a negative weight, so the family is the non-negative one andAngularSimilarityis refused.
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
- [54] W. Barfuss, G. P. Massara, T. Di Matteo and T. Aste. Parsimonious modeling with information filtering networks. Phys. Rev. E 94, 062306 (2016).
PortfolioOptimisers.matrix_processing_algorithm! — Method
matrix_processing_algorithm!(je::LoGo, sigma::MatNum,
X::MatNum; dims::Int = 1, kwargs...)Apply the LoGo (Local-Global) transformation in-place to the covariance matrix, as a step of the matrix processing pipeline.
This method provides a standard interface for applying the LoGo algorithm to a covariance matrix within the matrix processing pipeline of PortfolioOptimisers.jl. It validates inputs, computes the LoGo sparse inverse covariance matrix, and updates sigma in-place. If a positive definite matrix estimator (pdm) is not nothing, the result is projected to the nearest positive definite matrix.
This is the contract LoGo satisfies as a member of AbstractMatrixProcessingAlgorithm: the pipeline calls matrix_processing_algorithm!(alg, sigma, X; dims, kwargs...) on each of its algorithms in turn, each one writes into the same sigma, and each returns nothing. The family lives in src/04_MatrixProcessing/04_MatrixProcessing.jl, and this method is the only one of it that this file declares.
Algorithm
- Forward every argument to
logo!, which carries the steps and the checks of the transformation.
Arguments
je: LoGo algorithm instance (LoGo). Its ownpdmfield carries the positive definite repair, so there is nopdmargument here.sigma: Covariance matrix (N × N), updated in-place.X: Data matrix (T × NorN × T).dims: Dimension along which to perform the computation.kwargs...: Additional keyword arguments passed to distance and similarity estimators.
Validation
- Every check of
logo!applies, and it raises from step 1.
Returns
nothing. The inputsigmais updated in-place.
Related
References
- [54]
- W. Barfuss, G. P. Massara, T. Di Matteo and T. Aste. Parsimonious modeling with information filtering networks. Phys. Rev. E 94, 062306 (2016).