Ensure that a regression specification is full rank

ensureSpecFullRank(spec_mat, col_names)

Arguments

spec_mat

An M by N regression specification matrix, where M > N.

col_names

Column names of the regression specification.

Value

A full-rank specification matrix. If the input is full-rank, returns the input unmodified. Otherwise, returns a matrix with a subset of the columns from the input.

Details

Verifies if a regression specification is full-rank. If the input is rank-deficient, identifies and drops columns so that the remaining matrix is full-rank.