View source: R/GaussIndependent.R
GaussIndependent | R Documentation |
The function is written primarily for large sparse matrices with integers and even more correctly it is primarily written for dummy matrices (0s and 1s in input matrix).
GaussIndependent(
x,
printInc = FALSE,
tolGauss = (.Machine$double.eps)^(1/2),
testMaxInt = 0,
allNumeric = FALSE
)
GaussRank(x, printInc = FALSE)
x |
A (sparse) matrix |
printInc |
Printing "..." to console when |
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 |
GaussRank returns the rank
List of logical vectors specifying independent rows and columns
The main algorithm is based on integers and exact calculations. When integers cannot be used (because of input or overflow), the algorithm switches.
With printInc = TRUE
as a parameter, .....
change to -----
when switching to numeric algorithm.
With numeric algorithm, a kind of tolerance for linear dependency is included.
This tolerance is designed having in mind that the input matrix is a dummy matrix.
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
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.