xTAx | R Documentation |
Common quadratic forms
xTAx(x, A)
xAxT(x, A)
xTAx_solve(x, A, ...)
xTAx_qrsolve(x, A, tol = 1e-07, ...)
sandwich_solve(A, B, ...)
x |
a vector |
A |
a square matrix |
... |
additional arguments to subroutines |
tol |
tolerance argument passed to the relevant subroutine |
B |
a square matrix |
These are somewhat inspired by emulator::quad.form.inv() and others.
xTAx()
: Evaluate x'Ax
for vector x
and square
matrix A
.
xAxT()
: Evaluate xAx'
for vector x
and square
matrix A
.
xTAx_solve()
: Evaluate x'A^{-1}x
for vector x
and
invertible matrix A
using solve()
.
xTAx_qrsolve()
: Evaluate x'A^{-1}x
for vector x
and
matrix A
using QR decomposition and confirming that x
is in the span of A
if A
is singular; returns rank
and nullity
as attributes just in case subsequent calculations
(e.g., hypothesis test degrees of freedom) are affected.
sandwich_solve()
: Evaluate A^{-1}B(A')^{-1}
for B
a
square matrix and A
invertible.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.