The R Project SVN R

Rev

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

Rev 54233 Rev 61010
Line 31... Line 31...
31
    if(nrow(xy) < 3) stop("Too few distinct input values to fit a logistic")
31
    if(nrow(xy) < 3) stop("Too few distinct input values to fit a logistic")
32
    Asym <- max(abs(xy[,"y"]))
32
    Asym <- max(abs(xy[,"y"]))
33
    if (Asym != max(xy[,"y"])) Asym <- -Asym  # negative asymptote
33
    if (Asym != max(xy[,"y"])) Asym <- -Asym  # negative asymptote
34
    xmid <- NLSstClosestX(xy, 0.5 * Asym)
34
    xmid <- NLSstClosestX(xy, 0.5 * Asym)
35
    scal <- NLSstClosestX(xy, 0.75 * Asym) - xmid
35
    scal <- NLSstClosestX(xy, 0.75 * Asym) - xmid
36
    value <- c(Asym, xmid, scal)
36
    setNames(c(Asym, xmid, scal),
37
    names(value) <- mCall[c("Asym", "xmid", "scal")]
37
	     mCall[c("Asym", "xmid", "scal")])
38
    value
-
 
39
}
38
}
40
logist <- selfStart(logist, initial = logistInit) ##-> Error in R 1.5.0
39
logist <- selfStart(logist, initial = logistInit) ##-> Error in R 1.5.0
41
str(logist)
40
str(logist)
42
 
41
 
43
## lower and upper in algorithm="port"
42
## lower and upper in algorithm="port"