Learn R Programming

emulator (version 1.3-0)

quad.form: 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.

Author

Robin K. S. Hankin

Details

See the quadform package for further detail.

See Also

Examples

Run this code

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)

Run the code above in your browser using DataLab