0

I have given the blue curve:

enter image description here

The datapoints are:

-2.00E+01   -6.70E+01
-1.70E+01   -6.10E+01
-1.40E+01   -5.50E+01
-1.10E+01   -4.89E+01
-8.00E+00   -4.30E+01
-5.00E+00   -3.71E+01
-2.00E+00   -3.13E+01
1.00E+00    -2.57E+01
4.00E+00    -2.04E+01
7.00E+00    -1.55E+01
1.00E+01    -1.10E+01
1.30E+01    -6.92E+00
1.60E+01    -3.09E+00
1.90E+01    5.40E-01
2.20E+01    4.02E+00
2.50E+01    7.38E+00

I would like to find an analytic, as simple as possible fit function $g(a_1,\cdots,a_N)$ where $a_n$ are arbitrary (not necessarily linear) parameters to fit to the values (in the range shown in the plot).

PS: If it matters: This is a logarithmic plot. The underlaying datapoints follow a power-law. If it would be a perfect power law, the curve would be linear. However, the curve bends for higher values of x and it is this bending that I would like to model.

divB
  • 490

2 Answers2

1

Looking at the data, it seems that a quadratic equation $$y=a + b x+c x^2$$could be more than sufficient.

I obtained $R^2=0.999863$ and $$\begin{array}{clclclclc} \text{} & \text{Estimate} & \text{Standard Error} & \text{Confidence Interval} \\ a & -27.5691 & 0.175178 & \{-27.9508,-27.1874\} \\ b & 1.74388 & 0.009185& \{1.72387,1.7639\} \\ c & -0.0134872 & 0.000692 & \{-0.014995,-0.011980\} \\ \end{array}$$

and the results are below $$\left( \begin{array}{ccc} -20 & -67.0 & -67.84 \\ -17 & -61.0 & -61.11 \\ -14 & -55.0 & -54.63 \\ -11 & -48.9 & -48.38 \\ -8 & -43.0 & -42.38 \\ -5 & -37.1 & -36.63 \\ -2 & -31.3 & -31.11 \\ 1 & -25.7 & -25.84 \\ 4 & -20.4 & -20.81 \\ 7 & -15.5 & -16.02\\ 10 & -11.0 & -11.48 \\ 13 & -6.92 & -7.178 \\ 16 & -3.09 & -3.120 \\ 19 & +0.54 & +0.696 \\ 22 & +4.02 & +4.268 \\ 25 & +7.38 & +7.598 \end{array} \right)$$ Adding a cubic term improves a little the results but the next coefficient is "almost non significant.

Use Excal trendlina for a polynomial.

0

If you are trying to fit $y=a10^{\frac xb}$ you can take the log of both sides to get $\log y=\log a+\frac xb\log 10$. This is a linear fit in the parameters $\log y, \log a, \frac 1b$. Taking the log and the inverse of $b$ will change the weights of the errors and will change the fitted values a certain amount, but linear fits are easy and robust. Alternately, you can avoid taking the logs and feed the fit to a nonlinear function minimizer.

Ross Millikan
  • 374,822
  • May this is a misunderstanding but I do not want to fit $y = a 10^{x/b}$. I want to know which (simple, analytical) function the datapoints of the blue line best resemble. I use a nonlinear minimizer already (MATLAB) for fitting itself. – divB Sep 15 '20 at 03:19
  • You can still fit $\log y$ vs $\log x$ using any fitter you want, then exponentiate the result. The fact that it is so smooth should make fits work well. – Ross Millikan Sep 15 '20 at 03:21
  • Sorry I don't get it. What is the function you suggest to use for fitting? Yes, I took the logarithm of $y$ already (and $x$ is already logarithmized, due to dB). If I fit versus any $y=a 10^{x/b}$ this fit is linear (logarithmically). I understand I can get different slopes and offsets for that linear function. But you can see the blue curve has a bend. I understand I can exponentiate it. But that still doesn't give me any shape that resembles the blue curve. If you would just provide an example, that would make things much easier. – divB Sep 15 '20 at 03:43
  • I have also updated the question. Maybe it is less ambiguous now. – divB Sep 15 '20 at 03:47