0

I'm trying to code a regression calculator, because I like setting stupid challenges for myself that have been done before. I know what the formula for linear regression is already (I think):

$a= \frac{(\sum y)(\sum x^2) - (\sum x)(\sum xy)}{n(\sum x^2)-(\sum x)^2}$

$b= \frac{n(\sum xy)-(\sum x)(\sum y)}{n(\sum x^2)-(\sum x)^2}$

But I do need to know what the non-linear formula is. I've looked it up, but I'm currently learning in Integrated Math II, so I don't understand much. I understood everything that wasn't greek, basically - so just the $f$. Is there some kind of formula that's more like the one above than what I've found?

This is my first time posting on this forum, so I probably overlooked something...

All in all, is there an equation like the one above, preferably on the same level, that describes a non-linear regression equation? If you can only find one for quadratic equations, that's honestly fine as well. I am familiar with matrixes as well, just need to brush up on my skills, so if the solution has that (which I know it might, I've seen them everywhere, like least-squares method which I don't totally understand) then you can show me that as well. Sorry for rambling on, but help appreciated!

  • Usually, the data is linearized e.g. $PV^a=c$ is linearized as $\ln P+a \ln V=\ln c$, then take $y=\ln P$ and $x=\ln V$. – Z Ahmed Sep 17 '21 at 01:07
  • Is there a way to simplify this, or do you have the time to give a sort of detailed explanation of what that means? I always feel bad being the less experienced one on these forums... – TheCodedMaster Cubing Sep 17 '21 at 01:08
  • Another example $y=ae^{bx} \implies \ln y=\ln a+b x$ take $\ln y$ the do regression between $Y$ and $x$. – Z Ahmed Sep 17 '21 at 01:14
  • They are no general formula for non-linear regression. As already pointed out, in many cases the equation to be fitted can be linearised thanks to some convenient transformation. Logarithmic transform is used in a few particular cases . In many cases some integral transformations can be used to linearise the regression. A lot of examples are given in : https://fr.scribd.com/doc/14674814/Regressions-et-equations-integrales . – JJacquelin Sep 26 '21 at 11:16

0 Answers0