How to do a 3 constant reciprocal (multiplicative inverse) regression

109 Views Asked by At

I am trying to fit a set of data to a curve such as:

$y=\frac{m}{x-a}+b$

Without the constant $a$, it is easy to define $z=\frac{1}{x}$ and convert it to a linear model. But I have not been able to find how to solve it with the additional constant.

Ideally I would like to use the Theil-Sen estimator (https://en.wikipedia.org/wiki/Theil%E2%80%93Sen_estimator) to solve as I expect to have significant outliers and this method in principal should be more robust. If not, I can any other method such as least squares.

The goal of this exercise is ultimately to automatically identify the outliers. Table below has an example of data points that I am trying to fit:

x y
2.86 210.021
9.08 108.977
0.63 199.2
125.5 110.723
68.61 112.154
64.62 87.464
233.03 43.727
16.61 277.019
13.41 201.378
11.01 51.5
0.28 455.625
32.65 160.806
145.55 115.917
2.33 160.668
22.07 158.409
67.3 102.105
18.9 143.599
30.45 314.55
115.86 210.744
111.46 126.739
5.24 53
2.71 220.523
1.57 238.647
4.94 272.322
165.75 100.999
20.6 95.482
112.59 114.391
2.06 203.475
89.82 125.323
39.2 95.994
568.93 38.768
69.12 20.15
51.91 80.275
2

There are 2 best solutions below

1
On

The model $$y=\frac{m}{x-a}+b$$ is nonlinear because of $a$.

You properly said that if $a=0$ the problem is simple. Continue the reasoning : the problem is still simple for any given value of $a$.

So, before running a nonlinear regression, give $a$ a fixed value and define $z_i=\frac 1 {x_i-a}$ and compute $$\text{SSQ}(a)=\sum_{i=1}^n \big[m z_i+b-y_i\big]^2$$ Try a few values of $a$ and plot $\text{SSQ}(a)$ until you see more or less a minimum. AT this point, you have your estimates and you can safely start the nonlinear regression. If you do not access such a tool, zoom more and more your plot.

0
On

$$y=\frac{m}{x-a}+b \tag 1$$ Instead of fitting the above function $(1)$ one can fit the equation $(2)$ below to which $y$ is solution. $$(y-b)(x-a)=m$$ $$-xy+ay+bx-ab+m=0$$ $$-xy+ay+bx+c=0 \quad;\quad c=m-ab \tag 2$$ This is a linear equation wrt $a,b,c$ which can be solved thanks to linear regression. Section 5 in https://fr.scribd.com/doc/14819165/Regressions-coniques-quadriques-circulaire-spherique .

A numetical example (with reasonable scatter) is given below :

enter image description here

The result of fitting is exact if the data isn't scattered.

If the scatter of data is small the result of fitting is quite the same what ever the chosen criteria of fitting is.

If the data is highly scattered the "best fit" is different depending a lot on the criteria of fitting chosen (LMSE, LMAE, LMSRE, etc.). Thus one have to use an iterative method of fitting in which the criteria of fitting is implemented.

In the OP question we observe that the given data is highly scattered. So, the question is not well posed without specifying a criteria of fitting. No definitive answer can be given because they are as many "best fit" as they are different criteria of fitting.

With the data provided by the OP, the result appears on the next figure. It is clear that with such an high scatter this result is more than doubtful. Even with a specific griteria of fitting I am affaid that the result would be doubtful as well.

enter image description here