is_conv_to_asymptotic {ipmr} | R Documentation |
Check for model convergence to asymptotic dynamics
Description
Checks for convergence to asymptotic dynamics numerically and
visually. is_conv_to_asymptotic
checks whether
lambda[iterations - 1]
equals lambda[iterations]
within the
specified tolerance, tolerance
. conv_plot
plots the time series of
lambda
(or log(lambda)
). For stochastic models, a cumulative mean of
log(lambda) is used to check for convergence.
Usage
is_conv_to_asymptotic(ipm, tolerance, burn_in)
## S3 method for class 'ipmr_ipm'
is_conv_to_asymptotic(ipm, tolerance = 1e-06, burn_in = 0.1)
conv_plot(ipm, iterations, log, show_stable, burn_in, ...)
## S3 method for class 'ipmr_ipm'
conv_plot(
ipm,
iterations = NULL,
log = NULL,
show_stable = TRUE,
burn_in = 0.1,
...
)
Arguments
ipm |
An object returned by |
tolerance |
The tolerance for convergence in lambda or, in the case of stochastic models, the cumulative mean of log(lambda). |
burn_in |
The proportion of iterations to discard. Default is 0.1 (i.e. first 10% of iterations in the simulation). Ignored for deterministic models. |
iterations |
The range of iterations to plot |
log |
A logical indicating whether to log transform |
show_stable |
A logical indicating whether or not to draw a line indicating
population stability at |
... |
Further arguments to |
Details
Plotting can be controlled by passing additional graphing parameters
to ...
.
Value
is_conv_to_asymptotic
: Either TRUE
or FALSE
.
conv_plot
: codeipm invisibly.
Examples
data(gen_di_det_ex)
proto <- gen_di_det_ex$proto_ipm %>%
define_pop_state(n_ht = runif(200),
n_b = 200000)
ipm <- make_ipm(proto)
is_conv_to_asymptotic(ipm, tolerance = 1e-5)
conv_plot(ipm)