Define population dynamics from a matrix and additional objects that determine covariate effects, density dependence, and forms of stochasticity.
dynamics(matrix, ...)
# S3 method for dynamics
update(object, ...)
is.dynamics(x)
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
,
environmental_stochasticity
,
demographic_stochasticity
,
density_dependence
, or
density_dependence_n
a dynamics
object
an object to pass to is.dynamics
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.
# 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)