Multivariable Polynomial Regression

634 Views Asked by At

I want to regress my data into a function as: $a0+a_1K+a_2K^2+a_3T+a_4T^2+a_5KT$. But setting $\mathbf{a}=(\mathbf{K^\top K})^{-1} \mathbf{K^\top Y}$ does not work, I think the reason why is since the K and T elements of the matrix $\mathbf{K}$ are linearly dependent. Is there a way/ways to approximate the aforementioned function into my data?

2

There are 2 best solutions below

2
On BEST ANSWER

From your comment, it looks like $T = \alpha K$, i.e., you have a multicolinearity in your data. Hence, you don't need both $K$ and $T$ - you should get rid of one of them.

0
On

If your $\boldsymbol{K}$ has the following structure it should work.

  • Column 1: Only $1$ as entries.
  • Column 2: $K$ as values
  • Column 3: $K^2$ as values
  • Column 4: $T$ as values
  • Column 5: $T^2$ as values
  • Column 6: $KT$ as values

Calculate the correlation matrix of your values. If you see very high correlations. You should remove one of the corresponding variables.