Learn R Programming

statnet.common (version 4.9.0)

xTAx: 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

Functions

  • 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.

Details

These are somewhat inspired by emulator::quad.form.inv() and others.