Phylogeny constraint generation: private API
PortfolioOptimisers.AbstractCentralityConstraint — Type
abstract type AbstractCentralityConstraint <: AbstractConstraintEstimatorAbstract supertype for all centrality-based constraint types.
A subtype states a bound on a linear function of the weights whose coefficients come from a graph. centrality_constraints reduces it to a LinearConstraint before the optimiser builds the model.
Related
PortfolioOptimisers.VecCC — Type
const VecCC = AbstractVector{<:CentralityConstraint}Alias for a vector of CentralityConstraint objects.
centrality_constraints reduces such a vector to one LinearConstraint, with at most one row per constraint.
Related
PortfolioOptimisers.CC_VecCC — Type
const CC_VecCC = Union{CentralityConstraint, VecCC}Alias for one CentralityConstraint, or a vector of them.
Matches a CentralityConstraint or a VecCC. centrality_constraints dispatches on it.
Related
PortfolioOptimisers.AbstractPhylogenyConstraintEstimator — Type
abstract type AbstractPhylogenyConstraintEstimator <: AbstractConstraintEstimatorAbstract supertype for all phylogeny-based constraint estimators.
A subtype holds the configuration that fits the relatedness of the assets to returns. phylogeny_constraints turns it into an AbstractPhylogenyConstraintResult.
Related
PortfolioOptimisers.AbstractPhylogenyConstraintResult — Type
abstract type AbstractPhylogenyConstraintResult <: AbstractConstraintResultAbstract supertype for all phylogeny-based constraint result types.
A subtype holds a fitted relatedness matrix and the parameter of the constraint that the model writes on it.
Related
PortfolioOptimisers.PlCE_PlC — Type
const PlCE_PlC = Union{AbstractPhylogenyConstraintEstimator,
AbstractPhylogenyConstraintResult}Alias for a phylogeny constraint estimator or result.
Matches an AbstractPhylogenyConstraintEstimator or an AbstractPhylogenyConstraintResult. The library dispatches on it where a function accepts a phylogeny constraint estimator or a precomputed result.
Related
PortfolioOptimisers.VecPlC — Type
const VecPlC = AbstractVector{<:AbstractPhylogenyConstraintResult}Alias for a vector of phylogeny constraint results.
Matches the vector that phylogeny_constraints returns for a vector of estimators and results.
Related
PortfolioOptimisers.PlC_VecPlC — Type
const PlC_VecPlC = Union{AbstractPhylogenyConstraintResult, VecPlC}Alias for one phylogeny constraint result, or a vector of them.
Matches an AbstractPhylogenyConstraintResult or a VecPlC. It bounds the fitted phylogeny constraints that the model builders read.
Related
PortfolioOptimisers.VecPlCE_PlC — Type
const VecPlCE_PlC = AbstractVector{<:PlCE_PlC}Alias for a vector of phylogeny constraint estimators or results.
phylogeny_constraints maps such a vector to a vector of results, in the same order.
Related
PortfolioOptimisers.PlCE_PlC_VecPlCE_PlC — Type
const PlCE_PlC_VecPlCE_PlC = Union{PlCE_PlC, VecPlCE_PlC}Alias for one phylogeny constraint estimator or result, or a vector of them.
Matches a PlCE_PlC or a VecPlCE_PlC. It bounds the ple keyword of JuMPOptimiser and the frc_ple keyword of FactorRiskContribution, so several phylogeny constraints can hold at once.
Related
PortfolioOptimisers.MatNum_PhRMatNum — Type
const MatNum_PhRMatNum = Union{PhylogenyResult{<:MatNum}, MatNum}Alias for a numeric matrix, or a phylogeny result that holds one.
The constructors of SemiDefinitePhylogeny and IntegerPhylogeny accept it for A. They read the matrix out of a PhylogenyResult.
Related
PortfolioOptimisers.Lc_CC_VecCC — Type
const Lc_CC_VecCC = Union{CC_VecCC, LinearConstraint}Alias for a centrality constraint, a vector of them, or a linear constraint.
Matches a CC_VecCC or a LinearConstraint. It bounds the cte keyword of JuMPOptimiser, which accepts the estimators or the linear constraint that they reduce to.
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(alg::Int_ONC, B::VecNum)Check the length of B against an integer cluster count alg.
The method on Int_ONC is the no-op of the value check on the set that reaches it. An algorithm that chooses the number of clusters fixes no count to check, so it puts no bound on B. The default OptimalNumberClusters holds a SecondOrderDifference, so this check does nothing for it. Any other type or arity is a MethodError.
Arguments
alg: The number of clusters that the source returns.Integer: Boundslength(B).AbstractOptimalNumberClustersAlgorithm: The function checks nothing.
B: The vector of bounds, one per row.
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(cle::NwE_ClE, B::VecNum)Check the length of B against the number of clusters that the estimator cle can return.
Only the ClustersEstimator method checks B. The method on NwE_ClE is the no-op of the value check on the set that reaches it, and it checks nothing. A NetworkEstimator goes there, so this function does not check the default source of an IntegerPhylogenyEstimator. A network estimator fixes no count of clusters. The row count of a network is known only after phylogeny_matrix runs, and the constructor of IntegerPhylogeny checks the length then. Any other type or arity is a MethodError.
Arguments
cle: The source of the relatedness matrix. TheClustersEstimatormethod reads itsoncfield, which states the number of clusters. The method onNwE_ClEignores it.B: The vector of bounds, one per row.
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.- The default
OptimalNumberClusters()sets neither bound. Itsmax_kisnothingand itsalgis aSecondOrderDifference, so aBof any length passes.
Returns
nothing.
Related
_validate_length_integer_phylogeny_constraint_B: the delegate that applies thealgbound.IntegerPhylogenyEstimator