powered by
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.
quad3.form()
quad.3form()
quad.form(M, x) quad.form.inv(M, x) quad.tform(M, x) quad3.form(M, left, right) cprod(x, y) ht(x)
Square matrix of size \(n\times n\)
Matrix of size \(n\times p\), or vector of length \(n\)
In function quad3.form(), matrices with \(n\) rows and arbitrary number of columns. But see the quadform package for details.
quadform
Robin K. S. Hankin
See the quadform package for further detail.
optimize
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