sim_history_branch_conditional: Simulate history of discrete-character changes over a branch...

View source: R/posteriorpredictive_functions.R

sim_history_branch_conditionalR Documentation

Simulate history of discrete-character changes over a branch (which may comprise one or more pieces delimited by time interval bounds) conditioning on the start and end states

Description

Simulate history of discrete-character changes over a branch (which may comprise one or more pieces delimited by time interval bounds) conditioning on the start and end states

Usage

sim_history_branch_conditional(
  node_ages,
  Q,
  Q_ages = NULL,
  node_state_indices,
  states
)

Arguments

node_ages

Ages of the two nodes defining this branch

Q

An instantaneous-rate matrix (or a list of matrices for a piecewise constant geographic model) characterizes the CTMC

Q_ages

A vector containing boundaries of time intervals for a piecewise constant geographic model (NULL means a constant model); the length of this vector should be one shorter than the Q-matrix list, sorted from oldest to youngest.

node_state_indices

State indices (i.e., the indices to use to fecth the states from the states vector) of the start and end nodes

states

States of the discrete character

Value

A map object (as in the simmap data structure) that contains the simulated history (as a series of events) over this branch


jsigao/prioritree documentation built on Jan. 9, 2023, 5:35 a.m.