stoch {popdemo} | R Documentation |
Project population dynamics
Description
Analyse long-term dynamics of a stochastic population matrix projection model.
Usage
stoch(
A,
what = "all",
Aseq = "unif",
vector = NULL,
Astart = NULL,
iterations = 10000,
discard = 1000,
PREcheck = FALSE
)
Arguments
A |
a list of matrices. |
what |
what should be returned. A character vector with possible entries "lambda" (to calcualate stochastic growth), "var" (to calculate variance in stochastic growth) and/or "all" (to calculate both). |
Aseq |
the sequence of matrices in a stochastic projection.
|
vector |
(optional) a numeric vector describing the age/stage
distribution used to calculate the projection. If |
Astart |
(optional) in a stochastic projection, the matrix with which to
initialise the projection (either numeric, corresponding to the matrices in
|
iterations |
the number of projection intervals. The default is 1e+5. |
discard |
the number of initial projection intervals to discard, to discount near-term effects arising from the choice of vector. The default is 1e+3 |
PREcheck |
many functions in |
Details
Calculates stochastic growth and its variance for a given stochastic population matrix projection model.
Value
A numeric vector with two possible elements: "lambda" (the stochastic population
growth rate) and "var" (the variance in stochastic population growth rate). Values
returned depend on what's passed to what
.
Examples
# load the Polar bear data
( data(Pbear) )
# Find the stochastic growth for a time series with uniform probability of each
# matrix
( lambda_unif <- stoch(Pbear, what = "lambda", Aseq = "unif") )
# Find the variance in stochastic growth for a time series with uniform
# probability of each matrix
( var_unif <- stoch(Pbear, what = "var", Aseq = "unif") )
# Find stochastic growth and its variance for a time series with a sequence of
# matrices where "bad" years happen with probability q
q <- 0.5
prob_seq <- c(rep(1-q,3)/3, rep(q,2)/2)
Pbear_seq <- matrix(rep(prob_seq,5), 5, 5)
( var_unif <- stoch(Pbear, what = "var", Aseq = Pbear_seq) )