R implementation of the environment-dependent birth-death model within a Bayesian framework.
Directory Functions contains the main functions that are used in the analyses:
- halfcauchy: compute density and random deviates of an half-Cauchy distribution.
- halfnormal: compute density and random deviates of an half-normal distribution.
- laplace: compute density and random deviates of a Laplacian distribution.
- likelihood_bd_mod_c: compute the likelihood of a user-defined environment-dependent birth-death process.
- MLE: compute the maximum likelihood estimates of the parameters of a user-defined environment-dependent birth-death process.
- sim_env_bd_mod_c: generate a random phylogenetic tree under a user-defined environment-dependent birth-death process.
- run_env_bd_MCMC: generate three parallel independent MCMC chains sampled from the posterior of a user-defined environment-dependent birth-death process, using user defined uninformative priors and MH sampling.
- proposal: proposal functions for the MH-MCMC.
Directory Data constains the environmental variables used in the analyses.
Directory phylo constain the phylogenetic trees used in the analyses.
Example of how simulating a phylogenetic tree using only one environmental dependency.
Rscript Treesim_onevar.R [env_var] [seed] [extinction_rate]
Options for env_var
: Temperature
, CO2
, SeaLevel
, d13C
, Silica
.
Options for extinction_rate
: const
, ratio
.
Example of how simulating a phylogenetic tree using two environmental dependencies.
Rscript Treesim_onevar.R [env_var_1] [env_var_2] [seed] [extinction_rate]
Options for env_var_1
and env_var_2
: Temperature
, CO2
, SeaLevel
, d13C
, Silica
.
Options for extinction_rate
: const
, ratio
.
Example of how performing a MH-MCMC sampling of the posterior with only one environmental dependency.
Rscript Bayes_onevar.R [seed] [prior] [extinction_rate]
Options for prior
: unif
, norm
, exp
.
Options for extinction_rate
: const
, ratio
.
Example of how performing a MH-MCMC sampling of the posterior with two environmental dependencies.
Rscript Bayes_onevar.R [seed] [prior] [extinction_rate]
Options for prior
: unif
, norm
, exp
.
Options for extinction_rate
: const
, ratio
.
Example of how performing a MH-MCMC sampling of the horseshoe posterior implementing the variable selection procedure.
Rscript Variable_selection_onevar.R [seed]