Reweight | R Documentation |
Reweight()
allows the weights of specific characters in phylogenetic
datasets to be arbitrarily adjusted.
Reweight(dataset, weights)
dataset |
A phylogenetic data matrix of phangorn class |
weights |
Unnamed integer vector specifying desired weight of each character in turn; or named integer vector specifying weights of each character; unnamed entries will be assigned weight 1. |
This functionality should be employed with care. The underlying principle of parsimony is that all evolutionary steps are equivalent. Setting different weights to different characters is at odds with that principle, so analysis of a re-weighted matrix using a parsimony-based framework is arguably no longer parsimony analysis; on the most permissive view, the criteria used to determine a weighting scheme will always be arbitrary.
It can be useful to relax the criterion that all evolutionary steps are equivalent – for example, implied weighting \insertCiteGoloboff1997TreeTools typically recovers better trees than equal-weights parsimony \insertCiteSmith2019TreeTools. This said, assigning different weights to different characters tacitly imposes a model of evolution that differs from that implicit in equal-weights parsimony. Whereas probabilistic models can be evaluated by various methods (e.g. fit, marginal likelihood, posterior predictive power), there are no principled methods of comparing different models under a parsimony framework.
As such, Reweight()
is likely to be useful for a narrow set of uses.
Examples may include:
informal robustness testing, to explore whether certain characters are more or less influential on the resulting tree;
Imposing constraints on a dataset, by adding each constraint as a column in a dataset whose weight exceeds the total amount of data.
Reweight()
returns dataset
after adjusting the weights of
the specified characters.
For a matrix, this is attained by repeating each column the weights
times.
For a phyDat
object, the "weight" attribute will be modified.
Martin R. Smith (martin.smith@durham.ac.uk)
Other phylogenetic matrix conversion functions:
Decompose()
,
MatrixToPhyDat()
,
StringToPhyDat()
mat <- rbind(a = c(0, 2, 0), b = c(0, 2, 0), c = c(1, 3, 0), d = c(1, 3, 0))
dat <- MatrixToPhyDat(mat)
# Set character 1 to weight 1, character 2 to weight 2; omit character 3
Reweight(mat, c(1, 2, 0))
# Equivalently:
Reweight(dat, c("3" = 0, "2" = 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.