Solved – Full-Rank design matrix from overdetermined linear model

least squareslinear model

I'm trying to create a full-rank design matrix X for a randomized block design model starting from something like the example from page 3/8 of this paper (Wayback Machine) here.

It's been suggested that I can go about this by eliminating one of each of the columns for treatment (column 5) and block (column 8) as shown in the example on the page marked 45 in this paper.

I'm not sure how this results in a full-rank design matrix though, for a 12×8 matrix wouldn't making it 12×6 mean that by definition there are still linear dependencies?

My understanding of the definition of a full-rank matrix would be that there are no linear dependencies, which would require a matrix to be square among other criteria. Perhaps this is a misconception on my part?

The goal is to end up with an invertible matrix from $X^T X$ which I can use to determine the least squares, I'm not sure if that's relevant to the issue.

Best Answer

Let's start from your goal (which hopefully I deduced correctly):
You are assuming a linear model is appropriate for your task. You decided to use the linear least-squares cost function, and so your goal is to find the weights and bias such that the cost is minimal.

In this blog post, Eli Bendersky showed how to derive a closed-form solution to this problem: $$\theta=\left(X^{T}X\right)^{-1}X^{T}y$$ (while $\theta$ is the vector of weights and bias, and $y$ is a vector of the given responses to the feature vectors (rows) in $X$.)

Of course, this solution makes sense only if $X^T X$ is invertible.
It turns out that $X^T X$ is invertible iff $X$ is full column rank. (See here for a short proof.)

Thus, in order to use the aforementioned closed-form solution, you have to make sure your matrix is full column rank.
According to the definition of "full rank" in wikipedia:

  • If a matrix has more rows than columns, then it is full rank iff it is full column rank.
  • Otherwise (the number of columns is greater or equal to the number of rows), it is full rank iff it is full row rank.

(If the definition hadn't allowed for linearly dependent rows/columns, then every non-square matrix would have been rank deficient (i.e. non-full-rank), which would have made the definition useless for such matrices.)

Finally, how to convert $X$ into a full column rank matrix?
As explained here, there is a straight-forward way:

  • Calculate the rank of the matrix.
  • If the matrix is not full rank, then for each of column:
    • Calculate the rank of the matrix without this column.
    • If the rank is the same with and without the column, remove the column from the matrix. (The unchanged rank reveals that the column is a linear combination of the other columns, i.e. it is redundant.)
Related Question