3
$\begingroup$

I have 4 data points, from which I want to calculate a hyperbola. It seems that the Excel trendline feature can't do it for me, so how do I find the relationship?

The points are: (x,y)

(3, 0.008) (6, 0,006) (10, 0.003) (13, 0.002)

Thanks!

  • 1
    Probably you wanted to fit a hyperbola, not a "hyperbolic function". Just reciprocate your x-coordinates and proceed with linear regression as usual.2011-05-10
  • 0
    Can you explain that further? I don't really understand what you mean.2011-05-10
  • 0
    Do the usual linear fit on the points $\left(\frac1{x},y\right)$...2011-05-10
  • 0
    With this data, a straight line is in fact a far closer fit in terms of the sum of squares of residuals.2011-05-10

2 Answers 2

4

A hyperbola takes the form $y = k \frac{1}{x}$. This may be difficult to deal with. So instead, let's consider the reciprocals of our x values as J.M. suggested. For example, instead of looking at $(2.5, 0.007713)$, we consider $(\frac{1}{2.5}, 0.007713)$. Then since we have flipped all of our x values, we are looking to fit something of the form $y = k \dfrac{1}{ \frac{1}{x} } = k x$. This can be accomplished by doing any standard linear regression technique.

This is just an extension of J.M.'s comment.

0

If other people coming across this question want to fit a general hyperbola of the form $\frac{x^2}{a^2} - \frac{y^2}{b^2} = 1$ there is a slightly cheap way of getting an estimate.

Note: The best way is to do this is to use an iterative least squares model or something like that, but this'll give you a rough idea. (Thanks to Claude Leibovici for pointing this out)

You can rearrange the general formula to:

$y^2 = \frac{b^2x^2}{a^2} - b^2$

and then:

  1. substitute $\theta_1 = b^2/a^2$ and $\theta_2 = -b^2$
  2. substitute $Y = y^2$ and $X = x^2$

and voila! you can now do a standard linear regression to find $\theta_1$ and $\theta_2$ from the linear equation:

$Y = \theta_1X + \theta_2$

Example

You convert your data to X and Y first:

+----+------+               +-----+--------+
| x  |  y   |               |  X  |   Y    |
+----+------+     ->        +-----+--------+
|  4 |    0 |               |  16 |      0 |
|  5 |  2.3 |    Y=y^2      |  25 |   5.29 |
|  6 | 3.34 |    X=x^2      |  36 |  11.16 |
| 10 | 6.85 |               | 100 |  46.92 |
| 12 | 8.48 |               | 144 |  71.91 |
| 17 | 12.4 |               | 289 | 153.76 |
| 20 | 14.7 |               | 400 | 216.09 |
+----+------+               +-----+--------+

Then run a linear regression on $X$ and $Y$ to get $\theta_1 = 0.563$ and $\theta_2 = -9.054$

Which implies:

$b = \pm \sqrt{- \theta_2} \approx \pm 3.01$

and

$a = \pm\sqrt{\frac{b^2}{\theta_1}} \approx \pm 4.01$