xTAx {statnet.common} | R Documentation |
Common quadratic forms
Description
Common quadratic forms
Usage
xTAx(x, A)
xAxT(x, A)
xTAx_solve(x, A, ...)
xTAx_qrsolve(x, A, tol = 1e-07, ...)
sandwich_solve(A, B, ...)
Arguments
x |
a vector |
A |
a square matrix |
... |
additional arguments to subroutines |
tol |
tolerance argument passed to the relevant subroutine |
B |
a square matrix |
Details
These are somewhat inspired by emulator::quad.form.inv() and others.
Functions
-
xTAx()
: Evaluatex'Ax
for vectorx
and square matrixA
. -
xAxT()
: EvaluatexAx'
for vectorx
and square matrixA
. -
xTAx_solve()
: Evaluatex'A^{-1}x
for vectorx
and invertible matrixA
usingsolve()
. -
xTAx_qrsolve()
: Evaluatex'A^{-1}x
for vectorx
and matrixA
using QR decomposition and confirming thatx
is in the span ofA
ifA
is singular; returnsrank
andnullity
as attributes just in case subsequent calculations (e.g., hypothesis test degrees of freedom) are affected. -
sandwich_solve()
: EvaluateA^{-1}B(A')^{-1}
forB
a square matrix andA
invertible.