elasticity: Compute elasticity

Description Usage Arguments Value

View source: R/perturb_analysis.R

Description

Compute elasticity

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
elasticity(
  ipm,
  what = c("r_0", "lambda", "gen_t"),
  level = c("kernel", "vital_rate", "parameter"),
  subset = NA_character_,
  ...
)

## S3 method for class 'simple_di_det_ipm'
elasticity(
  ipm,
  what = "lambda",
  level = "kernel",
  subset = NA_character_,
  n_iterations = 100,
  ...
)

## S3 method for class 'general_di_det_ipm'
elasticity(
  ipm,
  what = "lambda",
  level = "kernel",
  subset = NA_character_,
  n_iterations = 100,
  mega_mat,
  mega_vec,
  ...
)

Arguments

ipm

Output from make_ipm().

what

The numerator of the partial derivative for sensitivity. Possible options "lambda" (default), "r_0", and "gen_t". More will probably be added later.

level

The level to compute elasticity at. "kernel" computes the model wide elasticity surface and returns that. "vital_rate" computes lambda's elasticity to specific vital rates, "parameter" lambda's elasticity to each parameter. Use subset to specify a subset of vital rates or parameters to compute values for.

subset

A character vector corresponding to the "vital_rates" or "parameters" you want to compute sensitivities for. Can save time if only a few parameters or vital rates are of interest.

...

other arguments passed to methods

n_iterations

The number of times to iterate the model when computing the left and right eigenvectors. Default is 100 for deterministic IPMs, and varies depending on the stochastic IPM.

mega_mat

A vector of names and/or 0s specifying the relationship between the kernels in the model. The names should correspond to kernel names, with 0s corresponding to sparse areas of the mega-matrix. The names can be either symbols or characters. These functions support suffix expansion as in define_k(ernel), so expressions don't need to be re-written for every combination hierarchical effects.

mega_vec

A vector of names specifying the format of the population vector. The names can be either symbols or characters.

Value

A list. Contains either kernel response surfaces, vital rate level elasticity values, or parameter level elasticity values. The class is always c("ipmr_elasticity", "list") (for internal usage and plot methods).


levisc8/irage documentation built on March 6, 2020, 12:56 a.m.