Define population dynamics from a matrix and additional objects that determine covariate effects, density dependence, and forms of stochasticity.
Usage
dynamics(matrix, ...)
# S3 method for class 'dynamics'
update(object, ...)
is.dynamics(x)Arguments
- matrix
a matrix of vital rates specifying transitions between ages or stages. Specified in the format $n_t+1 = A $A$ is the matrix, so that values in a given column and row denote a transition from that column to that row
- ...
additional objects used to define population dynamics. Must be one or more of
covariates,replicated_covariates,environmental_stochasticity,demographic_stochasticity,density_dependence,add_remove_pre, oradd_remove_post. Note thatdensity_dependence_nis equivalent toadd_remove_post.- object
a
dynamicsobject- x
an object to pass to
is.dynamics
Details
A call to dynamics defines an object of class
dynamics, which can be used to simulate population
trajectories with the simulate function. The plot
function is supported and will generate a general life-cycle
diagram based on the defined population dynamics.
A compiled dynamics object can be
updated to change any of the included processes with
the update function.
Examples
# define a population
nclass <- 5
popmat <- matrix(0, nrow = nclass, ncol = nclass)
popmat[reproduction(popmat, dims = 4:5)] <- c(10, 20)
popmat[transition(popmat)] <- c(0.25, 0.3, 0.5, 0.65)
# define a dynamics object
dyn <- dynamics(popmat)
# and plot this
plot(dyn)