SSlogisJN: Alternative self start for three-parameter logistic function...

SSlogisJNR Documentation

Alternative self start for three-parameter logistic function SSlogis

Description

Self starter for a 3-parameter logistic function.

The equation for this function is:

f(input) = Asym/(1 + exp((xmid - input)/scal))

The approach of the function SSlogis() in base R uses a different algorithm and returns the actual solution rather than starting parameters, so runs a complete set of iterations, only to try to repeat from the solution with the standard algorithm.

Usage

SSlogisJN(input, Asym, xmid, scal)

Arguments

input

input vector (input)

Asym

asymptotic value for large values of x

xmid

a numeric parameter representing the x value at the inflection point of the curve. The value of SSlogisJN will be Asym/2 at xmid.

scal

numeric scale parameter on the input axis

References

Ratkowsky, David A. (1983) Nonlinear Regression Modeling, A Unified Practical Approach, Dekker: New York, section 8.3.2

Examples

{
## require(ggplot2)
require(nlsr)
set.seed(1234)
x <- seq(0, 20, .2)
y <- SSlogisJN(x, 5, 10, .5) + rnorm(length(x), 0, 0.15)
frm<-y ~ SSlogisJN(x, Asym, xmid, scal)
dat <- data.frame(x = x, y = y)
strt<-getInitial(frm, dat)
cat("Proposed start:\n"); print(strt)
fit <- nlxb(frm, strt, data = dat, control=list(japprox="SSJac"))
print(fit)
## plot
## ggplot(data = dat, aes(x = x, y = y)) + 
##   geom_point() + 
##  geom_line(aes(y = fitted(fit)))
}

nlsr documentation built on Sept. 8, 2023, 5:48 p.m.