Standard error of a function of the variance components (delta method)
Source:R/inference.R
se_function.Rdse_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.
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
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.