sample_tree_topology {ddtlcm}R Documentation

Sample a new tree topology using Metropolis-Hastings through randomly detaching and re-attaching subtrees

Description

Sample a new tree topology using Metropolis-Hastings through randomly detaching and re-attaching subtrees

Usage

sample_tree_topology(
  tree_phylo4d_old,
  Sigma_by_group,
  item_membership_list,
  c,
  c_order = 1,
  tree_structure_old = NULL,
  dist_mat_old = NULL
)

Arguments

tree_phylo4d_old

a phylo4d object of tree from the previous iteration

Sigma_by_group

a vector of diffusion variances of G groups from the previous iteration

item_membership_list

a vector of G elements, each indicating the number of items in this group

c

hyparameter of divergence function a(t)

c_order

equals 1 (default) or 2 to choose divergence function

tree_structure_old

a data.frame of tree structure from the previous iteration. Each row contains information of an internal node, including divergence times, number of data points traveling through the left and right branches

dist_mat_old

a list of leaf covariance matrix from the previous iteration. The list has length G, the number of item groups

Value

a numeric vector of G elements, each being the newly sampled variance of the latent location of this group


[Package ddtlcm version 0.2.1 Index]