quad.form: Evaluate a quadratic form efficiently

quad.formR Documentation

Evaluate a quadratic form efficiently

Description

Functionality for evaluating quadratic forms.

If you want to use these functions, import them from the quadform package, which has more extensive functionality, and is maintained.

The quadform package defines quad3.form() et seq, not quad.3form(), which was the old name. Function quad.3form() will soon be deprecated.

Usage

quad.form(M, x)
quad.form.inv(M, x)
quad.tform(M, x)
quad3.form(M, left, right)
cprod(x, y)
ht(x)

Arguments

M

Square matrix of size n\times n

x, y

Matrix of size n\times p, or vector of length n

left, right

In function quad3.form(), matrices with n rows and arbitrary number of columns. But see the quadform package for details.

Details

See the quadform package for further detail.

Note

See the quadform package for further detail.

Author(s)

Robin K. S. Hankin

See Also

optimize

Examples


jj <- matrix(rnorm(80),20,4)
M <- crossprod(jj,jj)

x <- matrix(rnorm(8),4,2)

jj.1 <- t(x) %*% M %*% x
jj.2 <- quad.form(M,x)
print(jj.1)
print(jj.2)


emulator documentation built on Sept. 7, 2026, 9:07 a.m.