$$ f(x+1) = f(x) + A(f(x) - B)^3 $$
to fit his experimental data -
x
|
f(x)
|
|---|---|
1
|
235
|
2
|
130
|
3
|
115
|
4
|
105
|
5
|
100
|
6
|
99
|
My objective was to find values of the parameters $A$ and $B$ which would give a good curve fitting. Note that there can be more than one solutions to this. However, the one which gives the smallest norm ie one which fits most tightly should be preferred.
Note that the function is recursive. (I don't know why did he choose such a function.)
Mathematics -
I decided to fit the data using the linear least squares fit technique, since it is the simplest one. You cannot directly use this technique on the above equation since the parameters do not occur linearly.
A little simplification is required -
$ f(x+1) - f(x) = A(f(x) - B)^3 $
$ (f(x+1) - f(x))^{1/3} = A^{1/3}(f(x) - B) $
$ (f(x+1) - f(x))^{1/3} = af(x) + b $, where $a=A^{1/3}$ and $b=-B$
Now, since the parameters occur linearly, I can use the linear least square technique.Solution -
Using the linear least squares technique, I get -
$a=-0.0244177$, $b=0.93556103$, or
$A=-1.45584135705 \times 10^{-05}$, $B=38.3148771756$
To understand the mathematics behind the least squares curve fitting, you can refer to this article on wikipedia. In numpy, python's numerical computation package, the function numpy.linalg.lstsq can easily finds these coefficients once they occur in a linear fashion. I have used this function in my python code (posted below) to get the values of these coefficients.
Note -
However, another solution set, $A2=-1.1177 \times 10^{-05}$, $B2=24$, also seems to fit the data good enough. I don't know which fitting technique was used to obtain it. I'll update the post when I find it out. I have compared the plots obtained using these 2 solutions below.
Comparative Plots -
The following plot shows all the 3 curves
Observation -
Python Program -
The following python program was used in solving for $A$ and $B$ and plotting the 3 graphs
(Does not YET include the method for obtaining $A2$, $B2$) -

