Phylogeny Constraints: private API

PortfolioOptimisers.AbstractCentralityConstraintType
abstract type AbstractCentralityConstraint <: AbstractConstraintEstimator

Abstract supertype for all centrality-based constraint types.

All concrete types implementing centrality-based portfolio constraints should be subtypes of AbstractCentralityConstraint.

A subtype states a bound on a linear function of the weights whose coefficients come from a graph, so centrality_constraints reduces it to a LinearConstraint before the model sees it.

Related

source
PortfolioOptimisers._validate_length_integer_phylogeny_constraint_BFunction
_validate_length_integer_phylogeny_constraint_B(alg::Integer, B::VecNum)
_validate_length_integer_phylogeny_constraint_B(args...)

Check the length of B against an integer cluster count alg.

The fallback method takes every other argument list and checks nothing, so a clustering algorithm that is not an integer count places no bound on B. The default OptimalNumberClusters carries a SecondOrderDifference, so this guard is silent for it.

Arguments

  • alg: Number of clusters the source returns.

    • Integer: Bounds length(B).
    • Anything else: No check is made.
  • B: Vector of per-row bounds.

Validation

  • length(B) <= alg, on the Integer method only. A breach raises a DomainError.

Returns

  • nothing.

Related

source
PortfolioOptimisers.validate_length_integer_phylogeny_constraint_BFunction
validate_length_integer_phylogeny_constraint_B(cle::ClustersEstimator, B::VecNum)
validate_length_integer_phylogeny_constraint_B(args...)

Check the length of B against the number of clusters the estimator cle may return.

Only the ClustersEstimator method checks anything. Every other argument list reaches the fallback and passes, a NetworkEstimator included, so the commonest source of an IntegerPhylogenyEstimator is unguarded here. A network's row count is not known until phylogeny_matrix has run, and IntegerPhylogeny's own constructor raises then.

Arguments

  • cle: Clustering estimator whose onc field states the number of clusters.
  • B: Vector of per-row bounds.
  • args...: Every other argument list. No check is made.

Validation

Returns

  • nothing.

Related

source