Network Estimator

PortfolioOptimisers.NetworkEstimatorType
struct NetworkEstimator{__T_ce, __T_de, __T_alg<:(Union{var"#s1773", var"#s1772"} where {var"#s1773"<:AbstractNonNegativeSimilarityMatrixAlgorithm, var"#s1772"<:AbstractTreeType}), __T_sep} <: AbstractNetworkEstimator

Builds an asset network from a covariance estimate, and says which pairs of assets it relates.

NetworkEstimator encapsulates the configuration for constructing a network from asset data, including the covariance estimator, distance estimator, tree or similarity algorithm, and the separation algorithm that says how far apart two assets sit in the resulting graph.

Fields

  • ce: Covariance estimator.
  • de: Distance matrix estimator.
  • alg: Tree or similarity matrix algorithm. A similarity here selects the network by building a PMFG, so the family is the non-negative one and AngularSimilarity is refused.
  • sep: Separation algorithm, the rule measuring how far apart two assets sit in the network and the budget beyond which they count as unrelated.

Constructors

NetworkEstimator(;    ce::StatsBase.CovarianceEstimator = PortfolioOptimisersCovariance(),    de::AbstractDistanceEstimator = Distance(; alg = CanonicalDistance()),    alg::Tree_SimMat = KruskalTree(),    sep::AbstractSeparationAlgorithm = HopCount()) -> NetworkEstimator

Keywords correspond to the struct's fields.

Propagated parameters

When factory is called on this type, the following @fprop-tagged fields are automatically propagated:

  • ce: Recursively updated via factory.
  • de: Recursively updated via factory.

The separation lives here, not on the consumer

sep says which pairs the network relates, and every consumer that reads a closure of this graph needs that answer: phylogeny_matrix and the phylogeny constraint families, both clusterise methods, and Proximity. It therefore sits on the estimator that builds the graph rather than on any one of them — a rule visible only to the feature producer would be structurally invisible to the constraint path, which receives nothing but this estimator.

The one exception is a consumer that reads the structure rather than a closure of it, and sep is inert there: the weighted routes of centrality_graph take the weighted graph itself, because a closure is a sum of matrix powers and a power of a weighted matrix sums products of distances. So a HopCount of n = 2 moves a DegreeCentrality and leaves a ClosenessCentrality where it was. At the default HopCount(; n = 1) nothing is visible, since the closure of a graph at one hop is the graph.

The budget rides on the member: HopCount(; n = 2) rather than a bare n = 2 beside sep. A budget stated apart from the rule that measures it has no statable unit, and becomes a dead field the moment a member measures something other than hops — which PathLength does, budgeting in the distance estimator's units instead.

Only HopCount is admitted by every consumer, and the split falls on whether the consumer walks a matrix power. Both clusterise methods accumulate $\sum_{i=0}^{n}(\mathbf{D}^i - \mathbf{A}^i)$, so they read sep.n as a power count and refuse PathLength at dispatch: a radius has no analogue of a matrix power. phylogeny_matrix and Proximity take either, each through a method of its own — a hop ball is a clamped power sum, a radius ball is a threshold on separation_matrix.

Examples

julia> NetworkEstimator()NetworkEstimator   ce ┼ PortfolioOptimisersCovariance      │   ce ┼ Covariance      │      │    me ┼ SimpleExpectedReturns      │      │       │   w ┴ nothing      │      │    ce ┼ GeneralCovariance      │      │       │   ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)      │      │       │    w ┴ nothing      │      │   alg ┼ FullMoment()      │      │     w ┴ nothing      │   mp ┼ MatrixProcessing      │      │     pdm ┼ Posdef      │      │         │      alg ┼ UnionAll: NearestCorrelationMatrix.Newton      │      │         │   kwargs ┴ @NamedTuple{}: NamedTuple()      │      │      dn ┼ nothing      │      │      dt ┼ nothing      │      │     alg ┼ nothing      │      │   order ┴ NTuple{4, Symbol}: (:pdm, :dn, :dt, :alg)   de ┼ Distance      │   power ┼ nothing      │     alg ┴ CanonicalDistance()  alg ┼ KruskalTree      │     args ┼ Tuple{}: ()      │   kwargs ┴ @NamedTuple{}: NamedTuple()  sep ┼ HopCount      │   n ┴ Int64: 1

