Search code examples
rcurve-fittingnls

Hill Equation Curve Fitting NLS


I am trying to calculate rate for the following data. I tried Michaelis menten equation, however, Km was coming negative. I am now trying to fit hill equation, but I am getting error message. I think my starting values are not so good. Any help will be very appreciated.

Thanks, Krina

x<- c(0.0,  2.5,  5.0, 10.0, 25.0)
y <- c(4.91, 1.32, 1.18, 1.12, 1.09)

fo <- y~(Emax*(x^hill)/((EC50^hill)+(x^hill)))
st <- c(Emax=1.06, EC50=0.5, hill=1)

fit <- nls(fo, data = data.frame(x, y), start = st, trace = T)

Error in numericDeriv(form[[3L]], names(ind), env) : 
  Missing value or an infinity produced when evaluating the model

Solution

  • I fit the data you posted to a few hundred known, named equations using a genetic algorithm for initial parameter estimation and found an excellent fit to a simple power law equation as follows (also see attached graph):

    y = (a + x)b + Offset
    
    a =  3.6792869983309306E-01
    b = -1.3439157691306818E+00
    Offset =  1.0766655470363218E+00
    
    Degrees of freedom (error): 2
    Degrees of freedom (regression): 2
    Chi-squared: 1.98157151386e-06
    R-squared: 0.999999822702
    R-squared adjusted: 0.999999645405
    Model F-statistic: 5640229.45337
    Model F-statistic p-value: 1.77297720061e-07
    Model log-likelihood: 29.7579529506
    AIC: -10.7031811802
    BIC: -10.9375184328
    Root Mean Squared Error (RMSE): 0.000629534989315
    
    a = 3.6792869983309306E-01
      std err: 2.36769E-06
      t-stat: 2.39112E+02
      p-stat: 1.74898E-05
      95% confidence intervals: [3.61308E-01, 3.74549E-01]
    
    b = -1.3439157691306818E+00
      std err: 2.91468E-05
      t-stat: -2.48929E+02
      p-stat: 1.61375E-05
      95% confidence intervals: [-1.36714E+00, -1.32069E+00]
    
    Offset = 1.0766655470363218E+00
      std err: 9.37265E-07
      t-stat: 1.11211E+03
      p-stat: 8.08538E-07
      95% confidence intervals: [1.07250E+00, 1.08083E+00]
    
    Coefficient Covariance Matrix
      [ 2.38970842 -8.3732707   1.30483649]
      [ -8.3732707   29.41789844  -4.52058247]
      [ 1.30483649 -4.52058247  0.94598199]
    

    model plot