Simulate Population Growth with Logistic Dynamics
sim_stochastic_logistic.Rd
Simulates population growth over multiple time steps using a stochastic logistic growth model. This model incorporates both stochastic elements and a carrying capacity to describe population dynamics.
Arguments
- n0
Numeric value indicating the initial population size. Must be a non-negative integer.
- lambda
Numeric vector of birth rates. This can be a single value (constant birth rate) or a vector of length
steps
specifying the birth rate at each time step.- mu
Numeric vector of death rates. This can be a single value (constant death rate) or a vector of length
steps
specifying the death rate at each time step.- K
Numeric value representing the carrying capacity of the environment. Must be a non-negative integer.
- steps
Integer value specifying the number of time steps to simulate. Must be a non-negative integer.
- delta_t
Numeric vector of time step sizes. This can be a single value (constant time step) or a vector of length
steps
. If a single value is provided, it is replicated for each time step.