[R] fitting a hyperbola to data points

Manoj Srivastava srivasta at ieee.org
Mon Apr 8 04:08:17 CEST 2013


        I am new to R, and I suspect I am missing something simple.

        I have a data set that  performance data that correlates request
 rate to response times 
 There is some jitter in the data, but mostly it looks like a hockey
 puck curve. It does not get converted into a straight line when I tried
 log conversions, so it does not seem to be a power series relationship.

        My expectation is that the data will fit a curve that is a
 hyperbola, but I don't know how to formulate that regression. How does
 one fit data to a general function
   AX^2 + Bxy + Cy^2 +D = 0

        I have tried polynomial functions and inverse functions
 lm2 = lm(Time ~ Requests + I(Requests^2) +  I(Requests^3))
 but that does not appear to be close.

        Any pointers appreciated.


dat <- read.csv("perf.csv",header=TRUE)
plot (Time ~ Requests)
plot (Time ~ Requests, log="y")
plot (Time ~ Requests, log="x")
plot (Time ~ Requests, log="xy")

To be intoxicated is to feel sophisticated, but not be able to say
it. George Carlin
Manoj Srivastava <srivasta at acm.org> <http://www.golden-gryphon.com/>  
4096R/C5779A1C E37E 5EC5 2A01 DA25 AD20  05B6 CF48 9438 C577 9A1C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 599 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130407/22d733d3/attachment.bin>

More information about the R-help mailing list