I want to calculate the Coefficient of Multiple Correlation $R^2$ for a multiple linear regression with polynomial features of degree >= 2 (with interaction terms).
Let's say I want to obtain the regression polynomial of degree 3 of the the relation $y\left(x_1, x_2, x_3\right)$. Using f.i. Elastic Net regression, the result looks like:
$$y = c_0 + c_1 x_1 + c_2 x_2 + c_3 x_3 + c_4 x_1^3 + c_5 x_1^2 x_3 + c_6 x_2 x_3$$
Several coefficients have alread been set to 0, thus only a selected set of variables remains.
Now I want to calculate the Coefficient of Multiple Correlation $R^2$, which is defined as follows: $$R^2 = c_{y,x}^T R_{x,x}^{-1} c_{y,x}$$ with $c_{y,x} = \mathbb{Corr}(\mathbf{y},\mathbf{x}_i)$ and $R_{x,x} = \mathbb{Corr}(\mathbf{x}_i,\mathbf{x}_j)$:
$$\boldsymbol{c}_{\mathbf{y},\mathbf{x}} = \begin{bmatrix} r_1 \\ r_2 \\ \vdots \\ r_m \end{bmatrix} \quad \quad \quad \boldsymbol{R}_{\mathbf{x},\mathbf{x}} = \begin{bmatrix} r_{1,1} & r_{1,2} & \cdots & r_{1,m} \\ r_{2,1} & r_{2,2} & \cdots & r_{2,m} \\ \vdots & \vdots & \ddots & \vdots \\ r_{m,1} & r_{m,2} & \cdots & r_{m,m} \\ \end{bmatrix}$$ Math representation cited from [1].
Question:
To calculate the Coefficient of Multiple Correlation $R^2$ in my case of a polynomial regression of degree 3 with interaction terms, do I have to take into account the correlation of the input regressors $x_1,\, x_2,\, x_3$ or of all terms of the resulting polynomial $x_1,\, x_2,\, x_3,\, x_1^3,\, x_1^2x_3,\, x_2x_3$?
Only of the input regressors would mean for $c_{y,x}$: $$\boldsymbol{c}_{\mathbf{y},\mathbf{x}} = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix}$$ Whereas of all terms would mean: $$\boldsymbol{c}_{\mathbf{y},\mathbf{x}} = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_1^3 \\ x_1^2x_3 \\ x_2x_3 \end{bmatrix}$$ Equivalently for $R_{x,x}$.