Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

kernel-definitions

Functions to initialize and define IPM kernels


Description

Adds a new kernel to the proto_ipm structure.

Usage

define_kernel(
  proto_ipm,
  name,
  formula,
  family,
  ...,
  data_list = list(),
  states,
  has_hier_effs = FALSE,
  levels_hier_effs = list(),
  levels_ages = list(),
  evict_cor = FALSE,
  evict_fun = NULL,
  integrate = TRUE
)

Arguments

proto_ipm

The name of the model.

name

The name of the new kernel.

formula

A bare expression specifying the form of the kernel.

family

The type of kernel. Options are "CC" for continuous to continuous transitions, "DC" for discrete to continuous (e.g. emergence from a seedbank), "CD" for continuous to discrete (e.g. entering a seedbank), and "DD" for discrete to discrete (e.g. stasis in a seedbank).

...

A set of named expressions that correspond to vital rates in formula. Suffix expansion of hierarchical models is supported.

data_list

A list of named values that correspond to constants in the formula and vital rate expressions in ....

states

A list with character vector containing the names of each state variable used in the kernel.

has_hier_effs

A logical indicating whether or not the kernel and/or its underlying vital rates are structured with hierarchical effects. See the introduction vignette for this feature for more details (vignettes( 'ipmr-introduction', package = 'ipmr')).

levels_hier_effs

A named list with vectors corresponding to the various levels the hierarchical variable can take. The names should match the suffixes used in the vital rate expressions.

levels_ages

If init_ipm(has_age = TRUE), a list with possibly 2 entries: 1. "age": the range of possible ages in the model and, optionally, 2. "max_age": the maximum age individuals in the model can attain. Otherwise, not used.

evict_cor

A logical indicating whether an eviction correction should be applied to the kernel.

evict_fun

If evict_cor = TRUE, then a function that corrects for it. Currently, only truncated_distributions and discrete_extrema are possible.

integrate

For simple_* models, this controls whether a "d_z" is automatically appended to the formula argument. When TRUE, this automatically generates formula * d_z. There may be some cases where this behavior is not desirable. Set this to FALSE and specify the correct form if needed. The default is TRUE. This argument is ignored for all general_* models.

Details

Different classes of IPMs may have many or only a few kernels. Each one requires its own call to define_kernel, though there are some exceptions, namely for kernels derived from hierarchical models (e.g. vital rate models fit across plots and years).

A much more complete overview of how to generate kernels is provided in vignette("ipmr-introduction", "ipmr").

Value

A proto_ipm.


ipmr

Fits Integral Projection Models Using an Expression Based Framework

v0.0.1
MIT + file LICENSE
Authors
Sam Levin [aut, cre] (<https://orcid.org/0000-0002-3289-9925>), Aldo Compagnoni [aut], Dylan Childs [aut], Sanne Evers [aut], Roberto Salguero-Gomez [aut], Tiffany Knight [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.