Which regression algorithm do I need to use to fit the coefficients of $f(x_1, x_2) = a + b x_1\log x_2$? Will linear regression with an independent variable $x_1 \log x_2$ work?
$\begingroup$
$\endgroup$
1
-
$\begingroup$ Note that this is not a statistical model. It misses a stochastic component, or at least it is not clear (to me) what the component is. What error structure do you assume/suspect? Is the error structure additive, homoscedastic, uncorrelated errors with means zero on the scale of $x_1\log x_2$? $\endgroup$– MomoCommented Jun 21, 2014 at 18:22
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
2
Yes, your model is still linear in the parameters ($a$ and $b$), so linear regression will still do what you want.
-
$\begingroup$ Thank you. I try to fit the function $f(x_1, x_2) = x_1 + x_1 \log x_2 + x_2 \log x_2$ (which I believe is the exact analytical form of the dependency I'm exploring), and I have the dataset in the form $[x_1, x_2, f]$. The linear function $f(x_1) = a + b x_1$ seems to fit pretty well, but I can see that it goes slightly exceeds the linear dependency. When I try to fit the full function, the quality becomes slightly less (MSE is higher a little), and the coefficients go crazy (like, 1e+7, -8e+7). $\endgroup$ Commented Jun 21, 2014 at 20:24
-
$\begingroup$ I wonder if it is so because there's no correlation between x1 and x2, or there are some linearity assumptions in the optimization mechanism (I use Python's sklearn.linear_model) that fail in my case? $\endgroup$ Commented Jun 21, 2014 at 20:27