fixDependence              package:mgcv              R Documentation

_D_e_t_e_c_t _l_i_n_e_a_r _d_e_p_e_n_d_e_n_c_i_e_s _o_f _o_n_e _m_a_t_r_i_x _o_n _a_n_o_t_h_e_r

_D_e_s_c_r_i_p_t_i_o_n:

     Identifies columns of a matrix 'X2' which are linearly dependent
     on columns of a matrix 'X1'. Primarily of use in setting up 
     identifiability constraints for nested GAMs.

_U_s_a_g_e:

     fixDependence(X1,X2,tol=.Machine$double.eps^.5)

_A_r_g_u_m_e_n_t_s:

      X1: A matrix.

      X2: A matrix, the columns of which may be partially linearly
          dependent on the columns of 'X1'.

     tol: The tolernce to use when assessing linear dependence.

_D_e_t_a_i_l_s:

     The algorithm uses a simple approach based on QR decomposition:
     see code for details.

_V_a_l_u_e:

     An array of the columns of 'X2' which are linearly dependent on
     columns of 'X1'. 'NULL' if the two matrices are independent.

_A_u_t_h_o_r(_s):

     Simon N. Wood simon.wood@r-project.org

_E_x_a_m_p_l_e_s:

     n<-20;c1<-4;c2<-7
     X1<-matrix(runif(n*c1),n,c1)
     X2<-matrix(runif(n*c2),n,c2)
     X2[,3]<-X1[,2]+X2[,4]*.1
     X2[,5]<-X1[,1]*.2+X1[,2]*.04
     fixDependence(X1,X2)

