Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I have the following data in R

x <- c(0.1,0.2,0.3,0.6,0.8,0.9,1)
y <- c(90,96,97.7,99.3,99.65,99.95,100)

I'm trying to find a logarithmic equation that best fits these points. I'm not sure what the equation would look like, but probably something like one of these

  • a*log(x)+b
  • (a*log(x)+b)/(log(x)+c)
  • a*log(b*x)+c
  • etc

What kind of curve do you think best fits this data. And how can I find out?

share|improve this question
The question still doesn't belong here. i vote to close. – Michael Chernick Aug 31 '12 at 17:15
I agree the question is somewhat vague. Maybe the poster could elaborate it ? – Stéphane Laurent Aug 31 '12 at 17:18
Okay if the data is being fit to a statistical model then it is okay for here. – Michael Chernick Aug 31 '12 at 17:20
2  
All of the models you've listed have the same general form: $$y = \frac{\beta_1 \log\left(\beta_2 x\right)+\beta_3}{\beta_4 \log\left(\beta_5 x\right)+\beta_6}+\epsilon$$ Might it be possible to fit the full model, then remove coefficients based on estimates and standard errors? Though that is a seven-parameter model and you have seven data points... – Max Aug 31 '12 at 17:36
1  
I agree with @Max 's last point. Your models are getting too complex for your data. – Peter Flom Aug 31 '12 at 19:19
show 3 more comments

1 Answer

up vote 4 down vote accepted

You could fit a linear regression model as follows:

f <- function(x) a*log(x)+b
fit <- lm(y~I(f(x)))
summary(fit)

Then examine the fitted model for every candidate function f.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.