fixDependence.RdIdentifies 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,rank.def=0,strict=FALSE)A matrix.
A matrix, the columns of which may be partially linearly
dependent on the columns of X1.
The tolerance to use when assessing linear dependence.
If the degree of rank deficiency in X2, given X1,
is known, then it can be supplied here, and tol is then ignored.
Unused unless positive and not greater than the number of columns in X2.
if TRUE then only columns individually dependent on X1 are detected,
if FALSE then enough columns to make the reduced X2 full rank and
independent of X1 are detected.
The algorithm uses a simple approach based on QR decomposition: see Wood (2017, section 5.6.3) for details.
A vector of the columns of X2 which are linearly dependent on
columns of X1 (or which need to be deleted to acheive independence and full rank
if strict==FALSE). NULL if the two matrices are independent.
Wood S.N. (2017) Generalized Additive Models: An Introduction with R (2nd edition). Chapman and Hall/CRC Press.