0
$\begingroup$

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?

$\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$
    – Momo
    Commented Jun 21, 2014 at 18:22

1 Answer 1

3
$\begingroup$

Yes, your model is still linear in the parameters ($a$ and $b$), so linear regression will still do what you want.

$\endgroup$
2
  • $\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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.