home *** CD-ROM | disk | FTP | other *** search
-
- _T_h_e _Q_R _D_e_c_o_m_p_o_s_i_t_i_o_n _o_f _a _M_a_t_r_i_x
-
- qr(x, tol=1e-07)
- qr.coef(qr, y)
- qr.qy(qr, y)
- qr.qty(qr, y)
- qr.resid(qr, y)
- qr.fitted(qr, y, k=qr$rank)
- qr.solve(a, b, tol=1e-7)
- is.qr(x)
- as.qr(x)
-
- _A_r_g_u_m_e_n_t_s:
-
- x : a matrix whose QR decomposition is to be com-
- puted.
-
- tol : the tolerance for detecting linear dependen-
- cies in the columns of x.
-
- qr : a QR decomposition of the type computed by
- qr.
-
- y : a vector or matrix of right-hand sides of
- equations.
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- qr provides an interface to the techniques used in the
- LINPACK routine DQRDC. The QR decomposition plays an
- important role in many statistical techniques. In par-
- ticular it can be used to solve the equation Ax EQUALS
- b for given matrix A, and vector b. It is useful for
- computing regression coefficients and in applying the
- Newton-Raphson algorithm.
-
- The functions qr.coef, qr.qy, qr.qty, qr.resid, and
- qr.fitted use a computed QR decomposition to compute
- various quantities of interest.
-
- qr.solve solves systems of equations via the QR decom-
- position.
-
- is.qr returns TRUE if x is a list with a component
- named qr and FALSE otherwise.
-
- It is not possible to coerce objects to mode qr.
- Objects either are qr decompositions or they are not.
- Coercion is not possible.
-
- _V_a_l_u_e_s:
-
- The QR decomposition of the matrix as computed by LIN-
- PACK. The components in the returned value correspond
- directly to the values returned by DQRDC.
-
- qr : a matrix with the same dimensions as x. The upper
- triangle contains the R of the decomposition and
- the lower triangle contains information on the Q
- of the decomposition (stored in compact form).
-
- qraux : a vector of length ncol(x) which contains addi-
- tional information on Q.
-
- rank : the rank of x as computed by the decomposition.
-
- pivot : information on the pivoting strategy used during
- the decomposition.
-
- _R_e_f_e_r_e_n_c_e_s:
-
- Dongarra, J. J., J. R. Bunch, C. B. Moler and G. W.
- Stewart (1978). LINPACK Users Guide, SIAM Publica-
- tions, Philadelphia.
-
- _S_e_e _A_l_s_o:
-
- solve.qr, lsfit.
-
- _E_x_a_m_p_l_e_s:
-
- hilbert <- function(n) { i <- 1:n; 1/outer(i-1,i,"+") }
- h9 <- hilbert(9); h9
- qr(h9)$rank ##--> only 7
- qrh9 <- qr(h9, tol=1e-10)
- qrh9$rank ##--> 9
- ##-- Solve linear equation system H %*% x = y :
- y <- 1:9/10
- x <- qr.solve(h9, y, tol = 1e-10) ## or equivalently :
- x <- qr.coef(qrh9, y) ##-- is == but much better than
- ##-- solve(h9) %*% y
- h9 %*% x ## = y
-
-