View source: R/ABC_functions.R
make_priors | R Documentation |
Creates an empty priors object for use in abc_moran_deme
make_priors(n.spec, n.site)
n.spec |
Numeric, the number of species in the metacommunity |
n.site |
Numeric, the number of communities in the metacommunity |
Creates a priors object which is a list containing 10 elements. jdist: One of 1 or 2, specifies a uniform or normal prior distribution for the community size.
jparams: A 2L Numeric vector. If jdist = 1 then the first value is the minimum and the second value is the maximum. If jdist = 2 then the first value is the mean and the second value is the standard deviation.
seldist: One of 1, 2, or 3, specifies a uniform, normal, or gamma prior distribution for the selection coefficients for each community.
selparams: A 2L Numeric vector. If seldist = 1 then the first value is the minimum and the second value is the maximum. If seldist = 2 then the first value is the mean and the second value is the standard deviation. If seldist = 3 then the first value is the shape parameter and the second value is the scale parameter.
fddist: One of 1 or 2, specifies a uniform or normal prior distribution for the frequency dependence parameters.
fdparams: A 2L Numeric vector. If fddist = 1 then the first value is the minimum and the second value is the maximum. If fddist = 2 then the first value is the mean and the second value is the standard deviation.
migdist: One of 1 or 2, specifies a uniform or normal prior distribution for the migration distance. Can be a vector with length equal to the number of species in simulations to give each species its own migration distance prior distribution
migdistparams: A 2L Numeric vector. If migdist = 1 then the first value is the minimum and the second value is the maximum. If migdist = 2 then the first value is the mean and the second value is the standard deviation. Can also be a list of 2L numeric vectors specifying prior distribution parameters for each species individually.
migprobdist: One of 1 or 2, specifies a uniform or normal prior distribution for the migration probability. Can be a vector with length equal to the number of species in simulations to give each species its own migration probability prior distribution
migprobparams: A 2L Numeric vector. If migprobdist = 1 then the first value is the minimum and the second value is the maximum. If migprobdist = 2 then the first value is the mean and the second value is the standard deviation. Can also be a list of 2L numeric vectors specifying prior distribution parameters for each species individually.
testpriors <- make_priors(5, 5)
testpriors$jdist <- 1
testpriors$jparams <- c(100, 200)
testpriors$seldist <- 2
testpriors$selparams <- c(.5, .1)
testpriors$fddist <- 1
testpriors$fdparams <- c(-.5, -.2)
testpriors$migdist <- 1
testpriors$migdistparams <- c(10, 50)
testpriors$migprobdist <- 1
testpriors$migprobparams <- c(.1, .2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.