| stoch | R Documentation |
Analyse long-term dynamics of a stochastic population matrix projection model.
stoch(
A,
what = "all",
Aseq = "unif",
vector = NULL,
Astart = NULL,
iterations = 10000,
discard = 1000,
PREcheck = FALSE
)
A |
a list of matrices. |
what |
Deprecated: later versions will always return all values of growth, log growth and variance in growth. This argument determines what should be returned. A character vector with possible entries "lambda" (to calcualate stochastic growth), "log_lambda" (to calcualate logarithm of stochastic growth), "var" (to calculate variance in log stochastic growth) and/or "all" (to calculate all values). |
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 |
Calculates stochastic growth and its variance for a given stochastic population matrix projection model.
A numeric vector with three possible elements: "lambda" (the geometric mean stochastic population
growth rate) "log_lambda" (the arithmetic mean of the logarithm of the stochastic population growth rate)
and "var" (the variance of the logarithm of the stochastic population growth rate). Values
returned depend on what's passed to what.
# load the Polar bear data
( data(Pbear) )
# Find the stochastic info for a time series with uniform probability of each
# matrix
( all_unif <- stoch(Pbear, what = "all", Aseq = "unif") )
# 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)
( all_q <- stoch(Pbear, what = "all", Aseq = Pbear_seq) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.