Eigen_lsSolve | R Documentation |
Solves a linear least-squares problem.
Eigen_lsSolve(A, b, method = "cod")
A |
a |
b |
a vector of length |
method |
the method used to solve the problem, either |
The solution X
of the least-squares problem AX ~= b
(similar to lm.fit(A, b)$coefficients
). This is a matrix if
b
is a matrix, or a vector if b
is a vector.
set.seed(129)
n <- 7; p <- 2
A <- matrix(rnorm(n * p), n, p)
b <- rnorm(n)
lsfit <- Eigen_lsSolve(A, b)
b - A %*% lsfit # residuals
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.