Skip to content

The repository has the codes to identify co-linear (linearly dependent columns in a data) using linear algebra techniques.

License

Notifications You must be signed in to change notification settings

r2rahul/dimensionreduction

Repository files navigation

Finding Redundant Variables in the Data

The repository has the codes to identify co-linear (linearly dependent columns in a data) using linear algebra techniques.

Here three methods are implemented:

  • Symbolic Method using Sympy.
  • Numerical method using SVD method.
  • Implementation of MATLAB null(x, 'r').

For numerical technique tol can be adjusted to set threshold below which variables can be removed. To be strict choose higher value of tol.

R Version of the Code

Added Rcpp version of Reduced Row Echelon form (rref) which also return the pivot columns similar to MATLAB implementation. To compile the code

Rcpp::sourceCpp("src/rref_pivots.cpp")
A <- matrix(c(2, 4, 1, 3, -1, -2, 1,
0, 0, 0, 4, 4, 3, 6, 2, 5), nrow = 4,
byrow = TRUE)
rref_out <- rref_with_pivots(A)
print(rref_out$pivots)

About

The repository has the codes to identify co-linear (linearly dependent columns in a data) using linear algebra techniques.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published