sim.coexp: Simulation of codemographic models

View source: R/coexpansion_CEA_TH_NCT.R

sim.coexpR Documentation

Simulation of codemographic models

Description

Simulation of codemographic models

Usage

sim.coexp(
  nsims,
  var.zeta,
  coexp.prior,
  th,
  Ne.prior,
  NeA.prior,
  time.prior,
  gene.prior,
  alpha = F,
  append.sims = F,
  path = getwd()
)

Arguments

nsims

Total number of simulations

var.zeta

Variation on zeta parameter. Can be "FREE" to vary or be set to a specific value (between 0-1).

coexp.prior

Uniform prior for the coespansion time. Vector of two numbers with the lower and upper boudary of the prior.

th

Threshold. Minimum time difference between Ts, time of simultaneous change and population specific times.

Ne.prior

Data frame with the prior values for the Ne of each population.

NeA.prior

Data frame with the prior values for the ancestral Ne of each population.

time.prior

Data frame with parameter values for the priors of the time of demographic change of each population.

gene.prior

Data frame with parameter values for the priors of the mutation rate of each species.

alpha

logical. If TRUE all demographic chages are exponential. If FALSE sudden changes. Defaut is FALSE.

append.sims

logical. If TRUE simulations are appended to the simulations file. Defaut is FALSE.

path

Path to the directiry to write the simulations. Defaut is the working directory.

Details

To simulate the model of Chan et al. (2014) the th parameter should be set to zero and the time.prior should have the same value of the coexp.prior.

To simulate the Threshold model the th argument need to be higher than zero. To simulate the Narrow Coexpansion Time model the th argument need to be higher than zero and the boundaries of coexp.time shoud be narrower than the time.prior values. See references for more details. Use the sim.coexp2 function to simulate the partitioned time model.

References

Gehara M., Garda A.A., Werneck F.P. et al. (2017) Estimating synchronous demographic changes across populations using hABC and its application for a herpetological community from northeastern Brazil. Molecular Ecology, 26, 4756–4771.

Chan Y.L., Schanzenbach D., & Hickerson M.J. (2014) Detecting concerted demographic response across community assemblages using hierarchical approximate Bayesian computation. Molecular Biology and Evolution, 31, 2501–2515.


gehara/PipeMaster documentation built on Feb. 4, 2024, 8:11 a.m.