0

I saw Excel use $y=ax^{b}$ and $ y= ae^{bx} $, why not use $y=ax^{b} + c$ and $ y= ae^{bx} + c $,aren't the latter should be more appropriate?

If the former is ok, then why use $y = ax + b$ instead of $ y = ax $ ?

Is it only because $y=ax^{b}$ and $ y= ae^{bx} $ are easier to transform and calculate and the constant $c$ can in some ways be ignored in these two functions?

Rick
  • 103
  • 4
  • Please don't delete and re-post almost the same questions. You should rather edit your previous question to clarify it. Does this help: https://stats.stackexchange.com/questions/7948/when-is-it-ok-to-remove-the-intercept-in-a-linear-regression-model ? – Tim Jan 02 '19 at 13:36
  • @Tim That helps. It seems that the textbook and Excel ignore the intercept merely for simplicity. Btw, can you give me some advice on regression model $y=axlnx + c$ or for simplicity $y=axlnx$? I can't transform it to a *linear model*. Any ready-made tools? – Rick Jan 02 '19 at 13:53

1 Answers1

1

$y=ax^b+c$ is a more general model than $y=ax^b$; but, it cannot be converted into a linear model any more, i.e. $y=Ax$. The machinery used for these kinds of regression problems is the prototype $b=Ax'$, where you can construct matrix $A$ in any way you like.

For $y=ax+b$ model, it is already in $Ax'=b$ form. One column of $A$ is $x$, the other column is all $1$'s. So, using $y=ax$ doesn't increase conceptual complexity.

However, for $y=ax^b+c$, you have to resort to nonlinear methods since there is no exact transformation available. I don't know about Excel, but in sklearn you can adapt curve_fit method in scipy.optimize.

gunes
  • 49,700
  • 3
  • 39
  • 75
  • Much thanks! So my kid's high school textbook which use $y=ax^{b}$ directly is not 100% correct, right? – Rick Jan 02 '19 at 13:47
  • Btw, I want to do a $y=axlnx + c$ or for simplicity $y=axlnx$ regression, I notice that I can't transform it to a *linear model*, could you give me some advice? – Rick Jan 02 '19 at 13:50
  • use curve_fit in scipy.optimize for the first version. The library page provided above contains example for $ae^{-bx}+c$; you can adapt it for any curve you like. For the second one you have $lny=lna+lnx+ln(lnx))$, so a linear model, but i don't think that's going to solve your problem since there is only bias term. – gunes Jan 02 '19 at 14:19
  • Yes, I can't use `lny=lna+lnx+ln(lnx)`... How am I supposed to modify `x`.. if so. – Rick Jan 02 '19 at 14:25