Given a set of points on 2D surface $(x_1,y_1),(x_2,y_2),\ldots,(x_n,y_n)$ and a function $f(x)=k+ab^x$, the task is to find values of $k,a$ and $b$ that minimize the following sum:
$$\sum_{i=1}^n (k+ab^{x_i}-y_i)^2.$$
I tried to get derivatives (with respect to $k,a,b$) from this sum and got the system of three equations, but it's impossible for me to express unknowns from it. Also I'm looking for numerical answer.
Does anyone know how to do that? Thanks for the help.
I used @Taro hint to solve this task.
I made the following change:
$$\ A=lna\\ B=lnb $$
And rewritten the function: $$\ ln(y_i-k)=A+x_iB $$
After this I've got a system with 2 unknowns $A$ and $B$ ($k$ is parameter):
$$\begin{cases} \sum_{i=1}^n ln(y_i-k)=nA+B\sum_{i=1}^nx_i \\ \sum_{i=1}^n ln(y_i-k)x_i=A\sum_{i=1}^nx_i+B\sum_{i=1}^nx_i^2 \end{cases}$$
As you can see right part of system is static - only left part depends on $k$.
And solved it with binary search (used $k$ as parameter).
Here's a result: