drawParms: Draw simulation parameter values from a control file with...

View source: R/drawParms.R

drawParmsR Documentation

Draw simulation parameter values from a control file with specified prior distributions

Description

Takes an input file with some fixed variables and some prior distributions, outputs a list of parameter values for the simulation

Usage

drawParms(control = NULL)

Arguments

control

The full path to a .csv formatted file specifying prior distributions for model parameters.

Details

The control file includes five required columns:

  • param the case-sensitive parameter name.

  • min the lower bound of uniform and loguniform prior distributions (NA if type = "beta", parameter name if type = "conditional").

  • max the upper bound of uniform and loguniform prior distributions (scalar for beta distribution if type = "beta", parameter name if type = "conditional").

  • type a character string specifying the distribution to draw from (options are "fixed", "uniform", "loguniform", "conditional", "logical", and "beta").

  • is.int a TRUE/FALSE indicating whether the parameter is an integer (if TRUE, randomly-drawn values are rounded to the nearest whole number).

The control file includes the following required parameters as rows:

  • shortscale the scale parameter for the distribution of short-distance dispersal events (k parameter of Weibull distribution).

  • shortshape the shape parameter for the distribution of short-distance dispersal events (lambda parameter of Weibull distribution).

  • nloci the number of genetic marker loci included in the observed dataset.

  • seq_length the sequence length of the marker, used along with mu below in the fastsimcoal DNA model.

  • mu the mutation rate (per bp, per generation) of the simulated locus, used with seq_length above in the fastsimcoal DNA model.

  • G the generation time of the species in years.

  • longmean the average distance of long-distance dispersal events.

  • lambda the rate of population growth within cells (discrete rate of increase).

  • mix the mixture parameter for the distribution of dispersal distances, the proportion of dispersal events that are long-distance.

  • Ne the maximum effective population size of a cell in the landscape.

  • preLGM_t the time at which refugial populations diverged from one another (e.g., the last interglacial).

  • preLGM_Ne the effective population size of the species prior to refuge divergence.

  • found_Ne the effective population size of newly colonized populations (used in coalescent simulations only).

  • ref_Ne the effective population size of cells included in refugia (scaled by cell-specific habitat suitability in the first time step).

Value

One-row, named data frame of parameter values for a simulation

See Also

getpophist2.cells

Examples

library(holoSimCell)
parms <- drawParms(control = system.file("extdata/ashpaper","Ash_priors.csv",package="holoSimCell"))
parms


stranda/holoSimCell documentation built on Aug. 4, 2023, 1:12 p.m.