diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2014-07-25 09:36:15 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2014-07-25 09:36:15 +0200 |
commit | e5c955f82adf6139d76f842a0b85e5d383685793 (patch) | |
tree | d81f00619d581a0d1e02cccc873595a1d2148e83 | |
parent | f9e3f7964623530983f8c0665df06602d6283ff7 (diff) |
Fix internal naming of g for transform_fractions=FALSE
-rw-r--r-- | DESCRIPTION | 2 | ||||
-rw-r--r-- | NEWS.md | 4 | ||||
-rw-r--r-- | R/transform_odeparms.R | 15 |
3 files changed, 18 insertions, 3 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index bf0fa09a..02480e56 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,7 +3,7 @@ Type: Package Title: Routines for fitting kinetic models with one or more state variables to chemical degradation data Version: 0.9-33 -Date: 2014-07-24 +Date: 2014-07-25 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de"), person("Katrin", "Lindenberger", role = "ctb"), @@ -4,6 +4,10 @@ - The initial value (state.ini) for the observed variable with the highest observed residue is set to 100 in case it has no time zero observation and `state.ini = "auto"` +## BUG FIXES + +- `mkinfit()`: The internally fitted parameter for `g` was named `g_ilr` even when `transform_fractions=FALSE` + # CHANGES in mkin VERSION 0.9-32 ## NEW FEATURES diff --git a/R/transform_odeparms.R b/R/transform_odeparms.R index f518ae32..e64bac59 100644 --- a/R/transform_odeparms.R +++ b/R/transform_odeparms.R @@ -76,9 +76,15 @@ transform_odeparms <- function(parms, mkinmod, }
}
}
+
+ # DFOP parameter g is treated as a fraction
if (!is.na(parms["g"])) {
g <- parms["g"]
- transparms["g_ilr"] <- ifelse(transform_fractions, ilr(c(g, 1 - g)), g)
+ if (transform_fractions) {
+ transparms["g_ilr"] <- ilr(c(g, 1 - g))
+ } else {
+ transparms["g"] <- g
+ }
}
return(transparms)
@@ -145,9 +151,14 @@ backtransform_odeparms <- function(transparms, mkinmod, }
}
}
+
+ # DFOP parameter g is treated as a fraction
if (!is.na(transparms["g_ilr"])) {
g_ilr <- transparms["g_ilr"]
- parms["g"] <- ifelse(transform_fractions, invilr(g_ilr)[1], g_ilr)
+ parms["g"] <- invilr(g_ilr)[1]
+ }
+ if (!is.na(transparms["g"])) {
+ parms["g"] <- transparms["g"]
}
return(parms)
|