Create iteration kernels from an IPM object
Creates iteration kernels for IPMs. ipmr
does not create
these to iterate models, but they may be useful for further analyses.
format_mega_matrix(ipm, ...) ## Default S3 method: format_mega_matrix(ipm, mega_mat, ...) ## S3 method for class 'age_x_size_ipm' format_mega_matrix(ipm, name_ps, f_forms, ...) make_iter_kernel(ipm, mega_mat = NULL, name_ps = NULL, f_forms = NULL)
ipm |
Output from |
... |
Other arguments passed to methods. |
mega_mat |
A vector with symbols, I's, and/or 0s representing the matrix blocks.
They should be specified in ROW MAJOR order! Can also be a character
string specifying the call. Hierarchical syntax is supported. When used,
|
name_ps |
The prefix(es) for the kernel name that correspond to survival
and growth/maturation of existing individuals. For the model
|
f_forms |
The names of the kernels that correspond to production of new
individuals, and possibly, how they are combined. For example, a model that
includes sexual (with an "F" kernel) and asexual reproduction (with a "C" kernel),
this would be |
ipmr
does not generate complete iteration kernels, and uses
sub-kernels to iterate models. However, some further analyses are just easier
to code with a complete iteration kernel. This handles constructing those for
simple and general models of all forms. format_mega_matrix
is used
internally by make_iter_kernel
for general IPMs.
I
and 0
represent identity matrices and 0 matrices,
respectively. They can be used to fill in blocks that represent either, without
having to create those separately and append them to the model object. The function
will work out the correct dimensions for both internally, and there is no
restriction on the number that may be used in a given call.
For age_size_ipm
s, the correct form of mega_mat
is generated
internally by creating sub-diagonal matrices for the name_ps
kernels,
and a top row using the f_forms
. If hierarchical effects are part of the
model, the suffixes should be attached to the name_ps, f_forms
in the
function arguments, and the correct block matrices will be generated internally.
A list containing a large matrix or many large matrices (when used with
hierarchical syntax). The names in the former case will be "mega_matrix"
and in the latter case, "mega_matrix_<hier_effs>"
with the levels of the
hierarchical effects substituted in.
data(gen_di_det_ex) big_k <- make_iter_kernel(gen_di_det_ex, mega_mat = c(0, go_discrete, leave_discrete, P)) char_call <- c(0, "go_discrete", "leave_discrete", "P") big_k_c <- make_iter_kernel(gen_di_det_ex, mega_mat = char_call) # Now, with an Identity matrix instead of a 0 big_k <- make_iter_kernel(gen_di_det_ex, mega_mat = c(I, go_discrete, leave_discrete, P)) # For simple IPMs with no hierarchical effects, this computes the sum of # the sub-kernels (i.e. K = P + F) data(sim_di_det_ex) simple_k <- make_iter_kernel(sim_di_det_ex)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.