fixDependence {mgcv} | R Documentation |
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.
fixDependence(X1,X2,tol=.Machine$double.eps^.5)
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. |
The algorithm uses a simple approach based on QR decomposition: see code for details.
An array of the columns of X2
which are linearly dependent on
columns of X1
. NULL
if the two matrices are independent.
Simon N. Wood simon.wood@r-project.org
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)