Description Usage Arguments Details Value Examples
Computes the inverse of the cross-product of a matrix X.
1 | solveCrossprod(X, method = c("qr", "chol", "solve"))
|
X |
a matrix, typically a regressor matrix. |
method |
a string indicating whether the QR decomposition,
the Cholesky decomposition or |
Using the Cholesky decomposition of X'X (as computed by crossprod(X)
)
is computationally faster and preferred to solve(crossprod(X))
. Using the
QR decomposition of X is slower but should be more accurate.
a matrix containing the inverse of crossprod(X)
.
1 2 3 | X <- cbind(1, rnorm(100))
solveCrossprod(X)
solve(crossprod(X))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.