Learn R Programming

SSBtools (version 1.3.0)

GaussIndependent: Linearly independent rows and columns by Gaussian elimination

Description

The function is written primarily for large sparse matrices

Usage

GaussIndependent(
  x,
  printInc = FALSE,
  tolGauss = (.Machine$double.eps)^(1/2),
  testMaxInt = 0,
  allNumeric = FALSE
)

GaussRank(x, printInc = FALSE)

Arguments

x

A (sparse) matrix

printInc

Printing "..." to console when TRUE

tolGauss

A tolerance parameter for sparse Gaussian elimination and linear dependency. This parameter is used only in cases where integer calculation cannot be used.

testMaxInt

Parameter for testing: The Integer overflow situation will be forced when testMaxInt is exceeded

allNumeric

Parameter for testing: All calculations use numeric algorithm (as integer overflow) when TRUE

Value

List of logical vectors specifying independent rows and columns

Details

GaussRank returns the rank

Examples

Run this code
# NOT RUN {
x <- ModelMatrix(SSBtoolsData("z2"), formula = ~fylke + kostragr * hovedint - 1)

GaussIndependent(x)
GaussRank(x)
GaussRank(t(x))

# }
# NOT RUN {
# For comparison, qr-based rank may not work
rankMatrix(x, method = "qr")

# Dense qr works 
qr(as.matrix(x))$rank
# }

Run the code above in your browser using DataLab