Network Estimator: private API

PortfolioOptimisers.NwE_ClE — Type
const NwE_ClE = Union{AbstractNetworkEstimator, AbstractClustersEstimator}

Union of a network estimator and a clustering estimator, with no precomputed result.

It is the bound of the pl field of SemiDefinitePhylogenyEstimator, IntegerPhylogenyEstimator, CentralityEstimator and PhylogenyPanel. The union leaves out a precomputed result on purpose. A constraint estimator builds its constraint for the set of assets of each call. A precomputed PhylogenyResult or Clusters holds the answer for the set of assets that made it. The two give the same constraint only while the set of assets does not change.

A meta-optimiser changes the set of assets, because it gives each subproblem a subset of them. phylogeny_matrix returns a precomputed result unchanged. A precomputed result in this field therefore gave a subproblem of three assets a constraint matrix over all the assets. The guards for precomputed constraints did not find it, because the object was an estimator. Now the type refuses the shape, so no runtime check is necessary. assert_external_optimiser is the one runtime guard on this path, and it catches a precomputed constraint result.

To use a precomputed structure, build the constraint one time and pass the result. phylogeny_constraints(est, X) returns a SemiDefinitePhylogeny or an IntegerPhylogeny. The A field of each takes a PhylogenyResult or a matrix, and the guards for results apply to it.

Related

source