In https://www.statsmodels.org/0.8.0/examples/notebooks/generated/ols.html, if you scroll down to the section "Multicollinearity" (bolded), it shows that the condition number of $X$ is $4.86e+09$. Then right below that, it says
Condition number One way to assess multicollinearity is to compute the condition number. Values over 20 are worrisome (see Greene 4.9). The first step is to normalize the independent variables to have unit length
and then they compute another condition number using
norm_x = X.values
for i, name in enumerate(X):
if name == "const":
continue
norm_x[:,i] = X[name]/np.linalg.norm(X[name])
norm_xtx = np.dot(norm_x.T,norm_x)
eigs = np.linalg.eigvals(norm_xtx)
condition_number = np.sqrt(eigs.max() / eigs.min())
print(condition_number)
and the result comes out to be 56240.8714071
.
I'm confused about several things here.
(1) Are we more interested in the condition number of $X$ or $X^TX$ when assessing the conditioning of the system for OLS? The linear system of equations is $X \beta = y$, but the normal equations are $X^TX\beta = X^Ty$, which is also a linear system of equations. I'm assuming this depends on the method since some methods for solving OLS don't even form the normal equations. I think statsmodels in Python uses SVD, which just performs the decomposition for $X$, so what's the point of computing the condition number for a normalized version of $X^TX$ here?
(2) Why are they normalizing the independent variables before computing the condition number?