response_metrics: Response Metrics for Quadratic Model

Description Usage Arguments Details

Description

For quadratic models predicting responses across an environmental gradients, extract the response and metrics (optimum value, e.g.)

get_response: Get model predicted response across a range of depth and temperature values

psi.opt: Optimum environmental value

psi.tol: Tolerance across environmental values

psi.max: Response achieved at environmental optimum

Usage

1
2
3
4
5
6
7
get_response(alphas, X, n_samp = NULL, n_grid = NULL)

psi.opt(b1, b2)

psi.tol(b2)

psi.max(b0, b1, b2)

Arguments

alphas

a data.table with alpha values; rows are posterior iterations, a1,a2,a3,a4,a5 are columns (see details)

X

a data.table with columns for bt (bottom temperature) and depth; bt associated with a2 and a3, depth with a4 and a5

n_samp

integer indicating (random) subsample of posterior to use; if NULL (default), no subsampling is performed

n_grid

number of depth and temperature values over which to estimate response; if NULL (default), response is calculated only for observed combinations in X

b1

a linear coefficient value (like a2 or a4 in alphas)

b2

a quadratic coefficient value (like a3 or a5 in alphas)

b0

an intercept parameter value (like a1 in alphas)

Details

The columns in alphas are parameters estimated from the MSOM model. The MSOM model has a form of y=a1*1 + a2*bt+a3*bt^2 + a4*depth+a5*depth^2. Thus, the columns in alpha are interpreted as follows:

a1 an intercept term, corresponds to b0
a2 a linear coefficient associated with bottom temeprature, corresponds to b1
a3 a quadratic coefficient associated with bottom temperature, corresponds to b2
a4 a linear coefficient associated with depth, corresponds to b1
a5 a quadratic coefficient assoicated with depth, corresponds to b2

where b0, b1, b2 are arguments to the response metric functions (psi.opt, psi.tol, and psi.max). Note, then, that the response metric functions do not consider models with 2 predictors, but only 1, hence the different notation.


rBatt/trawlDiversity documentation built on Aug. 14, 2021, 1:01 p.m.