View source: R/parameter_zero_inflation.R
| par_zero_inflation | R Documentation |
This adds a zero inflation to the distribution of a parameter for the
different loci. When using this, each locus will be simulated with a
parameter value of 0 with probability prob, or with parameter's
original value in the remaining cases.
are called separately for each locus, which can dramatically increase the
time needed to simulate models with many loci.
par_zero_inflation(par, prob, random = TRUE)
par |
A parameter which will be set to 0 for part of the loci. |
prob |
The probability that the parameters value will be set to |
random |
Whether the number of loci which are simulated with a value of
|
For parameters that are identical for all loci: parameter
# Simulate half of the loci with recomination and the other half without it:
model <- coal_model(4, 4) +
feat_recombination(par_zero_inflation(par_named("rho"), .5, random = FALSE)) +
sumstat_trees()
simulate(model, pars = c(rho = 1))
# Use a zero inflated gamma distribution:
model <- coal_model(4, 4) +
feat_recombination(par_zero_inflation(par_variation(1, 10), .3)) +
sumstat_trees()
simulate(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.