Skip to contents

Runs an MCMC chain using the StructCoalescent method using radius-based subtrees

Usage

StructCoalescent_mcmc(
  N,
  strphylo,
  coal_rate,
  bit_mig_mat,
  st_radius = NA,
  adaptive = TRUE,
  cr_mode = NA,
  cr_var = NA,
  mm_mode = NA,
  mm_var = NA,
  output_dir = ".",
  run_name = "StructCoalescent",
  stdout_log = TRUE,
  thin = max(N/5000, 1),
  save_migration_history = TRUE,
  migration_history_thin = thin,
  proposal_rates = c(1000, 1, 1),
  adaptation_rate = 0.6,
  target_accept_rate = 0.234
)

Arguments

N

Total number of MCMC iterations to complete

strphylo

Initial structured phylogenetic tree

coal_rate

Initial estimate of coalescent rates

bit_mig_mat

Initial estimate of backward-in-time migration rates matrix

st_radius

Initial subtree radius

adaptive

(logical) Adaptively update subtree radius within run? (default TRUE)

cr_mode

Coalescent rates prior mode

cr_var

Coalescent rates prior variance

mm_mode

Backward-in-time migration rates prior mode

mm_var

Backward-in-time migration rates prior variance

output_dir

Directory to output log files to

run_name

Run name to save log files as

stdout_log

(logical) Output logs to stdout()? Default true

thin

Thinning rate for continuous parameter posterior samples

save_migration_history

Logical value indicating whether tree samples are saved (i.e. whether .trees file is created)

migration_history_thin

Thinning rate for tree samples to be saved

proposal_rates

Relative rates of migration history and continuous parameter updates (migration history : coalescent rates : migration rates)

adaptation_rate

Rate at which adaptive MCMC varies subtree radius (unused if adaptive = FALSE)

target_accept_rate

Target acceptance rate for migration history updates