Search code examples
rnon-linear-regression

What is the self-starting model function in R that uses Boltzmann Sigmoidal equation?


I am trying to predict melting temperature (Tm) values for the following sample data using the R DRC library function as shown below to mimic the calculation in GraphPad PRISM using Boltzmann sigmoid function. I selected G.4() function in the DRC package which was the closest self-starting model that was providing Tm values very close to the Boltzmann sigmoid function in PRISM. I am sure it is not the most appropriate choice. I need advice on the correct R library function.

The Boltzmann sigmoid equation used by GraphPad PRISM software:

Y=Y2+((Y1−Y2)/(1+exp((V50−X)/slope))

Four-parameter Gompertz model used in G.4() function in R DRC library:

f(x)=Y2+(Y1−Y2)exp(−exp(b(log(X)−e))).

library(drc)

df <- data.frame(Temperature= c(51.6,51.8,52,52.2,52.4,52.6,52.8,53,53.2,53.4,53.6,53.8,54,54.2,54.4,54.6,54.8),
      RFU = c(-90.01,-90.02,-87.17,-80.06,-68.57,-56.5,-44.25,-29.08,-12.03,5.45,24.94,47.19,70.06,92.87,116.07,140.85,161.95))

fm <- drm(data = df, RFU ~ Temperature, fct = G.4())


summary(fm1)

Model fitted: Gompertz (4 parms)

Parameter estimates:

                    Estimate Std. Error t-value   p-value    
b:(Intercept)  -0.555010   0.029105 -19.069 6.925e-11 ***
c:(Intercept) -98.503228   1.929340 -51.055 2.255e-16 ***
d:(Intercept) 469.605163  34.369511  13.663 4.341e-09 ***
e:(Intercept)  54.350344   0.103484 525.206 < 2.2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error:

 1.582522 (13 degrees of freedom)

Solution

  • The "Boltzmann sigmoid function" is exactly what Pinheiro and Bates call the "four parameter logistic function", since it's really just a rescaled version of the logistic function with different minima and maxima. As such a self-starting version is already built into R in the form of the SSfpl function. So it's as simple as

    ?SSfpl  -- to see the equation and supporting docs
    fm1 <- nls(RFU ~ SSfpl(Temperature, A, B, xmid, scal), data =df)
    
    # fm1 returns -------------------->
    Nonlinear regression model
      model: RFU ~ SSfpl(Temperature, A, B, xmid, scal)
       data: df
            A         B      xmid      scal 
    -115.0352  294.8875   54.1671    0.8681 
     residual sum-of-squares: 56.05
    
    Number of iterations to convergence: 0 
    Achieved convergence tolerance: 1.541e-06
    

    The A and B are obviously the starting and ending asymptotes. After graphing your data I would issue a warning about putting much confidence in the ending asymptote estimate. You really don't have much data over an RFU of 150 which is just beyond the xmid value.

    > png()
    > plot(RFU~Temperature, df)
    > lines( predict( fm1, newdata= df[ ,"Temperature", drop=FALSE]) ~ df$Temperature, col="blue")
    > dev.off()
    

    enter image description here