Sample Project
Sample Project
Submitted by:1
Abstract
Multicollinearity is a common challenge in Multiple Linear Regression (MLR) models, often
leading to numerically unstable parameter estimates and reduced predictability. In this study,
we explore various techniques to detect and mitigate multicollinearity within a dataset. We
begin by diagnosing multicollinearity using Variance Inflation Factor (VIF), correlation anal-
ysis, and Eigen System Analysis. A baseline least squares MLR model is fitted to establish
performance benchmarks.
To address multicollinearity, we implement Principal Component Analysis (PCA) and Ridge
Regression. For Ridge Regression, we investigate multiple approaches for selecting the Biasing
Factor, comparing their effectiveness through R2 -score reduction and the variance reduction of
the regression coefficients. Finally, we provide a comparative analysis of the methods in terms
of predictive performance and model stability. Our results highlight the trade-offs involved
in dimensionality reduction and regularization, offering insights into effective model selection
under multicollinearity.
1 Introduction
1.1 Multicollinearity
In the case of Multiple Linear Regression, a major issue is Multicollinearity, which makes the
model unstable in nature. The model is given by:
In the above expression, we can see that β̂ depends on the inverse of the matrix X T X. Let us
define:
C = XT X
1 All individuals marked with * have contributed equally.
1
Now, if this matrix C is non-invertible or singular, then the inverse (X T X)−1 cannot be computed.
The matrix X T X is given by:
n n n
x2k1
P P P
k=1 xk1 xk2 ··· xk1 xkp
n k=1 k=1
n n
x2k2
P P P
xk2 xk1 ··· xk2 xkp
T
X X = k=1 k=1 k=1
.. .. ..
..
n .
. . .
n n
P P P 2
xkp xk1 xkp xk2 ··· xkp
k=1 k=1 k=1
In the presence of multicollinearity, if some rows or columns of X are linear combinations of others,
then det(C) becomes 0 or very close to 0. This causes:
1
→∞
det(C)
leading to unstable calculations when estimating β̂. This makes the model highly sensitive to small
changes in the data, resulting in unreliable predictions.
Essentially, multicollinearity implies that there exists a non-trivial linear relationship among the
regressors. If we have a vector of predictors X = (X1 , X2 , . . . , Xp )T , then there exists a set of
coefficients tj such that:
p
X
tj Xj = 0
j=1
λmax λmax
κ= , κj =
λmin λj
where λj is the j-th eigenvalue of X T X. A condition number greater than 100 is considered
indicative of moderate multicollinearity, and values exceeding 1000 indicate severe multicollinearity.
The Variance Inflation Factor (VIF) for each regressor is defined as:
1
VIFj =
1 − Rj2
where Rj2 is the coefficient of determination obtained from regressing Xj on the remaining predic-
tors. A high Rj2 implies that Xj is well explained by the other variables, resulting in a high VIFj ,
and consequently, a high variance for the estimated β̂j .
To address multicollinearity, one widely accepted approach is Ridge Regression, introduced by
Hoerl and Kennard [HK70]. Ridge Regression stabilizes the estimates by adding a biasing term,
2
but introduces the challenge of selecting an optimal penalty parameter k. Multiple strategies have
been proposed for this purpose, including those by Hoerl and Kennard [HK70], McDonald and
Galarneau [MG75], Lawless and Wang [LW76], among others.
In this study, we systematically analyze multicollinearity in a dataset using VIF, correlation
matrices, and eigen system analysis. We first fit a baseline multiple linear regression model and
then address collinearity using Principal Component Analysis (PCA) and Ridge Regression. Addi-
tionally, we evaluate several strategies for selecting the ridge penalty parameter and compare their
performance using R2 -score and the variance of the estimated coefficients.
2 Handling Multicollinearity
2.1 Ridge Regression
In the presence of multicollinearity, where predictor variables are highly correlated, the variance
of the ordinary least squares (OLS) estimator becomes large, making predictions unstable and
sensitive to small changes in the data. Ridge regression, first introduced by Hoerl and Kennard
[HK70], is a prominent remedy that introduces a small bias to obtain estimators with significantly
reduced variance.
Ridge regression can be naturally derived from the following constrained optimization problem:
⊤
min β − β̂ X ⊤ X β − β̂ subject to β ⊤ β ≤ d2
β
This formulation seeks a vector β that remains close to the OLS estimator β̂ under the geometry
induced by X ⊤ X, while also constraining its Euclidean norm to lie within a ball of radius d.
Constructing the Lagrangian:
β̂R = (X ⊤ X + λI)−1 X ⊤ y.
Thus, ridge regression emerges as the projection of the OLS estimate onto an ℓ2 -ball under the
metric defined by X ⊤ X.
While the OLS estimator is unbiased, its variance can be large in the presence of multicollinearity.
Ridge regression introduces bias to reduce variance, often leading to a lower mean squared error
(MSE). The MSE of the ridge estimator is given by:
3
Figure 1: Sampling distribution of (a) nnbiased and (b) biased estimators of β [MPV12]
where λj are the eigenvalues of X ⊤ X. For the ridge estimator, the MSE becomes:
p
X λj
MSE(β̂R ) = σ 2 + λ2 β̂ ⊤ (X ⊤ X + λI)−2 β̂.
j=1
(λj + λ)2
This expression highlights the bias-variance trade-off: the first term, corresponding to variance,
decreases with increasing λ, while the second term, the squared bias, increases with λ. The optimal
choice of λ thus balances these two effects to minimize the total MSE.
Furthermore, the residual sum of squares for ridge regression can be decomposed as:
where the second term quantifies the additional error due to regularization. This further reinforces
the interpretation of ridge regression as a compromise between data fidelity and model complexity.
α̂PC = B α̂
where the first p − s components are the non-zero coefficients, and the remaining s components
are set to zero. This effectively removes the influence of components associated with near-zero
eigenvalues.
4
The regression model prediction is given by:
ŷ = X β̂PC
This equation shows how the modified regression coefficients β̂PC are used to predict the response
variable.
The covariance matrix of the regression coefficients is:
Var(β̂) = σ 2 T ⊤ T
where T is the matrix of eigenvectors, and the variance of each regression coefficient is inversely
proportional to the corresponding eigenvalue. Therefore, small eigenvalues increase the variance
of the corresponding coefficients, which is why removing these components helps in improving the
precision of the regression estimates.
3 Methodology
3.1 Overview of Approach
The primary objective of this study is to analyze and mitigate the effects of multicollinearity in
linear regression models. We begin by diagnosing multicollinearity using three diagnostic tools:
the Variance Inflation Factor (VIF), correlation heatmap, and eigensystem analysis
of the matrix X T X. Based on the severity of multicollinearity observed, we then apply Ridge
Regression and Principal Component Analysis (PCA) to stabilize coefficient estimates and
reduce redundancy among predictors. Finally, we evaluate and compare the models based on their
performance and coefficient stability.
β̂R = (X T X + λI)−1 X T y
Unlike traditional approaches that use cross-validation to determine the optimal penalty parameter
λ, we evaluated a range of λ values and observed their impact on coefficient variance and model
performance. This direct comparison allows us to study the trade-off between bias and variance
induced by regularization.
5
3.5 Principal Component Regression
Principal Component Analysis (PCA) was used to transform the predictor matrix into a set of
orthogonal components derived from the eigenvectors of X T X. Components associated with small
eigenvalues—typically indicative of redundancy and instability—were discarded.
Regression was then performed using the retained principal components, and predictions were
mapped back to the original feature space using the corresponding transformations.
4 Experimental Evaluation
4.1 Dataset Description
The dataset consists of atmospheric and chemical sensor measurements aimed at predicting Ab-
solute Humidity (AH). The predictor variables include several chemical gas concentrations,
sensor responses, and a meteorological variable. A summary of the key features, their means, and
variances before standardization is provided below:
6
• Chemical gas concentrations: CO(GT), NOx(GT), NO2(GT), C6H6(GT), NMHC(GT)
• Sensor responses: PT08.S1(CO), PT08.S2(NMHC), PT08.S3(NOx), PT08.S4(NO2), PT08.S5(O3)
• Meteorological variable: T (Temperature)
A distributional analysis was carried out for all features, including the target. Several predictors
exhibited skewed distributions. These observations informed our choice to standardize all predictor
variables prior to modeling.
The dataset did not contain any categorical variables, and no missing value imputation was nec-
essary. All predictors were scaled to zero mean and unit variance to ensure compatibility with the
assumptions of both Ridge Regression and Principal Component Analysis.
7
4.2 Multicollinearity Diagnosis
To ensure the robustness and interpretability of our regression model, it is crucial to assess multi-
collinearity among the predictor variables. Multicollinearity occurs when two or more predictors
are highly correlated, leading to unstable coefficient estimates and inflated standard errors. We
employed three complementary methods to detect multicollinearity: Variance Inflation Factor
(VIF), correlation matrix inspection, and condition index analysis.
Significantly high VIF values are observed for PT08.S2(NMHC), C6H6(GT), and PT08.S4(NO2),
indicating strong linear dependencies with other predictors. These inflated values suggest poten-
tial instability in the model’s coefficient estimates if these features are retained without proper
regularization or dimensionality reduction.
8
Figure 3: Correlation Heatmap
Condition indices greater than 30 generally suggest moderate to strong multicollinearity, while
values above 100 indicate serious issues. Here, multiple features (e.g., NO2(GT), PT08.S4(NO2),
PT08.S5(O3)) have indices that vastly exceed this limit, confirming the presence of severe multi-
collinearity.
y = β0 + β1 x 1 + β 2 x 2 + · · · + βp x p + ϵ
9
Where:
• y is the dependent variable.
• β0 is the intercept.
• β1 , β2 , . . . , βp are the coefficients of the independent variables x1 , x2 , . . . , xp .
• ϵ is the error term.
For this model, we performed Ordinary Least Squares (OLS) regression, which estimates the coef-
ficients that minimize the sum of squared residuals. The estimated coefficients for the model are
as follows:
Feature Beta
CO(GT) 0.19496052
PT08.S1(CO) 0.12548033
NMHC(GT) 0.09499804
C6H6(GT) −0.86397065
PT08.S2(NMHC) −2.31300323
NOx(GT) −0.41590781
PT08.S3(NOx) −0.56178816
NO2(GT) 0.07160975
PT08.S4(NO2) 2.78262635
PT08.S5(O3) 0.15278455
T 0.2417588
Source SS DF MS F
Regression 673.6550 10 67.3655 360.8273
Residual 152.3450 816 0.1867
Total 826.0000 826
Where:
• SS is the sum of squares,
• DF is the degrees of freedom,
• MS is the mean square (SS/DF),
• F is the F-statistic for testing the overall significance of the model.
The high F-statistic (360.8273) and the small p-value associated with it suggest that the regression
model is statistically significant.
Frobenius Norm
The Frobenius norm of the residual matrix is a measure of the magnitude of the residuals. It is
calculated as:
10
sX
∥E∥F = e2ij
i,j
Where eij are the elements of the residual matrix. The Frobenius norm for this model is:
0.38502272529883347
This value suggests the residuals are of relatively small magnitude, indicating a good fit of the
model to the data.
Trace of the Variance-Covariance Matrix
The trace of the variance-covariance matrix of the estimated coefficients provides a summary of
the variance of the model parameters. It is given by the sum of the diagonal elements of the
variance-covariance matrix, which represent the variances of each coefficient. The trace for this
model is:
0.5608176808744026
This value suggests that the overall variability in the coefficients is low, contributing to a stable
model with relatively low variance.
Feature Beta
CO(GT) 0.1785706
PT08.S1(CO) 0.13520787
NMHC(GT) 0.09788709
C6H6(GT) −0.93203297
PT08.S2(NMHC) −2.12722245
NOx(GT) −0.41855228
PT08.S3(NOx) −0.5293408
NO2(GT) 0.04385014
PT08.S4(NO2) 2.71683455
PT08.S5(O3) 0.16474356
T 0.23275705
11
4.4.1 Model Performance Metrics
R² Score
For the Ridge regression model, the R2 score is 0.8151, indicating that approximately 81.51% of
the variance in the dependent variable is explained by the model. This is nearly identical to the
R2 score from the Linear Regression model, reflecting a minor reduction in explanatory power due
to the regularization.
Frobenius Norm
The Frobenius norm of the residual matrix for the Ridge regression model is:
0.2407633635118524
This is smaller than the Frobenius norm in the MLR model, indicating a better fit with smaller
residuals.
Trace of the Variance-Covariance Matrix
The trace of the variance-covariance matrix for the Ridge regression model is:
0.4021659091544845
This value is lower compared to the MLR model, suggesting reduced variability in the estimated
coefficients due to regularization.
12
Feature βpc
CO(GT) 0.1786
PT08.S1(CO) 0.1352
NMHC(GT) 0.0979
C6H6(GT) −0.9320
PT08.S2(NMHC) −2.1272
NOx(GT) −0.4186
PT08.S3(NOx) −0.5293
NO2(GT) 0.0439
PT08.S4(NO2) 2.7168
PT08.S5(O3) 0.1647
T 0.2328
Component PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8 PC9 PC10
Row 0 -0.603 0.619 -0.618 -0.410 0.472 0.142 -0.174 0.163 -0.113 0.036 -0.106
Row 1 0.850 0.421 -0.228 -0.335 0.555 0.087 -0.536 0.170 -0.238 -0.123 -0.020
Row 2 0.342 0.817 -0.828 -0.653 0.317 0.205 -0.557 0.085 -0.219 -0.104 0.226
p · σ2
λ=
β⊤ β
where:
• p is the number of predictors,
• β and σ 2 are derived from the ordinary least squares (OLS) solution.
13
This formula balances the trade-off between variance and bias using the ratio of noise variance to
signal strength. It offers a closed-form estimation of λ, making it computationally efficient.
Empirical Results:
• Biasing Factor (λ): 0.7589
• R2 Score: 0.8151
• Frobenius Norm (∥β λ ∥F ): 0.2408
• Trace of Dispersion Matrix: 0.4022
p
X 1
β⊤ ⊤
λ βλ = β β − σ
2
λ
j=1 j
where:
• β λ is the ridge estimator,
• λj are the eigenvalues of X⊤ X,
• σ 2 is the OLS estimate of noise variance.
As this equation does not permit a closed-form solution for λ, we solve it numerically using the
Newton-Raphson method.
Let
p
X 1
f (λ) = β ⊤
λ βλ −
β ⊤ β − σ 2
λ
j=1 j
Empirical Results:
• Biasing Factor (λ): 0.3617
• R2 Score: 0.8154
• Frobenius Norm: 0.3024
• Trace of Dispersion Matrix: 0.4712
14
5.3 Comparison and Insights
Metric Hoerl et al. McDonald & Galarneau
Biasing Factor (λ) 0.7589 0.3617
R2 Score 0.8151 0.8154
Frobenius Norm 0.2408 0.3024
Trace of Dispersion Matrix 0.4022 0.4712
Both methods provide comparable R2 scores, suggesting similar predictive power. However, Hoerl
et al.’s method results in a smaller trace and Frobenius norm, indicating potentially better model
stability and smaller deviation from the OLS coefficients. McDonald and Galarneau’s method
yields a smaller λ, leading to less shrinkage and coefficients closer to the OLS solution, albeit with
slightly higher variance.
These findings highlight the trade-offs between bias and variance inherent in ridge regression and
reinforce the importance of context-specific tuning when selecting λ.
6 Results
To evaluate the effectiveness of ridge regression using analytically chosen biasing parameters, we
compare the performance of the two proposed methods—Hoerl et al. and McDonald & Galarneau
with the baseline Ordinary Least Squares (OLS) solution. The comparison is made across three
key metrics: the coefficient of determination (R2 score), the Frobenius norm between ridge and
OLS coefficients, and the trace of the dispersion (covariance) matrix of the ridge estimator.
Quantitative Comparison
Method λ R2 Score Frobenius Norm Trace of Dispersion Matrix
OLS 0 0.8156 0.3850 0.5608
Ridge (Hoerl et al.) 0.7589 0.8151 0.2408 0.4022
Ridge (McDonald & Galarneau) 0.3617 0.8154 0.3024 0.4712
Table 6: Comparison of OLS and Ridge Regression using analytically selected λ values
From the results above, it is evident that both ridge regression methods achieve substantial variance
reduction at the cost of a marginal drop in R2 performance. The Frobenius norm between ridge and
OLS coefficients is lowest for the Hoerl method, indicating a stronger shrinkage effect. However, the
McDonald & Galarneau method achieves a slightly better R2 score while still offering significant
variance control compared to OLS.
15
Figure 5: Geometric Interpretation of Ridge Regression
These findings underscore the core benefit of ridge regression: reducing estimator variance and
improving model stability without sacrificing much predictive accuracy.
7 Conclusion
In this study, we investigated the challenges posed by multicollinearity in multiple linear regres-
sion and evaluated two popular methods—Ridge Regression and Principal Component Analysis
(PCA)—to mitigate its effects. Our analysis revealed that multicollinearity was indeed severe in
the dataset, as indicated by extremely high VIF values, strong pairwise correlations, and large
condition indices.
Ridge Regression proved effective in stabilizing coefficient estimates by introducing regularization,
leading to a significant reduction in coefficient variance without compromising model accuracy.
The analytical methods used to select the biasing parameter λ—namely, those proposed by Hoerl
et al. and McDonald & Galarneau—offered a principled approach to tuning and demonstrated
distinct trade-offs between bias and variance.
Principal Component Regression, on the other hand, addressed multicollinearity by transforming
the predictors into orthogonal components. Although its R2 score was slightly lower than that
of the Ridge models, PCR provided comparable coefficient stability and eliminated redundant
information effectively.
Overall, both Ridge Regression and PCA emerged as viable strategies for handling multicollinear-
ity, each with its strengths. Ridge Regression is particularly useful when interpretability of original
features is desired, whereas PCA is better suited for scenarios requiring dimension reduction and
noise elimination. Our findings highlight the importance of diagnosing multicollinearity and adopt-
ing tailored solutions to enhance model robustness and reliability.
16
References
[HK70] Arthur E. Hoerl and Robert W. Kennard. Ridge regression: Biased estimation for
nonorthogonal problems. Technometrics, 12(1):55–67, 1970.
[LW76] J. F. Lawless and P. Wang. A simulation study of ridge and principal components
regression. Communications in Statistics - Simulation and Computation, 5(4):307–323,
1976.
[MG75] G. C. McDonald and D. I. Galarneau. A monte carlo evaluation of some ridge-type
estimators. Journal of the American Statistical Association, 70(350):407–416, 1975.
[MPV12] Douglas C. Montgomery, Elizabeth A. Peck, and G. Geoffrey Vining. Introduction to
Linear Regression Analysis. John Wiley & Sons, Hoboken, New Jersey, 5th edition, 2012.
17