The R Project SVN R

Rev

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

Rev 68948 Rev 72321
Line 32... Line 32...
32
  Originally from Marske (1967), \emph{Biochemical
32
  Originally from Marske (1967), \emph{Biochemical
33
    Oxygen Demand Data Interpretation Using Sum of Squares Surface}
33
    Oxygen Demand Data Interpretation Using Sum of Squares Surface}
34
  M.Sc. Thesis, University of Wisconsin -- Madison.
34
  M.Sc. Thesis, University of Wisconsin -- Madison.
35
}
35
}
36
\examples{
36
\examples{
37
\testonly{options(show.nls.convergence=FALSE)
37
\dontshow{options(show.nls.convergence=FALSE)
38
old <- options(digits = 5)}
38
old <- options(digits = 5)}
39
require(stats)
39
require(stats)
40
# simplest form of fitting a first-order model to these data
40
# simplest form of fitting a first-order model to these data
41
fm1 <- nls(demand ~ A*(1-exp(-exp(lrc)*Time)), data = BOD,
41
fm1 <- nls(demand ~ A*(1-exp(-exp(lrc)*Time)), data = BOD,
42
   start = c(A = 20, lrc = log(.35)))
42
   start = c(A = 20, lrc = log(.35)))
Line 46... Line 46...
46
fm2 <- nls(demand ~ (1-exp(-exp(lrc)*Time)), data = BOD,
46
fm2 <- nls(demand ~ (1-exp(-exp(lrc)*Time)), data = BOD,
47
   start = c(lrc = log(.35)), algorithm = "plinear", trace = TRUE)
47
   start = c(lrc = log(.35)), algorithm = "plinear", trace = TRUE)
48
# using a self-starting model
48
# using a self-starting model
49
fm3 <- nls(demand ~ SSasympOrig(Time, A, lrc), data = BOD)
49
fm3 <- nls(demand ~ SSasympOrig(Time, A, lrc), data = BOD)
50
summary(fm3)
50
summary(fm3)
51
\testonly{options(old)}
51
\dontshow{options(old)}
52
}
52
}
53
\keyword{datasets}
53
\keyword{datasets}