Fit a curve for data made up of two distinct regimes

前端 未结 5 1482
余生分开走
余生分开走 2020-12-10 04:00

I\'m looking for a way to plot a curve through some experimental data. The data shows a small linear regime with a shallow gradient, followed by a steep linear regime after

5条回答
  •  情书的邮戳
    2020-12-10 04:47

    If you're looking to join what appears to be two straight lines with a hyperbola having a variable radius at/near the intersection of the two lines (which are its asymptotes), I urge you to look hard at Using an Hyperbola as a Transition Model to Fit Two-Regime Straight-Line Data, by Donald G. Watts and David W. Bacon, Technometrics, Vol. 16, No. 3 (Aug., 1974), pp. 369-373.

    The formula is drop dead simple, nicely adjustable, and works like a charm. From their paper (in case you can't access it):

    As a more useful alternative form we consider an hyperbola for which:
    (i) the dependent variable y is a single valued function of the independent variable x,
    (ii) the left asymptote has slope theta_1,
    (iii) the right asymptote has slope theta_2,
    (iv) the asymptotes intersect at the point (x_o, beta_o),
    (v) the radius of curvature at x = x_o is proportional to a quantity delta. Such an hyperbola can be written y = beta_o + beta_1*(x - x_o) + beta_2* SQRT[(x - x_o)^2 + delta^2/4], where beta_1 = (theta_1 + theta_2)/2 and beta_2 = (theta_2 - theta_1)/2.

    delta is the adjustable parameter that allows you to either closely follow the lines right to the intersection point or smoothly merge from one line to the other.

    Just solve for the intersection point (x_o, beta_o), and plug into the formula above.
    BTW, in general, if line 1 is y_1 = b_1 + m_1 *x and line 2 is y_2 = b_2 + m_2 * x, then they intersect at x* = (b_2 - b_1) / (m_1 - m_2) and y* = b_1 + m_1 * x*. So, to connect with the formalism above, x_o = x*, beta_o = y* and the two m_*'s are the two thetas.

提交回复
热议问题