Centrality Estimator
PortfolioOptimisers.CentralityEstimator — Type
struct CentralityEstimator{__T_pl, __T_ct} <: AbstractCentralityEstimatorBundles a network source with the centrality algorithm that scores its assets.
CentralityEstimator encapsulates the configuration for computing centrality measures on a network, including the network estimator and the centrality algorithm.
The network is weighted where it can be. centrality_polarity answers which quantity ct needs — distances for the shortest-path algorithms, similarities for EigenvectorCentrality — and centrality_graph supplies it from pl.
The estimator carries no override of its own. A caller who wants the centrality over the network's topology alone configures ct itself, with TopologyOnly in its ov field, and this estimator is a pure bundle of pl and ct either way.
Five cases run on the unweighted graph, and none of them raises. A caller names a configured algorithm and never asks for weights, so an unweightable pairing has not been handed a request it cannot serve. TopologyOnly asks away from them, which every source can serve, so it adds no case to this list and is not one of the five.
- A clustering estimator or a precomputed
Clustersaspl, or a precomputedPhylogenyResultpassed tocentrality_vectordirectly. A partition has no edge weights, and does not borrow any. DegreeCentrality.Graphs.jlignores weights.Pagerank.Graphs.jlignores weights.KatzCentrality.Graphs.katz_centralitybinarises throughadjacency_matrix(g, Bool).EigenvectorCentralityon a tree branch. The branch carries no similarity for it to read.
On the weighted routes the sep field of a NetworkEstimator is inert: they read the structure itself rather than the separation closure phylogeny_matrix builds. At the default HopCount(; n = 1) the two agree, because the closure of a graph at one hop is the graph.
BetweennessCentrality and StressCentrality do read the weights, and are nonetheless unchanged by them on a tree: a tree has exactly one path between any two vertices, so the shortest-path set is the same at any weights. That is a theorem about the graph rather than a limitation of the algorithm, and it does not hold on the similarity branch.
Fields
pl: Network estimator, phylogeny result, clustering estimator, or clustering result.
ct: Centrality algorithm.
Constructors
CentralityEstimator(; pl::NwE_ClE = NetworkEstimator(), ct::AbstractCentralityAlgorithm = DegreeCentrality()) -> CentralityEstimatorKeywords correspond to the struct's fields.
Examples
julia> CentralityEstimator()CentralityEstimator pl ┼ 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 ct ┼ DegreeCentrality │ kind ┼ Int64: 0 │ kwargs ┴ @NamedTuple{}: NamedTuple()Related
References
- [5] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 13.1.5.1, Equation 13.6.
References
- [5]
- D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).