# Simulation and Likelihood Calculation of Phylogenetic Comparative Models

## Documentation for package ‘PCMBase’ version 1.2.15

- DESCRIPTION file
- User guides, package vignettes and other documentation
- Package NEWS
- Package README

## Help Pages

A D F I M P R T U W

## -- A --

Args_MixedGaussian_MGPMDefaultModelTypes | Arguments to be passed to the constructor MixedGaussian when constructing a MGPM model with some of the default MGPM model types.
Args_MixedGaussian_MGPMScalarOUType | Arguments for the MixedGaussian constructor for scalar OU MGPM models.
Args_MixedGaussian_MGPMSurfaceOUType | Arguments for the MixedGaussian constructor for SURFACE OU MGPM models.
as.MixedGaussian | Convert a 'GaussianPCM' model object to a 'MixedGaussian' model object

## -- D --

dataFig3 | Data for Fig3 in the TPB manuscript

## -- F --

FalsePositiveRate | True positive rate of a set of binary predictions against their trues
FormatCellAsLatex | Latex representation of a model parameter or other found in a data.table object
FormatTableAsLatex | Latex representation of a data.table with matrix and vectors in its cells

## -- I --

is.AllEqual | Parameter types
is.CholeskyFactor | Parameter types
is.Diagonal | Parameter types
is.Fixed | Parameter types
is.GaussianPCM | Check if an object is a 'GaussianPCM'
is.Global | Parameter types
is.Identity | Parameter types
is.Local | Parameter types
is.LowerTriangular | Parameter types
is.LowerTriangularWithDiagonal | Parameter types
is.MatrixParameter | Parameter types
is.MixedGaussian | Check if an object is a 'MixedGaussian' PCM
is.NonNegative | Parameter types
is.Omitted | Parameter types
is.Ones | Parameter types
is.PCM | Check if an object is a PCM.
is.PCMTree | Check that a tree is a PCMTree
is.ScalarDiagonal | Parameter types
is.ScalarParameter | Parameter types
is.Schur | Parameter types
is.SemiPositiveDefinite | Parameter types
is.Symmetric | Parameter types
is.Transformable | Parameter types
is.Transformed | Parameter types
is.UpperTriangular | Parameter types
is.UpperTriangularWithDiagonal | Parameter types
is.VectorParameter | Parameter types
is.WithCustomVecParams | Parameter types
is.WithNonNegativeDiagonal | Parameter types
is.Zeros | Parameter types

## -- M --

MatchListMembers | Find the members in a list matching a member expression
MGPMDefaultModelTypes | Class names for the the default PCM and MGPM model types
MGPMScalarOUType | Class name for the scalar OU MGPM model type
MGPMSurfaceOUType | Class name for the SURFACE OU MGPM model type
MixedGaussian | Create a multi-regime Gaussian model (MixedGaussian)
MixedGaussianTemplate | Create a template MixedGaussian object containing a regime for each model type

## -- P --

