solve_linear_system | R Documentation |
Solve (A + lam I) x = b
solve_linear_system(A, b, add_to_diag = 0)
A |
A symmetric square matrix. |
b |
A vector. |
add_to_diag |
One value to add to the diagonal of A (lam). Default is 0. |
The best solution x
of this linear system.
A <- matrix(rnorm(4), 2); A[1, 2] <- A[2, 1] # should be symmetric
x <- rnorm(2)
b <- A %*% x
x2 <- drop(solve(A, b))
x3 <- solve_linear_system(A, b)
rbind(x, x2, x3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.