Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

solveCrossprod

Inversion of X'X


Description

Computes the inverse of the cross-product of a matrix X.

Usage

solveCrossprod(X, method = c("qr", "chol", "solve"))

Arguments

X

a matrix, typically a regressor matrix.

method

a string indicating whether the QR decomposition, the Cholesky decomposition or solve should be used.

Details

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.

Value

a matrix containing the inverse of crossprod(X).

Examples

X <- cbind(1, rnorm(100))
solveCrossprod(X)
solve(crossprod(X))

strucchange

Testing, Monitoring, and Dating Structural Changes

v1.5-2
GPL-2 | GPL-3
Authors
Achim Zeileis [aut, cre] (<https://orcid.org/0000-0003-0918-3766>), Friedrich Leisch [aut], Kurt Hornik [aut], Christian Kleiber [aut], Bruce Hansen [ctb], Edgar C. Merkle [ctb]
Initial release
2019-10-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.