build_historical_association_matrix: Reconstruct historical association matrix

Description Usage Arguments Details Value Examples

View source: R/build_historical_assoc_mat.R

Description

Reconstruct historical association matrix

Usage

1
2
3
build_historical_association_matrix(t, tr_pair_obj)

get_assoc(t, tr_pair_obj)

Arguments

t

The time of interest

tr_pair_obj

The tree pair object from 'sim_cophyBD'

Details

Given a time and a tree pair object produced by the 'sim_cophyBD' object will produce the association matrix at that time point for the tree object. USER WARNING: this is still in development, and likely will not work all the time.

Value

Matrix of the associations at given time

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
host_mu <- 1.0 # death rate
host_lambda <- 2.0 # birth rate
numb_replicates <- 1
time <- 1.0
symb_mu <- 0.2
symb_lambda <- 0.4
host_shift_rate <- 0.0
cosp_rate <- 2.0

cophylo_pair <- sim_cophyBD(hbr = host_lambda,
                           hdr = host_mu,
                           cosp_rate = cosp_rate,
                           host_exp_rate = host_shift_rate,
                           sdr = symb_mu,
                           sbr = symb_lambda,
                           numbsim = numb_replicates,
                           time_to_sim = time)
time <- 1.0
assoc_mat_at_t <- get_assoc(t=time, tr_pair_obj = cophylo_pair[[1]])

treeducken documentation built on March 3, 2021, 1:11 a.m.