Related

References

  • [5] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 13.1.4.
  • [58] R. N. Mantegna. Hierarchical structure in financial markets. The European Physical Journal B 11, 193–197 (1999).
  • [59] M. Tumminello, T. Aste, T. Di Matteo and R. N. Mantegna. A tool for filtering information in complex systems. Proceedings of the National Academy of Sciences 102, 10421–10426 (2005).
  • [60] G. P. Massara, T. Di Matteo and T. Aste. Network Filtering for Big Data: Triangulated Maximally Filtered Graph. Journal of Complex Networks 5, 161–178 (2016).
source
PortfolioOptimisers.NetworkClustersEstimatorType
struct NetworkClustersEstimator{__T_nte, __T_alg, __T_onc} <: AbstractClustersEstimator

Clusters assets by the pseudo-distances that a network's structure induces.

NetworkClustersEstimator encapsulates the configuration for clustering assets from a network, pairing the NetworkEstimator that builds the graph with the clustering algorithm and the optimal-number-of-clusters estimator applied to the pseudo-distance matrix it induces.

Fields

  • nte: Network estimator.
  • alg: Clustering algorithm.
  • onc: Optimal number of clusters estimator.

Constructors

NetworkClustersEstimator(;    nte::AbstractNetworkEstimator = NetworkEstimator(),    alg::AbstractClustersAlgorithm = HClustAlgorithm(),    onc::AbstractOptimalNumberClustersEstimator = OptimalNumberClusters()) -> NetworkClustersEstimator

Keywords correspond to the struct's fields.

Propagated parameters

When factory is called on this type, the following @fprop-tagged fields are automatically propagated:

  • nte: Recursively updated via factory.

The power sums both clusterise methods accumulate are indexed by nte.sep.n, so the separation budget reaches this estimator through its network estimator rather than being restated here. That also fixes which separations this estimator accepts: nte.sep must be a HopCount, since a power count is what the sums are indexed by. A PathLength is constructible here but has no clusterise method.

Examples

julia> NetworkClustersEstimator()NetworkClustersEstimator  nte ┼ NetworkEstimator      │    ce ┼ PortfolioOptimisersCovariance      │       │   ce ┼ Covariance      │       │      │    me ┼ SimpleExpectedReturns      │       │      │       │   w ┴ nothing      │       │      │    ce ┼ GeneralCovariance      │       │      │       │   ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)      │       │      │       │    w ┴ nothing      │       │      │   alg ┼ FullMoment()      │       │      │     w ┴ nothing      │       │   mp ┼ MatrixProcessing      │       │      │     pdm ┼ Posdef      │       │      │         │      alg ┼ UnionAll: NearestCorrelationMatrix.Newton      │       │      │         │   kwargs ┴ @NamedTuple{}: NamedTuple()      │       │      │      dn ┼ nothing      │       │      │      dt ┼ nothing      │       │      │     alg ┼ nothing      │       │      │   order ┴ NTuple{4, Symbol}: (:pdm, :dn, :dt, :alg)      │    de ┼ Distance      │       │   power ┼ nothing      │       │     alg ┴ CanonicalDistance()      │   alg ┼ KruskalTree      │       │     args ┼ Tuple{}: ()      │       │   kwargs ┴ @NamedTuple{}: NamedTuple()      │   sep ┼ HopCount      │       │   n ┴ Int64: 1  alg ┼ HClustAlgorithm      │   linkage ┴ Symbol: :ward  onc ┼ OptimalNumberClusters      │   max_k ┼ nothing      │     alg ┼ SecondOrderDifference      │         │   alg ┼ StandardisedValue      │         │       │   mv ┼ MeanValue      │         │       │      │   w ┴ nothing      │         │       │   sv ┼ StdValue      │         │       │      │           w ┼ nothing      │         │       │      │   corrected ┴ Bool: true

Related

source

References

[5]
D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).
[58]
R. N. Mantegna. Hierarchical structure in financial markets. The European Physical Journal B 11, 193–197 (1999).
[59]
M. Tumminello, T. Aste, T. Di Matteo and R. N. Mantegna. A tool for filtering information in complex systems. Proceedings of the National Academy of Sciences 102, 10421–10426 (2005).
[60]