PCM | Create a phylogenetic comparative model object
PCMAbCdEf | Quadratic polynomial parameters A, b, C, d, E, f for each node
PCMAddToListAttribute | Add a value to a list-valued attribute of a member or members matching a pattern
PCMApplyTransformation | Map a parametrization to its original form.
PCMBaseIsADevRelease | Check if the PCMBase version corresponds to a dev release
PCMBaseTestObjects | Test objects for the PCMBase package
PCMColorPalette | A fixed palette of n colors
PCMCombineListAttribute | Combine all member attributes of a given name into a list
PCMCond | Conditional distribution of a daughter node given its parent node
PCMCond.GaussianPCM | Conditional distribution of a daughter node given its parent node
PCMCondVOU | Variance-covariance matrix of an OU process with optional measurement error and jump at the start
PCMCreateLikelihood | Create a likelihood function of a numerical vector parameter
PCMDefaultModelTypes | Class names for the the default PCM and MGPM model types
PCMDefaultObject | Generate a default object of a given PCM model type or parameter type
PCMDescribe | Human friendly description of a PCM
PCMDescribeParameters | Describe the parameters of a PCM
PCMExtractDimensions | Given a PCM or a parameter object, extract an analogical object for a subset of the dimensions (traits) in the original object.
PCMExtractRegimes | Given a PCM or a parameter object, extract an analogical object for a subset of the regimes in the original object.
PCMFindMethod | Find the S3 method for a given PCM object or class-name and an S3 generic
PCMFixParameter | Fix a parameter in a PCM model
PCMGenerateModelTypes | Generate default model types for given PCM base-classes
PCMGenerateParameterizations | Generate possible parameterizations for a given type of model
PCMGetAttribute | Value of an attribute of an object or values for an attribute found in its members
PCMGetVecParamsRegimesAndModels | Get a vector of all parameters (real and discrete) describing a model on a tree including the numerical parameters of each model regime, the integer ids of the splitting nodes defining the regimes on the tree and the integer ids of the model types associated with each regime.
PCMInfo | Meta-information about a tree and trait data associated with a PCM
PCMLik | Likelihood of a multivariate Gaussian phylogenetic comparative model with non-interacting lineages
PCMLikDmvNorm | Calculate the likelihood of a model using the standard formula for multivariate pdf
PCMLikTrace | Tracing the log-likelihood calculation of a model over each node of the tree
PCMListDefaultParameterizations | Specify the parameterizations for each parameter of a model
PCMListMembers | A vector of access-code strings to all members of a named list
PCMListParameterizations | Specify the parameterizations for each parameter of a model
PCMLmr | Quadratic polynomial parameters L, m, r
PCMMapModelTypesToRegimes | Integer vector giving the model type index for each regime
PCMMean | Expected mean vector at each tip conditioned on a trait-value vector at the root
PCMMeanAtTime | Calculate the mean at time t, given X0, under a PCM model
PCMModels | Get a list of PCM models currently implemented
PCMModelTypes | Get the model type(s) of a model
PCMNumRegimes | Number of regimes in a obj
PCMNumTraits | Number of traits modeled by a PCM
PCMOptions | Global options for the PCMBase package
PCMPairSums | Sums of pairs of elements in a vector
PCMParam | Module PCMParam
PCMParamBindRegimeParams | Bind named vectors or matrices into an array so that the names form the names of the last dimension.
PCMParamCount | Count the number of free parameters associated with a PCM or a PCM-parameter
PCMParamGetShortVector | Get a vector of the variable numeric parameters in a model
PCMParamLoadOrStore | Load (or store) a PCM parameter from (or to) a vector of the variable parameters in a model.
PCMParamLocateInShortVector | Locate a named parameter in the short vector representation of a model
PCMParamLowerLimit | The lower limit for a given model or parameter type
PCMParamRandomVecParams | Generate a random parameter vector for a model using uniform distribution between its lower and upper bounds.
PCMParamSetByName | Set model parameters from a named list
PCMParamType | Parameter types
PCMParamUpperLimit | The upper limit for a given model or parameter type
PCMParentClasses | Parent S3 classes for a model class
PCMParseErrorMessage | Extract error information from a formatted error message.
PCMPExpxMeanExp | Create a function of time that calculates (1-exp(-lambda_ij*time))/lambda_ij for every element lambda_ij of the input matrix Lambda_ij.
PCMPLambdaP_1 | Eigen-decomposition of a matrix H
PCMPlotGaussianDensityGrid2D | A 2D Gaussian distribution density grid in the form of a ggplot object
PCMPlotGaussianSample2D | A 2D sample from Gaussian distribution
PCMPlotMath | Beautiful model description based on plotmath
PCMPlotTraitData2D | Scatter plot of 2-dimensional data
PCMPresentCoordinates | Determine which traits are present (active) on each node of the tree
PCMRegimes | Get the regimes (aka colors) of a PCM or of a PCMTree object
PCMSetAttribute | Set an attribute of a named member in a PCM or other named list object
PCMSim | Simulation of a phylogenetic comparative model on a tree
PCMSpecify | Parameter specification of PCM model
PCMTable | A data.table representation of a PCM object
PCMTableParameterizations | Cartesian product of possible parameterizations for the different parameters of a model
PCMTrajectory | Generate a trajectory for the mean in one regime of a PCM
PCMTree | Create a PCMTree object from a phylo object
PCMTreeBackbonePartition | Prune the tree leaving one tip for each or some of its parts
PCMTreeDropClade | Drop a clade from a phylogenetic tree
PCMTreeDtNodes | A data.table with time, part and regime information for the nodes in a tree
PCMTreeEdgeTimes | A matrix with the begin and end time from the root for each edge in tree
PCMTreeEvalNestedEDxOnTree | Perfrorm nested extractions or drops of clades from a tree
PCMTreeExtractClade | Extract a clade from phylogenetic tree
PCMTreeGetBranchLength | The length of the branch leading to a node
PCMTreeGetDaughters | A vector of the daughter nodes for a given parent node id in a tree
PCMTreeGetLabels | Node labels of a tree
PCMTreeGetNodeLabels | Node labels of a tree
PCMTreeGetParent | The parent node id of a daughter node in a tree
PCMTreeGetPartition | Get the starting branch' nodes for each part on a tree
PCMTreeGetPartNames | Unique parts on a tree in the order of occurrence from the root to the tips (preorder)
PCMTreeGetPartRegimes | Regime mapping for the parts in a tree
PCMTreeGetPartsForNodes | Get the parts of the branches leading to a set of nodes or tips
PCMTreeGetRegimesForEdges | Model regimes (i.e. colors) associated with the branches in a tree
PCMTreeGetRegimesForNodes | Get the regimes of the branches leading to a set of nodes or tips
PCMTreeGetRootLabel | Node labels of a tree
PCMTreeGetTipLabels | Node labels of a tree
PCMTreeGetTipsInPart | Get the tips belonging to a part in a tree
PCMTreeGetTipsInRegime | Get the tips belonging to a regime in a tree
PCMTreeInsertSingletons | Insert tips or singleton nodes on chosen edges
PCMTreeInsertSingletonsAtEpoch | Insert tips or singleton nodes on chosen edges
PCMTreeInsertTipsOrSingletons | Insert tips or singleton nodes on chosen edges
PCMTreeJumps | Jumps in modeled traits associated with branches in a tree
PCMTreeListAllPartitions | A list of all possible (including recursive) partitions of a tree
PCMTreeListCladePartitions | A list of all possible clade partitions of a tree with a number of splitting nodes
PCMTreeListDescendants | A list of the descendants for each node in a tree
PCMTreeListRootPaths | A list of the path to the root from each node in a tree
PCMTreeLocateEpochOnBranches | Find the crossing points of an epoch-time with each lineage of a tree
PCMTreeLocateMidpointsOnBranches | Find the middle point of each branch longer than a threshold
PCMTreeMatchLabels | Get the node numbers associated with tip- or node-labels in a tree
PCMTreeMatrixNodesInSamePart | Which couples from a given set of nodes in a tree belong to the same part?
PCMTreeMatrixNodesInSameRegime | Which couples from a given set of nodes in a tree belong to the same part?
PCMTreeNearestNodesToEpoch | Find the nearest node to a given time from the root (epoch) on each lineage crossing this epoch
PCMTreeNodeTimes | Calculate the time from the root to each node of the tree
PCMTreeNumNodes | Number of all nodes in a tree
PCMTreeNumParts | Number of unique parts on a tree
PCMTreeNumTips | Wrapper for length(tree$tip.label)
PCMTreePlot | Plot a tree with parts and regimes assigned to these parts
PCMTreePostorder | Post-order tree traversal
PCMTreePreorder | Pre-order tree traversal
PCMTreeSetLabels | Set tip and internal node labels in a tree
PCMTreeSetPartition | Set a partition of a tree by specifying the partition nodes
PCMTreeSetPartRegimes | Set regimes for the parts in a tree
PCMTreeSetRegimesForEdges | Set the regime for each individual edge in a tree explicitly
PCMTreeSplitAtNode | Slit a tree at a given internal node into a clade rooted at this node and the remaining tree after dropping this clade
PCMTreeTableAncestors | A matrix (table) of ancestors/descendants for each node in a tree
PCMTreeToString | A character representation of a phylo object.
PCMTreeVCV | Phylogenetic Variance-covariance matrix
PCMUnfixParameter | Unfix a parameter in a PCM model
PCMVar | Expected variance-covariance matrix for each couple of tips (i,j)
PCMVarAtTime | Calculate the variance covariance k x k matrix at time t, under a PCM model

## -- R --

RequireSuggestedPackages | Check if all packages listed in Suggests are available

## -- T --

TruePositiveRate | True positive rate of a set of binary predictions against their trues

## -- U --

UpperTriFactor | Upper triangular factor of a symmetric positive definite matrix

## -- W --

White | White Gaussian PCM ignoring phylogenetic history