Skip to contents

se_function(fit, f) evaluates f at the estimated components and propagates their sampling covariance through a numerical gradient: Var(f) = g' V g, with V = 2 AI^-1 the covariance of the components and g the gradient of f.

Usage

se_function(fit, f, h = 1e-06)

Arguments

fit

result of model()

f

function of the component vector, returning one number. It receives the NAMED vector, so f = function(th) th[["var(animal)"]] / sum(th) reads well

h

relative step of the numerical gradient

Value

list with estimate, se, and the gradient used

Details

The delta method assumes f is close to linear over the region the components could plausibly occupy, and that they are approximately normal. Neither holds near a boundary, a variance pinned at zero, a correlation at +/-1, and there the interval is not meaningful no matter how small it looks. Use profile_theta() instead when a component sits at an edge.