TITLE: Approximate a function using least square fit for exponential and constant parameter
QUESTION [0 upvotes]: Given an array of $X$ and $Y$ values which describe a function $f$
Such that $\forall i. Y[i] = f( X[i] )$
I would like to approximate $f$ as $a + b \cdot x ^ n $, where $a$, $b$ and $n$ are parameters
For the special case where we assume $a=0$, I know you can use a log trick $log(y) = log(b) + n \cdot log(x)$ which is linear in $log(x)$ and $log(y)$ and can be solved using linear least squares.
However for the case where we don't assume $a$ is zero, I don't know if there exist such a trick.
In case this isn't possible any method which can estimate any of the parameters is welcome

REPLY [1 votes]: I dare to take the opportunity to cordially greet Claude Leibovici.
I would like to add a comment to his judicious answer (Comment too long to be edited in the comments section).
Thanks to the numerical example provided by Claude Leibovici one can compare with another method (not conventionnal) which advantage is that the method isn't iterative and doesn't requires initial guessed values. For theory see
https://fr.scribd.com/doc/14674814/Regressions-et-equations-integrales . Since this paper is written in French a translation of the algorithm is given below.

The calculus is direct and very simple :

On the graph the curves y(X) drawn in blue from the above calculus and in black from Claude Leibovici's calculus are quite indistinguishable.
Least Mean Square Error :
From above calculus : 21.6 ; From Leibovici's calculus : 18.4
Least Mean Square Relative Error :
From above calculus : 0.0047 ; From Leibovici's calculus : 0.0083
This is not surprising since the criteria of fitting in Leibovici's calculus is LMSE.
{"set_name": "stack_exchange", "score": 0, "question_id": 4500501}