dist_traits
computes a symmetric matrix of trait-distances between selected species
Contents
Syntax
[dist, val] = dist_traits (my_pets, traits, norm)
Description
computes a symmetric matrix of trait-distances between selected species (zero diagonal)
Input:
- my_pets: cell-string of AmP entry names
- traits: (n, 1 or 2)-cell array with names of traits and optional weights (default all weights equal to 1)
- norm: optional boolean for loss function F_sb (0, default) or F_su (1) as distance measure
Output:
- dist: square symmetric matrix of distances, with zero diagonal
- val: trait values with species in rows, traits in columns
Remarks
The traits must be in allStat for all my_pets (not all traits are present for all models in allStat and NaN's can occur). See DEBtool_M/lib/pet/statistics_st for possible traits. The distance measures are DEBtool_M/lib/regr/lossfuction_sb or lossfuction_su.
Example of use
dist = dist_traits(select('Ctenophora'),{'p_M';'v';'a_b'});