home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / solve < prev    next >
Encoding:
Text File  |  1997-04-23  |  1014 b   |  36 lines

  1.     
  2.     _s_o_l_v_e _a _s_y_s_t_e_m _o_f _e_q_u_a_t_i_o_n_s
  3.     
  4.          solve(a, b, tol = 1e-7)
  5.     
  6.     _A_r_g_u_m_e_n_t_s:
  7.     
  8.                a : a numeric matrix containing the coefficients
  9.                    of the linear system.
  10.     
  11.                b : a numeric vector or matrix giving the right-
  12.                    hand side(s) of the linear system.  If omit-
  13.                    ted, b is taken to be an identity matrix and
  14.                    solve will return the inverse of a.
  15.     
  16.              tol : the tolerance for detecting linear dependen-
  17.                    cies in the columns of a.
  18.     
  19.     _D_e_s_c_r_i_p_t_i_o_n:
  20.     
  21.          This function solves the equation a %*% x = b for b,
  22.          where b can be either a vector or a matrix.
  23.     
  24.     _S_e_e _A_l_s_o:
  25.     
  26.          backsolve, qr.solve.
  27.     
  28.     _E_x_a_m_p_l_e_s:
  29.     
  30.          hilbert <- function(n) { i <- 1:n; 1/outer(i-1,i,"+") }
  31.          h8 <- hilbert(8); h8
  32.          solve(h8) # gives error: 'singular'
  33.          sh8 <- solve(h8, tol=1e-10)
  34.          round(sh8 %*% h8, 3)
  35.     
  36.