Asset Phylogeny

PortfolioOptimisers.asset_phylogenyFunction
asset_phylogeny(w::VecNum, X::MatNum)

Compute the asset phylogeny score for a set of weights and a phylogeny matrix.

This function computes the weighted sum of the phylogeny matrix, normalised by the sum of absolute weights. The asset phylogeny score quantifies the degree of phylogenetic (network or cluster-based) structure present in the portfolio allocation. It is the percentage invested in connected assets of NetworkEstimator's Equation 13.7,

\[\begin{align} \mathrm{CA}(\boldsymbol{x}) &= \dfrac{\boldsymbol{1}_n^{\intercal} \left(\mathbf{B}_{1,\,l} \odot \lvert \boldsymbol{x}\boldsymbol{x}^{\intercal} \rvert\right) \boldsymbol{1}_n}{\boldsymbol{1}_n^{\intercal} \lvert \boldsymbol{x}\boldsymbol{x}^{\intercal} \rvert \boldsymbol{1}_n}\,, \end{align}\]

Where:

  • $\mathbf{B}_{1,\,l}$: Phylogeny matrix from phylogeny_matrix.
  • $\odot$: Hadamard, element-wise product.
  • $\boldsymbol{x}$: Portfolio weight vector.
  • $\boldsymbol{1}_n$: Column vector of ones of length $n$.

Two assets that are not related contribute nothing, and a pair contributes nothing when either weight is zero.

Algorithm

  1. Take the outer product of w with itself and its absolute value, giving aw, the gross weight of every pair.
  2. Take the dot product of X and aw, which adds up the gross weight of the related pairs alone.
  3. Divide by the sum of aw, the gross weight of every pair, giving the share invested in related assets.

Arguments

  • w: Weights vector.
  • X: Phylogeny matrix.

Returns

  • p::Number: Asset phylogeny score.

Related

source
asset_phylogeny(pl::PhylogenyResult{<:MatNum}, w::VecNum, args...;
                kwargs...)

Compute the asset phylogeny score for a set of portfolio weights and a phylogeny matrix result, forwarding additional arguments.

This method provides compatibility with workflows that pass extra positional or keyword arguments. It extracts the phylogeny matrix from the PhylogenyResult and delegates to asset_phylogeny(w, pl), ignoring any additional arguments.

Arguments

  • pl::PhylogenyResult{<:MatNum}: Phylogeny matrix result object.
  • w::VecNum: Portfolio weights vector.
  • args...: Additional positional arguments (ignored).
  • kwargs...: Additional keyword arguments (ignored).

Returns

  • score::Number: Asset phylogeny score.

Related

source
asset_phylogeny(cle::NwE_ClE_Cl,
                w::VecNum, X::MatNum; dims::Int = 1, kwargs...)

Compute the asset phylogeny score for a set of weights and a network or clustering estimator.

This function computes the phylogeny matrix using the estimator and data, then computes the asset phylogeny score using the weights.

Algorithm

  1. Build the phylogeny matrix from X with phylogeny_matrix.
  2. Score w against that matrix with asset_phylogeny.

Arguments

  • cle: NetworkEstimator or clustering estimator.
  • w: Weights vector.
  • X: Data matrix (observations × assets).
  • dims: Dimension along which to perform the computation.
  • kwargs...: Additional keyword arguments.

Returns

  • p::Number: Asset phylogeny score.

Related

source
asset_phylogeny(pl::NwE_ClE_Cl,
                w::VecNum, pr::AbstractPriorResult; dims::Int = 1, kwargs...)

Compute the asset phylogeny score for a portfolio allocation using a phylogeny estimator or clustering result and a prior result.

This function computes the phylogeny matrix from the asset returns in the prior result using the specified phylogeny estimator or clustering result, then evaluates the asset phylogeny score for the given portfolio weights. The asset phylogeny score quantifies the degree of phylogenetic (network or cluster-based) structure present in the portfolio allocation.

Algorithm

  1. Pick the asset returns matrix X from the carrier that x_src names, with returns_matrix_picker.
  2. Call the asset-returns method of asset_phylogeny with X, passing both carriers on as pr and rd, and return the score it produces.

Arguments

  • pl: Phylogeny estimator or clustering result used to compute the phylogeny matrix.
  • w: Portfolio weights vector.
  • pr: Prior result or returns result. Both carry the asset returns matrix X and the feature matrix Z, so either can supply them.
  • rd: The returns result to use. Read for X only when x_src is :data, and passed on to the estimator tree.
  • x_src: Which returns matrix the clustering, phylogeny and centrality estimators read: :prior takes the prior result's X, :data takes the raw returns result's X. Ignored when no returns result is available, in which case the prior result's X is used.
  • dims: Dimension along which to perform the computation.
  • kwargs...: Additional keyword arguments passed to the phylogeny matrix computation.

Returns

  • score::Number: Asset phylogeny score.

Related

source