Automatic Shift Detection using a Phylogenetic EM
Add several entries, when only one is not NA.
Allocation of regimes to nodes.
Allocation of shifts to edges
Iteration allocation
Test the format of data entry.
Check dimensions of the parameters
Check whether an allocation of the shifts is parsimonious, in the "inf...
Check Parsimony, assuming no homoplasy
Check range of alpha
Check selection strength
Clustering associated to a shift allocation, assuming no homoplasy.
Compute Matrix W of actualization (Ultrametric case)
Computation of the optimal values at nodes and tips.
Compute differences of expectations between node and parent.
Phylogenetic Distances
E step
Compute the expected states of a BM
Compute the expected states of a scOU
Compute fixed moments for E step.
Do a lm on top of a lasso regression.
Log Likelihood
Squared Mahalanobis Distance
Compute moments of params_old
Residuals
Computation of shifts from the vector of optimal values
List of potential daughter states when parent is in state k.
Compute the stationary variance matrix
Compute weighted sum of var_diff
Common Ancestors Times
Matrix of tree-induced correlations for the BM
Matrix of tree-induced correlations for the scOU
Compute variances of differences between nodes and parents.
Computation of the variance.
Tips Variances for the BM
Tips Variances for the OU
Complete variance covariance matrix for BM
Complete variance covariance matrix for OU
Complete variance covariance matrix for OU
Complete variance covariance matrix for scOU
Correspondence between edges numbers
Make the result lighter
Enumerate all the possible regime allocations, given a clustering of t...
Tips descendants of nodes.
Find all the equivalent shift edges allocations.
Find values given edges. OU stationary case. Ultrametric tree.
Find all equivalent shifts allocations and values.
Function to estimate alpha
Perform One EM
Extract sub-matrices of variance.
Extract the result of enumerate_parsimony at a node.
Extract the shifts values for one trait.
Extraction of the actual number of solutions.
Extraction of the actual number of solutions.
Extract from object partitionsNumber
Extraction function
Extraction of simulated traits
Find a reasonable grid for alpha
Given a regularization path, find K selected independent variables.
Test for rotation invariant datasets
Find values given edges. OU stationary case. Ultrametric tree.
Run the EM for several values of K
Get Model Selection Criterion
Get variance matrix of a node
Scale the parameters back to the original process
Ancestral State Reconstruction
Compute the actualization factors to apply to the incidence matrix.
Incidence matrix of a tree.
Incidence matrix of a tree.
Initialization for the allocation of shifts.
Initialization the selection strength alpha using robust estimation
Initialization for the computation of the optimal values
Initialization of the shifts using Lasso.
Initialization for the enumeration of parsimonious solutions.
Initialization for incidence matrix (full tree)
Initialization for incidence matrix
Initialization for parsimonyCost.
Initialization for parsimonyNumber.
Initialize BM
Initialize state and expectation matrices
Initialize state and expectation matrices
Check whether parameters are in ranges.
Do a lasso regression with the number of non-zero variables fixed.
Log Likelihood of a fitted object
Compute parent matrix from possibles daughter matrices.
Merge PhyloEM fits on various grids of alpha values
Merge several complementary vectors into one.
Merge a list of independent parameters into into one parameter
Merge fits from independent runs of PhyloEM.
Model Selection of a fitted object
Computation of the optimal values at nodes and tips.
Create an object params_process for a BM
Create an object params_process for an OU
Create an object params_process
Parameter estimates
Create an object params_process
Minimal number of shifts needed to get a clustering.
Number of equivalent parsimonious allocations.
Number of different models
Penalty function type Baraud Giraud Huet.
Penalty function type Birgé-Massart 1
Penalty function type Birgé-Massart 2
Penalty function type pBIC
Model Estimation with Detection of Shifts
Plot Model Selection Criterion
Plot all the equivalent solutions.
Plot all the equivalent solutions.
Plot for class simul_process
Plot for class PhyloEM
Product of elements of a matrix
exact qr.solve
Generic recursion down the tree.
Residuals of a fitted object
Sample equally spaced edges.
Sample shifts edges in a parsimonious way.
Scale variance and selection strength from a linear transform
Segmentation in the BM case
Segmentation in the OU special case, using lasso regression
Segmentation in the OU special case, conserving the same shifts positi...
Simmap format mapping from list of edges
Compute the matrix of shifts.
Compute the vector of shifts.
Compute the list of shifts.
Compute the list of shifts.
Simulate a Stochastic Process on a tree
Simulate a Stochastic Process on a tree
Split independent parameters into a list of parameters
Sum on subsets of a given cardinal.
Sum on all subsets.
Sum on a simplex
Sum on a simplex
Test state of root.
Transform branch length for a re-scaled BM
Transform the shift values
Update function for regime allocation.
Update function for optimal value computation
Actualization of the enumeration.
Update function for incidence matrix
Update function for incidence matrix
Actualization for parsimonyCost.
Actualization for parsimonyNumber.
Update formula in the general case
Wrapper for E step in EM
Implementation of the automatic shift detection method for Brownian Motion (BM) or Ornstein–Uhlenbeck (OU) models of trait evolution on phylogenies. Some tools to handle equivalent shifts configurations are also available. See Bastide et al. (2017) <doi:10.1111/rssb.12206> and Bastide et al. (2018) <doi:10.1093/sysbio/syy005>.
Useful links