| 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, ...)
xTAx_eigen(x, A, tol = sqrt(.Machine$double.eps), ...)
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'Axfor vectorxand square matrixA. -
xAxT(): EvaluatexAx'for vectorxand square matrixA. -
xTAx_solve(): Evaluatex'A^{-1}xfor vectorxand invertible matrixAusingsolve(). -
xTAx_qrsolve(): Evaluatex'A^{-1}xfor vectorxand matrixAusing QR decomposition and confirming thatxis in the span ofAifAis singular; returnsrankandnullityas attributes just in case subsequent calculations (e.g., hypothesis test degrees of freedom) are affected. -
sandwich_solve(): EvaluateA^{-1}B(A')^{-1}forBa square matrix andAinvertible. -
xTAx_eigen(): Evaluatex' A^{-1} xfor vectorxand matrixA(symmetric, nonnegative-definite) via eigendecomposition; returnsrankandnullityas attributes just in case subsequent calculations (e.g., hypothesis test degrees of freedom) are affected.Decompose
A = P L P'forLdiagonal matrix of eigenvalues andPorthogonal. ThenA^{-1} = P L^{-1} P'.Substituting,
x' A^{-1} x = x' P L^{-1} P' x = h' L^{-1} hfor
h = P' x.