Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tmbprofile

Adaptive likelihood profiling.


Description

Calculate 1D likelihood profiles wrt. single parameters or more generally, wrt. arbitrary linear combinations of parameters (e.g. contrasts).

Usage

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

Arguments

obj

Object from MakeADFun that has been optimized.

name

Name or index of a parameter to profile.

lincomb

Optional linear combination of parameters to profile. By default a unit vector corresponding to name.

h

Initial adaptive stepsize on parameter axis.

ytol

Adjusts the range of the likelihood values.

ystep

Adjusts the resolution of the likelihood profile.

maxit

Max number of iterations for adaptive algorithm.

parm.range

Valid parameter range.

slice

Do slicing rather than profiling?

trace

Trace progress? (TRUE, or a numeric value of 1, gives basic tracing: numeric values > 1 give more information)

...

Unused

Details

Given a linear combination

t = ∑_{i=1}^n v_i θ_i

of the parameter vector θ, this function calculates the likelihood profile of t. By default v is a unit vector determined from name. Alternatively the linear combination may be given directly (lincomb).

Value

data.frame with parameter and function values.

See Also

Examples

## Not run: 
runExample("simple",thisR=TRUE)
## Parameter names for this model:
## beta   beta   logsdu   logsd0

## Profile wrt. sigma0:
prof <- tmbprofile(obj,"logsd0")
plot(prof)
confint(prof)

## Profile the difference between the beta parameters (name is optional):
prof2 <- tmbprofile(obj,name="beta1 - beta2",lincomb = c(1,-1,0,0))
plot(prof2)
confint(prof2)

## End(Not run)

TMB

Template Model Builder: A General Random Effect Tool Inspired by 'ADMB'

v1.7.20
GPL-2
Authors
Kasper Kristensen [aut, cre, cph], Brad Bell [cph], Hans Skaug [ctb], Arni Magnusson [ctb], Casper Berg [ctb], Anders Nielsen [ctb], Martin Maechler [ctb], Theo Michelot [ctb], Mollie Brooks [ctb], Alex Forrence [ctb], Christoffer Moesgaard Albertsen [ctb], Cole Monnahan [ctb]
Initial release
2021-04-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.