SSlogisJN | R Documentation |
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.
SSlogisJN(input, Asym, xmid, scal)
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 |
Ratkowsky, David A. (1983) Nonlinear Regression Modeling, A Unified Practical Approach, Dekker: New York, section 8.3.2
{
## 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)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.