The R Project SVN R

Rev

Rev 68948 | Rev 85990 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68948 Rev 73628
Line 1... Line 1...
1
% File src/library/stats/man/SSweibull.Rd
1
% File src/library/stats/man/SSweibull.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2007 R Core Team
3
% Copyright 1995-2017 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{SSweibull}
6
\name{SSweibull}
7
\title{Self-Starting Nls Weibull Growth Curve Model}
7
\title{Self-Starting Nls Weibull Growth Curve Model}
8
\usage{
8
\usage{
Line 34... Line 34...
34
  attached as an attribute named \code{gradient}.
34
  attached as an attribute named \code{gradient}.
35
}
35
}
36
\details{
36
\details{
37
  This model is a generalization of the \code{\link{SSasymp}} model in
37
  This model is a generalization of the \code{\link{SSasymp}} model in
38
  that it reduces to \code{SSasymp} when \code{pwr} is unity.
38
  that it reduces to \code{SSasymp} when \code{pwr} is unity.
39
  }
39
}
40
\author{Douglas Bates}
40
\author{Douglas Bates}
41
\references{
41
\references{
42
  Ratkowsky, David A. (1983), \emph{Nonlinear Regression Modeling},
42
  Ratkowsky, David A. (1983), \emph{Nonlinear Regression Modeling},
43
  Dekker. (section 4.4.5)
43
  Dekker. (section 4.4.5)
44
}
44
}
45
\seealso{\code{\link{nls}}, \code{\link{selfStart}}, \code{\link{SSasymp}}
45
\seealso{\code{\link{nls}}, \code{\link{selfStart}}, \code{\link{SSasymp}}
46
}
46
}
47
\examples{
47
\examples{
48
Chick.6 <- subset(ChickWeight, (Chick == 6) & (Time > 0))
48
Chick.6 <- subset(ChickWeight, (Chick == 6) & (Time > 0))
49
SSweibull(Chick.6$Time, 160, 115, -5.5, 2.5)   # response only
49
SSweibull(Chick.6$Time, 160, 115, -5.5, 2.5)   # response only
50
Asym <- 160; Drop <- 115; lrc <- -5.5; pwr <- 2.5
50
local({ Asym <- 160; Drop <- 115; lrc <- -5.5; pwr <- 2.5
51
SSweibull(Chick.6$Time, Asym, Drop, lrc, pwr)  # response and gradient
51
  SSweibull(Chick.6$Time, Asym, Drop, lrc, pwr) # response _and_ gradient
-
 
52
})
52
getInitial(weight ~ SSweibull(Time, Asym, Drop, lrc, pwr), data = Chick.6)
53
getInitial(weight ~ SSweibull(Time, Asym, Drop, lrc, pwr), data = Chick.6)
53
## Initial values are in fact the converged values
54
## Initial values are in fact the converged values
54
fm1 <- nls(weight ~ SSweibull(Time, Asym, Drop, lrc, pwr), data = Chick.6)
55
fm1 <- nls(weight ~ SSweibull(Time, Asym, Drop, lrc, pwr), data = Chick.6)
55
summary(fm1)
56
summary(fm1)
-
 
57
## Data and Fit:
-
 
58
plot(weight ~ Time, Chick.6, xlim = c(0, 21), main = "SSweibull() fit to Chick.6")
-
 
59
ux <- par("usr")[1:2]; x <- seq(ux[1], ux[2], length.out=250)
-
 
60
lines(x, do.call(SSweibull, c(list(x=x), coef(fm1))), col = "red", lwd=2)
-
 
61
As <- coef(fm1)[["Asym"]]; abline(v = 0, h = c(As, As - coef(fm1)[["Drop"]]), lty = 3)
56
}
62
}
57
\keyword{models}
63
\keyword{models}