View source: R/ABC_functions.R
set_sel_priors | R Documentation |
Creates a random selection matrix according to either a Uniform, Normal, or Gamma prior distribution
set_sel_priors(n.spec, n.sites, distr, input1, input2)
n.spec |
Numeric, the number of species in the metacommunity |
n.sites |
Numeric, the number of communities in the metacommunity |
distr |
Either a 1, 2, or 3, corresponding to Uniform, Normal, and Gamma prior distributions respectively. |
input1 , input2 |
Numeric, parameters for prior distributions. See details. |
Creates a random selection coeffient matrix according to a prior distribution. Selection coefficients are randomly selected for species in each community according to the prior. If distr = 1, then input 1 is the minimum and input 2 is the maximum. If distr = 2, then input 1 is the mean and input 2 is the standard deviation. if distr = 3, then input 1 is the shape parameter, and input 2 is the scale parameter.
A selection matrix where columns are species, rows are communities and cell ij is the selection coefficient for species j in community i.
# For Uniform distribution
set_sel_priors(5, 5, distr = 1, input1 = .1, input2 = 1)
# For Normal distribution
set_sel_priors(5, 5, distr = 2, input1 = .5, input2 = .2)
# For Gamma Distribution
set_sel_priors(5, 5, distr = 3, input1 = 2, input2 = .2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.