%c% | R Documentation |
This operator computes the matrix-product between two matrices.
It can be used as a replacement for %*%
in many cases. The operator
only accepts matrices of types: matrix
or dgCMatrix
.
In the case of two dense matrices the operator will compute the crossproduct
in parallel (Eigen + OpenMP)
X%c%Y
X |
Matrix or vector (treated as column-vector) of type: |
Y |
as |
Matrix of type: matrix
or dgCMatrix
# Least Squares Solving
# Generate random data
n = 1000
p = 500
M <- matrix(rnorm(n*p),n,p)
y <- rnorm(n)
# least squares solution:
b <- csolve(t(M) %c% M, t(M) %c% y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.