get_lambda: Invasion fitness

View source: R/get_lambda.R

get_lambdaR Documentation

Invasion fitness

Description

Computes the invasion fitness of a mutant in a resident population, given trait values and model parameters.

Usage

get_lambda(x, xres, pars, init, fast = FALSE)

Arguments

x

The mutant trait value

xres

The resident trait value

pars

An unevaluated parameter-list (e.g. as returned by get_default_pars)

init

A vector of two starting values for solving of the demographic equilibrium

fast

See the "Details" section

Details

This function computes an expression for the leading eigenvalue of the transition matrix of the model, which is the invasion fitness of the mutant.

The function will find the demographic equilibrium of the resident (passing init to find_equilibrium) only if fast = FALSE. Otherwise, init is interpreted as a vector of equilibrium population sizes (useful when computing the invasion fitness of many mutants in the same resident population, e.g. in plot_pip).

Value

The invasion fitness of the mutant given the resident

See Also

plot_pip, find_equilibrium

Examples


pars <- get_default_pars()
get_lambda(0.01, 0, pars, init = rep(1000, 2))


rscherrer/speciomx documentation built on March 28, 2023, 8:49 p.m.