| Line 27... |
Line 27... |
| 27 |
}
|
27 |
}
|
| 28 |
\value{
|
28 |
\value{
|
| 29 |
a numeric vector of the same length as \code{input}. It is the value of
|
29 |
a numeric vector of the same length as \code{input}. It is the value of
|
| 30 |
the expression \code{Asym/(1+exp((xmid-input)/scal))}. If all of
|
30 |
the expression \code{Asym/(1+exp((xmid-input)/scal))}. If all of
|
| 31 |
the arguments \code{Asym}, \code{xmid}, and \code{scal} are
|
31 |
the arguments \code{Asym}, \code{xmid}, and \code{scal} are
|
| 32 |
names of objects the gradient matrix with respect to these names is attached as
|
32 |
names of objects the gradient matrix with respect to these names is
|
| 33 |
an attribute named \code{gradient}.
|
33 |
attached as an attribute named \code{gradient}.
|
| 34 |
}
|
34 |
}
|
| 35 |
\author{\enc{José}{Jose} Pinheiro and Douglas Bates}
|
35 |
\author{\enc{José}{Jose} Pinheiro and Douglas Bates}
|
| 36 |
\seealso{\code{\link{nls}}, \code{\link{selfStart}}
|
36 |
\seealso{\code{\link{nls}}, \code{\link{selfStart}}
|
| 37 |
}
|
37 |
}
|
| 38 |
\examples{\donttest{
|
38 |
\examples{\donttest{
|
| Line 48... |
Line 48... |
| 48 |
summary(fm1)
|
48 |
summary(fm1)
|
| 49 |
## but are slightly improved here:
|
49 |
## but are slightly improved here:
|
| 50 |
fm2 <- update(fm1, control=nls.control(tol = 1e-9, warnOnly=TRUE), trace = TRUE)
|
50 |
fm2 <- update(fm1, control=nls.control(tol = 1e-9, warnOnly=TRUE), trace = TRUE)
|
| 51 |
all.equal(coef(fm1), coef(fm2)) # "Mean relative difference: 9.6e-6"
|
51 |
all.equal(coef(fm1), coef(fm2)) # "Mean relative difference: 9.6e-6"
|
| 52 |
str(fm2$convInfo) # 3 iterations
|
52 |
str(fm2$convInfo) # 3 iterations
|
| 53 |
}%dont
|
53 |
}%donttest
|
| 54 |
}
|
- |
|
| 55 |
|
54 |
|
| 56 |
dwlg1 <- data.frame(Prop = c(rep(0,5), 2, 5, rep(9, 9)), end = 1:16)
|
55 |
dwlg1 <- data.frame(Prop = c(rep(0,5), 2, 5, rep(9, 9)), end = 1:16)
|
| 57 |
iPar <- getInitial(Prop ~ SSlogis(end, Asym, xmid, scal), data = dwlg1)
|
56 |
iPar <- getInitial(Prop ~ SSlogis(end, Asym, xmid, scal), data = dwlg1)
|
| 58 |
## failed in R <= 3.4.2 (because of the '0's in 'Prop')
|
57 |
## failed in R <= 3.4.2 (because of the '0's in 'Prop')
|
| 59 |
stopifnot(all.equal(tol = 1e-6,
|
58 |
stopifnot(all.equal(tol = 1e-6,
|