Skip to content
Prev 156652 / 398506 Next

fitting a hyperbole

stephen sefick wrote:
Well, it depends on the exact model you want to fit and the error 
characteristics.

There's a straightforward linear model in the transformed x:
lm(y ~ I(1/x))

but there are also transformed models like

lm(1/y ~ x)

or

lm(log(y) ~ log(x))

but of course, y, 1/y, and log(y) can't all be homoscedastic normal 
variates. Going beyond the linearized models, you can use nls(), as in

nls(y~ a/(x-b), start=c(a=1,b=0))

(which is linear for 1/y, but assumes that y rather than 1/y has 
constant variance.)