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

qrSolve

LSE Solution


Description

Systems of linear equations via QR decomposition.

Usage

qrSolve(A, b)

Arguments

A

numerical matrix with nrow(A)>=ncol(A).

b

numerical vector with length(b) == nrow(A).

Details

Solves (overdetermined) systems of linear equations via QR decomposition.

Value

The solution of the system as vector.

References

Trefethen, L. N., and D. Bau III. (1997). Numerical Linear Algebra. SIAM, Society for Industrial and Applied Mathematics, Philadelphia.

See Also

Examples

A <- matrix(c(0,-4,2, 6,-3,-2, 8,1,-1), 3, 3, byrow=TRUE)
b <- c(-2, -6, 7)
qrSolve(A, b)

##  Solve an overdetermined linear system of equations
A <- matrix(c(1:8,7,4,2,3,4,2,2), ncol=3, byrow=TRUE)
b <- rep(6, 5)
x <- qrSolve(A, b)
qr.solve(A, rep(6, 5)); x

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

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