Questions about the model y=a/(x+b)?

Asked

Viewed 222 times

1

Help! Hello everyone, does anyone know this model y = a/(ln(x)-b-e)? I would like any information about it to make the adjustment in R. The idea is to know if there is any restriction between the variables to make the adjustment or if it is possible to manipulate the model to make linear adjustments.

Thank you

  • 3

    The answer below has solved your problem?

  • 1

    To clarify: AP edited the initial question, which was about how to do the non-linear adjustment on R. @Diogo, it is not interesting for you to edit a question by changing its direction, especially if it has already been answered. If you have a new question (about programming, because only mathematics is not within the scope of the site), create a new post.

  • ipsulum gets a divided by the sum of x but b

2 answers

6

The simplest way is to use nonlinear regression by least squares (function nls). Mathematically, this is an iterative method, which looks for values for the parameters to reduce the residues below a limit value.

An example of use is the following:

set.seed(0)    
x <- rnorm(100)
y <- jitter(1234/(x + 1), 0.1)
dat <- data.frame(x = x, y = y)
nl <- nls(y ~ a/(x + b), data = dat, start = c(a = 1000, b = 2))

Results can be observed with the function summary:

> summary(nl)
# Formula: y ~ a/(x + b)
# 
# Parameters:
#   Estimate Std. Error t value Pr(>|t|)    
#   a 1132.5404   548.9356   2.063   0.0417 *  
#   b    1.9850     0.2013   9.863  2.4e-16 ***
#   ---
#   Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# 
# Residual standard error: 4639 on 98 degrees of freedom
# 
# Number of iterations to convergence: 13 
# Achieved convergence tolerance: 9.861e-06

Not always the estimate gets so "good", but it depends on the data and the function, not the R.

-2

It is possible to manipulate the model to arrive to make it linear, then it is just do the simple regression.

y = a/(ln(x) -b - e)  

1/y = (ln(x)-b-E)/a
    = ln(x)/a - b/a - e/a
    = c*ln(x)+d + e' 
  • I make the words of @Molx mine.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.