Principal Component Regression
Original Post
Principal Component Regression (PCR) is a variation of multiple linear regression. This method utilizes the characteristics of Principal Component Analysis (PCA) to address the issue of multicollinearity in multiple linear regression.
The core algorithm involves combining multiple features into principal components (PCs) and performing regression analysis. The PCs used here possess two major characteristics:
1. PC vectors are orthogonal to each other.
→ The inner product of PCs yields zero, indicating that PCs are linearly independent.
2. PCs are linear combinations of features.
By using these characteristics, when performing regression analysis with PCs, the dependency between PCs is eliminated. Furthermore, considering each PC used as a feature combination allows for the estimation of coefficients. For example,
$$ PC_1=\alpha_{11}x_1+\alpha_{12}x_2 +... $$
$$ PC_2=\alpha_{21}x_1+\alpha_{22}x_2 +... $$
$$ \hat{y}_i=\beta_0+\beta_1PC_1+\beta_2PC_2 $$
$$ \hat{y}_i=\beta_0+\beta_1(\alpha{11}+\alpha_{21})x_1+\beta_2(\alpha_{12}+\alpha_{22})x_2 +... $$
Then, how do we determine the number of PCs to use? It can be done using a general validation approach. For example, by employing the LOOCV (leave-one-out cross validation), we can use each sample as test sets while determining the number of PCs that minimizes the root mean square error (RMSEP, $\sqrt{\sum_i{{\hat{y_i}-y_i}\over{n}}}$) between the estimated values from the model and the actual values.
By conducting regression analysis in this manner, the issue of multicollinearity is effectively addressed. However, the resulting coefficients cannot be interpreted as feature importance concerning the dependent variable. The reason is that these features and coefficients are used to create PCs, so they should be interpreted as the features that contribute the most to maximizing the data variance. This is the major drawback of PCR: it does not consider the dependent variable directly.
In this context, Partial Least Squares Regression (PLSR) comes into play. Similar to PCR, this method utilizes linear combinations of features to address the issue of multicollinearity. However, PLSR takes into account the information from the labels (dependent variable) during coefficient estimation.
By the way, PCR operates very similarly to Ridge regression. However, I cannot find the core equations about this… 😟
정리
이름에서도 알 수 있듯이 principal component analysis (PCA) 와 관련있는 방법이다. 먼저 PCA는 차원축소 그리고 직교성이라는 두가지 주요한 키워드가 있다. 이 방법은 PCA의 직교성에 보다 방점이 찍힌다.
당장 생각했을 때 PCA 와 regression을 같이 사용 하면, principal component regression (PCR)?! 맞는말이고, 상상하기도 그렇게 어렵지 않다. 많은 feature가 있을 때, principal component (PC) 로 차원을 축소시켜 regression에서의 independent variable 수를 줄이는 것이 아닌가!
그렇다면 당장 생각하기에, 차원의 저주를 어떻게든 풀어내려고 이런 시도를 하는 것인가 생각 될 수 있다. 뭐 이렇게 사용해도 해석력을 제외하고는 큰 문제는 없을 것 같다. 하지만, PCR의 주된 목적은 바로 다중 공선성을 다루기 위함에 있다. 여기서는 PC vector는 각각 직교한다는 사실과, 각 PC는 사실 feature들의 선형결합이라는 사실을 이용한다.
아래 본문의 식을 참고하면 명확해진다. 애초에 직교한다는 성질을 지닌 다른 벡터들은, 회귀식의 계수로 표현되는 가중치와 함께 더해진다. 그리고 그 또한 역시 기존의 feature들의 선형조합을 통해 만들어진 것임으로, 결론적으로 다중공선성 문제는 해결 될 수 있다. 아래의 그림과 수식을 확인하면 몇개의 PC를 선택해야하는지, 그리고 어떻게 선형조합이 전개되는지 알 수 있다.
$$ PC_1=\alpha_{11}x_1+\alpha_{12}x_2 +... $$
$$ PC_2=\alpha_{21}x_1+\alpha_{22}x_2 +... $$
$$ \hat{y}_i=\beta_0+\beta_1PC_1+\beta_2PC_2 $$
$$ \hat{y}_i=\beta_0+\beta_1(\alpha{11}+\alpha_{21})x_1+\beta_2(\alpha_{12}+\alpha_{22})x_2 +... $$
하지만, 결과적으로 얻어진 계수들은 dependent variable과 관련된 feature의 중요도로 함부로 해석이 불가능 하다. 그 이유는 이런 feature와 계수들이 PC를 생성하는데 사용되기 때문에, 이들은 데이터의 분산을 최대화하는데 가장 기여하는 특성으로 해석되어야한다.
이 맥락에서 Partial Least Squared Regression (PLSR) 이 등장하게 된다. 선형조합이라는 측면에서 PCR과 유사하지만, 이 방법은 independent variable로 부터의 정보를 고려한다. 이 관점에서 PCR은 능형회귀와 매우 유사하게 작동한다. 하지만, 이에관한 핵심이 되는 방정식을 찾을 수 없었다... (찾으면 업데이트 ㄱㄱ)
Reference
Book, “Element of Statistical Learning”
https://www.statology.org/principal-components-regression-in-r/
Principal Components Regression in R (Step-by-Step)
This tutorial explains how to perform principal components regression in R, including a step-by-step example.
www.statology.org