Skip to contents

Calculate 1D likelihood profiles with respect to single parameters or more generally with respect to linear combinations such as contrasts.

Usage

sbtprofile(
  obj,
  name,
  lincomb,
  h = 1e-04,
  ytol = 2L,
  ystep = 0.1,
  maxit = ceiling(5L * ytol/ystep),
  parm.range = c(-Inf, Inf),
  slice = FALSE,
  adaptive = TRUE,
  trace = TRUE
)

Arguments

obj

Object from MakeADFun that has been optimized.

name

Character string or integer. Name or index of a parameter to profile.

lincomb

Numeric vector. Optional linear combination of parameters to profile. By default a unit vector corresponding to name. Length must match number of parameters.

h

Numeric scalar. Initial adaptive stepsize on parameter axis. Default is 1e-04.

ytol

Numeric scalar. Tolerance that adjusts the range of the likelihood values. Default is 2.

ystep

Numeric scalar. Step size that adjusts the resolution of the likelihood profile. Default is 0.1.

maxit

Integer. Maximum number of iterations for adaptive algorithm. Default is ceiling(5 * ytol / ystep).

parm.range

Numeric vector of length 2. Valid parameter range as c(min, max). Default is c(-Inf, Inf).

slice

Logical. If TRUE, do slicing rather than profiling. Default is FALSE.

adaptive

Logical. Use adaptive step size? Default is TRUE.

trace

Logical or numeric. Trace progress? TRUE or 1 gives basic tracing, values > 1 give more information. Default is TRUE.

Value

A data frame of class tmbprofile with columns:

Parameter name

Values of the profiled parameter

value

Objective function values along the profile

Component columns

Likelihood contributions from different model components (Prior, Selectivity, Recruitment, etc.)

Details

A supplied lincomb must contain at least one nonzero element and have the same length as the active fixed-parameter vector. These requirements are assumed by the matrix construction and are not fully validated before profiling begins.