home *** CD-ROM | disk | FTP | other *** search
-
- _s_o_l_v_e _a _s_y_s_t_e_m _o_f _e_q_u_a_t_i_o_n_s
-
- solve(a, b, tol = 1e-7)
-
- _A_r_g_u_m_e_n_t_s:
-
- a : a numeric matrix containing the coefficients
- of the linear system.
-
- b : a numeric vector or matrix giving the right-
- hand side(s) of the linear system. If omit-
- ted, b is taken to be an identity matrix and
- solve will return the inverse of a.
-
- tol : the tolerance for detecting linear dependen-
- cies in the columns of a.
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- This function solves the equation a %*% x = b for b,
- where b can be either a vector or a matrix.
-
- _S_e_e _A_l_s_o:
-
- backsolve, qr.solve.
-
- _E_x_a_m_p_l_e_s:
-
- hilbert <- function(n) { i <- 1:n; 1/outer(i-1,i,"+") }
- h8 <- hilbert(8); h8
- solve(h8) # gives error: 'singular'
- sh8 <- solve(h8, tol=1e-10)
- round(sh8 %*% h8, 3)
-
-