aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorranke <ranke@d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc>2007-03-29 11:57:20 +0000
committerranke <ranke@d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc>2007-03-29 11:57:20 +0000
commitcdd44b9e4f71b05f5bec46e4b12e6bb2567ecc30 (patch)
treeba39bffa9e680ff9eb97ccf7aa23a9d88e270d5b /R
parentd311733c45526f6fe6b5459ffc37d2bbb15f6eae (diff)
Now using the "port" algorithm for the model fitting
by nls, because in some cases it converges when the default algorithm does not. git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/drfit@87 d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc
Diffstat (limited to 'R')
-rw-r--r--R/drfit.R8
1 files changed, 4 insertions, 4 deletions
diff --git a/R/drfit.R b/R/drfit.R
index 1414499..3bd9021 100644
--- a/R/drfit.R
+++ b/R/drfit.R
@@ -72,7 +72,7 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
length(subset(linlogitWrong,linlogitWrong == i))==0 &&
length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ linlogitf(dose,1,f,logED50,b),
- data=tmp,
+ data=tmp, algorithm="port",
start=list(f=f0,logED50=startlogED50[[i]],b=b0)))
if (!inherits(m, "try-error")) {
fit <- TRUE
@@ -114,7 +114,7 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
if (probit &&
length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ pnorm(-log10(dose),-logED50,scale),
- data=tmp,
+ data=tmp, algorithm="port",
start=list(logED50=startlogED50[[i]],scale=ps0)))
if (chooseone==FALSE || fit==FALSE) {
if (!inherits(m, "try-error")) {
@@ -157,7 +157,7 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
if (logit &&
length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ plogis(-log10(dose),-logED50,scale),
- data=tmp,
+ data=tmp, algorithm="port",
start=list(logED50=startlogED50[[i]],scale=ls0)))
if (chooseone==FALSE || fit==FALSE) {
if (!inherits(m, "try-error")) {
@@ -199,7 +199,7 @@ drfit <- function(data, startlogED50 = NA, chooseone=TRUE,
if (weibull &&
length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ pweibull(-log10(dose)+location,shape),
- data=tmp,
+ data=tmp, algorithm="port",
start=list(location=startlogED50[[i]],shape=ws0)))
if (chooseone==FALSE || fit==FALSE) {
if (!inherits(m, "try-error")) {

Contact - Imprint