Phylogeny Constraints: private API
PortfolioOptimisers.AbstractCentralityConstraint — Type
abstract type AbstractCentralityConstraint <: AbstractConstraintEstimatorAbstract 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
PortfolioOptimisers.VecCC — Type
const VecCC = AbstractVector{<:CentralityConstraint}Alias for a vector of CentralityConstraint objects.
Represents a collection of centrality-based portfolio constraints.
Related
PortfolioOptimisers.CC_VecCC — Type
const CC_VecCC = Union{<:CentralityConstraint, <:VecCC}Alias for a single or vector of CentralityConstraint objects.
Matches either a single CentralityConstraint or a vector of them (VecCC).
Related
PortfolioOptimisers.AbstractPhylogenyConstraintEstimator — Type
abstract type AbstractPhylogenyConstraintEstimator <: AbstractConstraintEstimatorAbstract supertype for all phylogeny-based constraint estimators.
All concrete and/or abstract types representing phylogeny-based constraint estimators should be subtypes of AbstractPhylogenyConstraintEstimator.
Related
PortfolioOptimisers.AbstractPhylogenyConstraintResult — Type
abstract type AbstractPhylogenyConstraintResult <: AbstractConstraintResultAbstract supertype for all phylogeny-based constraint result types.
All concrete and/or abstract types representing the results of phylogeny-based constraint generation should be subtypes of AbstractPhylogenyConstraintResult.
Related
PortfolioOptimisers.PlCE_PlC — Type
const PlCE_PlC = Union{<:AbstractPhylogenyConstraintEstimator,
<:AbstractPhylogenyConstraintResult}Alias for a phylogeny constraint estimator or result.
Matches either a AbstractPhylogenyConstraintEstimator or a AbstractPhylogenyConstraintResult. Used internally for dispatch in phylogeny-based constraint generation.
Related
PortfolioOptimisers.VecPlC — Type
const VecPlC = AbstractVector{<:AbstractPhylogenyConstraintResult}Alias for a vector of phylogeny constraint results.
Represents a collection of AbstractPhylogenyConstraintResult objects.
Related
PortfolioOptimisers.PlC_VecPlC — Type
const PlC_VecPlC = Union{<:AbstractPhylogenyConstraintResult, <:VecPlC}Alias for a single or vector of phylogeny constraint results.
Matches either a single AbstractPhylogenyConstraintResult or a vector of them (VecPlC).
Related
PortfolioOptimisers.VecPlCE_PlC — Type
const VecPlCE_PlC = AbstractVector{<:PlCE_PlC}Alias for a vector of phylogeny constraint estimators or results.
Represents a collection of PlCE_PlC objects, enabling batch processing of multiple phylogeny-based constraint estimators or results.
Related
PortfolioOptimisers.PlCE_PlC_VecPlCE_PlC — Type
const PlCE_PlC_VecPlCE_PlC = Union{<:PlCE_PlC, <:VecPlCE_PlC}Alias for a single or vector of phylogeny constraint estimators or results.
Matches either a single PlCE_PlC or a vector of them (VecPlCE_PlC). Used internally for dispatch on phylogeny-based constraint generation that accepts one or many constraints.
Related
PortfolioOptimisers.MatNum_PhRMatNum — Type
const MatNum_PhRMatNum = Union{<:PhylogenyResult{<:MatNum}, <:MatNum}Alias for a phylogeny result wrapping a numeric matrix or a numeric matrix directly.
Used internally to accept either a PhylogenyResult containing a numeric matrix or a plain numeric matrix as a constraint matrix input.
Related
PortfolioOptimisers.Lc_CC_VecCC — Type
const Lc_CC_VecCC = Union{<:CC_VecCC, <:LinearConstraint}Alias for a centrality constraint or linear constraint.
Matches either a CentralityConstraint, a vector of them, or a LinearConstraint. Used for dispatch in centrality-based constraint generation that also accepts linear constraints.
Related
PortfolioOptimisers._validate_length_integer_phylogeny_constraint_B — Function
_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: Boundslength(B).- Anything else: No check is made.
B: Vector of per-row bounds.
Validation
length(B) <= alg, on theIntegermethod only. A breach raises aDomainError.
Returns
nothing.
Related
validate_length_integer_phylogeny_constraint_B: the caller, which applies themax_kbound before it delegates here.IntegerPhylogenyEstimator
PortfolioOptimisers.validate_length_integer_phylogeny_constraint_B — Function
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 whoseoncfield states the number of clusters.B: Vector of per-row bounds.args...: Every other argument list. No check is made.
Validation
length(B) <= cle.onc.max_k, whenmax_kis set. A breach raises aDomainError.length(B) <= cle.onc.alg, through_validate_length_integer_phylogeny_constraint_B, whenalgis anInteger.- Neither bound exists on the default
OptimalNumberClusters(), whosemax_kisnothingand whosealgis aSecondOrderDifference, so aBof any length passes.
Returns
nothing.
Related
_validate_length_integer_phylogeny_constraint_B: the delegate that applies thealgbound.IntegerPhylogenyEstimator