Phylogeny

PortfolioOptimisers.PhylogenyResult — Type
struct PhylogenyResult{__T_X} <: AbstractPhylogenyResult

Carries a validated phylogeny matrix or a centrality vector.

PhylogenyResult holds one of two arrays. phylogeny_matrix returns a phylogeny matrix, with 1 for a pair of related assets and 0 for every other pair. centrality_vector returns a vector with one centrality score for each asset.

SemiDefinitePhylogeny, IntegerPhylogeny, centrality_vector and asset_phylogeny can take a PhylogenyResult in place of the estimator that makes it. The result holds the assets of the call that made it. A call on a different set of assets reads the same array.

Fields

  • X: Phylogeny matrix or vector.

Constructors

PhylogenyResult(;    X::ArrNum) -> PhylogenyResult

Keywords correspond to the struct's fields.

Validation

  • !isempty(X).
  • If X is a MatNum, LinearAlgebra.issymmetric(X) and all(iszero, LinearAlgebra.diag(X)). The constructor throws an ArgumentError otherwise.

Examples

julia> PhylogenyResult(; X = [0 1 0; 1 0 1; 0 1 0])PhylogenyResult  X ┴ 3×3 Matrix{Int64}julia> PhylogenyResult(; X = [0.2, 0.5, 0.3])PhylogenyResult  X ┴ Vector{Float64}: [0.2, 0.5, 0.3]

Related

source