Skip to contents

Evaluates a fitted model's negative log-likelihood at a point supplied on the public label vocabulary also used by drm_control(start = ...), without refitting. This is a diagnostic: it selects nothing, reports no uncertainty, and does not change any fitted quantity or mutate the fitted object. For penalized (MAP) fits the returned value is on the same unpenalized convention as logLik() (any phylogenetic penalty is subtracted back out, re-evaluated at the queried point), so objective_at(fit, <fit's own optimum>) == -logLik(fit) holds for every fit type; it is therefore not literally what the optimizer minimised at that point for a penalized fit – use fit$obj$fn() directly for that. Errors for experimental MSPL fits, matching logLik().

Usage

objective_at(object, ...)

# S3 method for class 'drmTMB'
objective_at(object, at, ...)

Arguments

object

A fitted drmTMB object.

...

Passed to methods.

at

A named list of values keyed by public start labels (see drm_control(start = ...)), e.g. list("fixef:mu:(Intercept)" = 0.2, "sd:mu:(1 | id)" = 0.3). sd: values are given on the natural (positive) scale and cor: values on the natural correlation scale, exactly as for start=.

Value

A single number: the unpenalized negative log-likelihood (same convention as -logLik(fit)) at at.