get_gradient: Selection gradient

View source: R/get_gradient.R

get_gradientR Documentation

Selection gradient

Description

Computes the selection gradient given a resident value and model parameters.

Usage

get_gradient(xres, pars, init)

Arguments

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

Details

The functions uses find_equilibrium to compute the equilibrium population sizes (in the two habitats) given the resident trait value, which are needed to compute the gradient.

Value

The selection gradient

See Also

find_equilibrium

Examples


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


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