aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2013-11-04 20:08:22 +0000
committerjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2013-11-04 20:08:22 +0000
commitfb769cb42bc269839af7ed97c88212681e5c285a (patch)
treeb2a6550435b58b2ef89233312ff10128003287e8
parentbe2db49bc0252ce289f8ec563efb38150941acb2 (diff)
Add small random numbers to default initial values for rate constants to avoid
numerical artefacts occurring in eigenvalue based solutions. git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@135 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
-rw-r--r--R/mkinfit.R4
1 files changed, 2 insertions, 2 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R
index 635ec292..2012755f 100644
--- a/R/mkinfit.R
+++ b/R/mkinfit.R
@@ -60,7 +60,7 @@ mkinfit <- function(mkinmod, observed,
defaultpar.names <- setdiff(mkinmod$parms, names(parms.ini))
for (parmname in defaultpar.names) {
# Default values for rate constants, depending on the parameterisation
- if (substr(parmname, 1, 2) == "k_") parms.ini[parmname] = 0.1
+ if (substr(parmname, 1, 2) == "k_") parms.ini[parmname] = 0.1 + runif(1)/1e6
# Default values for rate constants for reversible binding
if (grepl("free_bound$", parmname)) parms.ini[parmname] = 0.1
if (grepl("bound_free$", parmname)) parms.ini[parmname] = 0.02
@@ -115,7 +115,7 @@ mkinfit <- function(mkinmod, observed,
solution_type = "analytical"
} else {
if (is.matrix(mkinmod$coefmat)) {
- solution_type = "eigen"
+ solution_type = "eigen"
if (max(observed$value, na.rm = TRUE) < 0.1) {
stop("The combination of small observed values (all < 0.1) and solution_type = eigen is error-prone")
}

Contact - Imprint