Error $\Delta A$ in Least Squares best fit of data to hyperbola $y=B/(x-A)$

432 Views Asked by At

Problem description.
Let there be given a set of real-valued data points $\,(x_i,y_i)\,$. Find the Least Squares best fit of these points to a hyperbola $\;y = B/(x-A)\;$, written as $\;y(x-A)-B=0\;$: $$ \sum_i \left[\,y_i(x_i-A) - B\,\right]^2 = \mbox{minimum}(A,B) $$ The minimum is found with help of partial differentiation, giving: $$ \frac{\partial}{\partial A} \quad : \quad \left(\sum_i y_i^2\right) A + \left(\sum_i y_i\right) B = \sum_i x_i y_i^2 \\ \frac{\partial}{\partial B} \quad : \quad \left(\sum_i y_i\right) A + \left(\sum_i 1\right) B = \sum_i x_i y_i $$ The solution of this system of linear equations is: $$ A = \frac{M_{22}R_1-M_{12}R_2}{M_{11}M_{22}-M_{12}^2} \quad ; \quad B = \frac{-M_{12}R_1+M_{11}R_2}{M_{11}M_{22}-M_{12}^2} $$ With: $$ M_{11} = \sum_i y_i^2 \quad ; \quad M_{12} = \sum_i y_i \quad ; \quad M_{22} = \sum_i 1 \\ R_1 = \sum_i x_i y_i^2 \quad ; \quad R_2 = \sum_i x_i y_i $$ So far so good. We are especially interested in the value of $\,A\,$. But what bothers us is the error / the uncertainty in $\,A\,$, let's call it $\,\Delta A\,$.
Pictures say more than a thousand words. The red line on the left is the asymptote of the hyperbola, at $\,A\,$. In the same picture rightmost we see the data, enlarged for clarity in the picture on the right.

enter image description hereenter image description here

I really have no clue how to obtain a decent estimate for $\,\Delta A\,$ neither in theory or experimentally. I'm afraid that it is bad. But anyway, any help is highly appreciated!

2

There are 2 best solutions below

2
On BEST ANSWER

In addition to Claude Leibovici's comment, an alternative way to obtain a first estimate :

From $y=\frac{B}{x-A} \quad\to\quad (x-A)y=B \quad\to\quad xy=B+Ay$

Reset your data with $\begin{cases}Y=xy\\X=y\end{cases}$

$$Y=B+AX$$ A linear regression gives approximate $A$ and $B$.

If not accurate enough, start a non-linear regression from those initial values.

10
On

This is too long for a comment.

You must take care : what is measured is $y$ and then what you need to minimize is $$SSQ=\sum_{i=1}^n \left(\frac B{x_i-A}-y_i \right)^2 \tag 1$$ This is a nonlinear model and, as usual, you need some reasonable estimates of $A,B$ before starting the nonlinear regression.

You can easily have estimates making $$y=\frac B{x-A}\implies \frac 1y=\frac x B-\frac AB=ax+b$$ So, defining $z_i=\frac 1{y_i}$, a linear regression gives $a,b$ from which $B=\frac 1a$ and $A=-\frac ba$.

Now, start the nonlinear regression.

Edit

If you do not want to use a nonlinear regression, the problem can be solved in the following manner (taking into account the fact that the model is linear with respect to $B$).

Using the definition of $SSQ$ as in $(1)$, compte the partial derivatives and set them equal to $0$. This gives

$$SSQ'_{B}=0\implies B \sum_{i=1}^n \frac 1 {(x_i-A)^2}= \sum_{i=1}^n \frac {y_i} {(x_i-A)}\tag 2$$ $$SSQ'_{A}=0\implies B \sum_{i=1}^n \frac 1 {(x_i-A)^3}= \sum_{i=1}^n \frac {y_i} {(x_i-A)^2}\tag 3$$ Recombining $(2)$ and $(3)$, we then end with a single equation in $A$ $$F=\left(\sum_{i=1}^n \frac {y_i} {(x_i-A)}\right)\left(\sum_{i=1}^n \frac 1 {(x_i-A)^3}\right)-\left(\sum_{i=1}^n \frac {y_i} {(x_i-A)^2}\right)\left(\sum_{i=1}^n \frac 1 {(x_i-A)^2}\right)=0\tag 4$$ This last equation can be solved using Newton method using (if lazy) cental differences for the evaluation of $F'_A$ as, for example $$F'_A=\frac{F(1.001A)-F(0.999A)}{0.002 A}$$ If not lazy, the derivative $F'_A$ can easily be expressed analytically.

For sure, since you are concerned by only one branch of the hyperbola, you need to search for $A$ starting above the largest value of the $y_i$'s.