Compute quadratic form of a vector with a matrix, which can be the vector of coefficients and the covariance matrix extracted from a fitted model
quad_form(x, m = NULL, inv = TRUE, subset = NULL, vcov = NULL, ...)
a numeric vector or a fitted model
a square numeric matrix
a boolean, if TRUE
(the default), the quadratic form
is computed using the inverse of the matrix
a subset of the vector and the corresponding subset of the matrix
if NULL
the vcov
method is used, otherwise it can
be a function or, for micsr
objects, a character
arguments passed to vcov
if it is a function