aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2012-05-16 12:13:22 +0000
committerjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2012-05-16 12:13:22 +0000
commit9a42d69ee1a3181eab55da21dddcb766622a3865 (patch)
treeabe0cbd97e3d478cd821ef75c4f249a6461f4506 /R
parenta6694c655fde246dd4d59b44fd10b22738b3fb08 (diff)
Fixed a bug in mkinmod that produced a erroneous coefficient matrix if more than one SFORB submodel is used
git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@38 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
Diffstat (limited to 'R')
-rw-r--r--R/mkinmod.R11
1 files changed, 7 insertions, 4 deletions
diff --git a/R/mkinmod.R b/R/mkinmod.R
index 41dbefa8..c7f11d96 100644
--- a/R/mkinmod.R
+++ b/R/mkinmod.R
@@ -193,8 +193,12 @@ mkinmod <- function(..., use_of_ff = "min")
} else { # off-diagonal elements
k.candidate = paste("k", from, to, sep="_")
- k.candidate = sub("free.*bound", "free_bound", k.candidate)
- k.candidate = sub("bound.*free", "bound_free", k.candidate)
+ if (sub("_free$", "", from) == sub("_bound$", "", to)) {
+ k.candidate = paste("k", sub("_free$", "_free_bound", from), sep="_")
+ }
+ if (sub("_bound$", "", from) == sub("_free$", "", to)) {
+ k.candidate = paste("k", sub("_bound$", "_bound_free", from), sep="_")
+ }
k.effective = intersect(model$parms, k.candidate)
m[to, from] = ifelse(length(k.effective) > 0,
k.effective, "0")
@@ -218,8 +222,7 @@ mkinmod <- function(..., use_of_ff = "min")
} else { # off-diagonal elements
f.candidate = paste("f", from, "to", to, sep="_")
k.candidate = paste("k", from, to, sep="_")
- k.candidate = sub("free.*bound", "free_bound", k.candidate)
- k.candidate = sub("bound.*free", "bound_free", k.candidate)
+ # SFORB with maximum use of formation fractions not implemented, see above
m[to, from] = ifelse(f.candidate %in% model$parms,
paste(f.candidate, " * k_", from, sep=""),
ifelse(k.candidate %in% model$parms, k.candidate, "0"))

Contact - Imprint