rand_leslie_set {mpmsim} | R Documentation |
Generate a set of random Leslie Matrix Population Models
Description
Generates a set of Leslie matrix population models (MPMs) based on defined mortality and fertility models, and using model parameters randomly drawn from specified distributions.
Usage
rand_leslie_set(
n_models = 5,
mortality_model = "gompertz",
fertility_model = "step",
mortality_params,
fertility_params,
fertility_maturity_params,
dist_type = "uniform",
output = "type1",
scale_output = FALSE
)
Arguments
n_models |
An integer indicating the number of MPMs to generate. |
mortality_model |
A character string specifying the name of the
mortality model to be used. Options are |
fertility_model |
A character string specifying the name of the
fertility model to be used. Options are |
mortality_params |
A two-column dataframe with a number of rows equal to
the number of parameters in the mortality model. The required order of the
parameters depends on the selected
|
fertility_params |
A two-column dataframe with a number of rows equal to
the number of parameters in the fertility model. The required order of the
parameters depends on the selected
|
fertility_maturity_params |
A vector with two elements defining the
distribution from which age at maturity is drawn for the models. The models
will coerce fertility to be zero before this point. If |
dist_type |
A character string specifying the type of distribution to
draw parameters from. Default is |
output |
Character string indicating the type of output. Output can be one of the following types:
|
scale_output |
A logical argument. If |
Value
Returns a CompadreDB
object or list
containing MPMs or life
tables generated using the specified model with parameters drawn from
random uniform or normal distributions. The format of the output MPMs
depends on the arguments output
. Outputs may optionally be scaled using
the argument scale_output
to ensure a population growth rate (lambda) of
1.
If the output is a CompadreDB
object, the parameters of the models used
to produce the MPM are included in the metadata.
Author(s)
Owen Jones jones@biology.sdu.dk
See Also
Other Leslie matrices:
make_leslie_mpm()
,
reorganise_matrices()
Examples
mortParams <- data.frame(
minVal = c(0, 0.01, 0.1),
maxVal = c(0.14, 0.15, 0.1)
)
fertParams <- data.frame(
minVal = c(10, 0.5, 8),
maxVal = c(11, 0.9, 10)
)
maturityParam <- c(0, 0)
rand_leslie_set(
n_models = 5,
mortality_model = "gompertzmakeham",
fertility_model = "normal",
mortality_params = mortParams,
fertility_params = fertParams,
fertility_maturity_params = maturityParam,
dist_type = "uniform",
output = "Type1"
)