diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2014-07-23 08:34:59 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2014-07-23 08:34:59 +0200 |
commit | 4c6f29fe2a3ece5a85160b891c89ce0f55299c11 (patch) | |
tree | 95d221aef9349dbb5c068c6055eb073cdfdca59b | |
parent | 651fe9a90eb814a9533309d938c9e830c2ee4b8c (diff) |
Parallel metabolite formation with formation fractions in mkinerrmin
-rw-r--r-- | DESCRIPTION | 2 | ||||
-rw-r--r-- | NEWS.md | 4 | ||||
-rw-r--r-- | R/mkinerrmin.R | 7 | ||||
-rw-r--r-- | TODO | 1 |
4 files changed, 10 insertions, 4 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index bad72501..de9ff203 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-32 -Date: 2014-07-21 +Date: 2014-07-23 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de"), person("Katrin", "Lindenberger", role = "ctb"), @@ -2,6 +2,8 @@ ## NEW FEATURES +- The number of degrees of freedom is difficult to define in the case of ilr transformation of formation fractions. Now for each source compartment the number of ilr parameters (=number of optimised parameters) is divided by the number of pathways to metabolites (=number of affected data series) which leads to fractional degrees of freedom in some cases. + - The default for the initial value for the first state value is now taken from the mean of the observations at time zero, if available. - The kinetic model can alternatively be specified with a shorthand name for parent only degradation models, e.g. `SFO`, or `DFOP`. @@ -14,6 +16,8 @@ ## BUG FIXES +- In the determination of the degrees of freedom in `mkinerrmin`, formation fractions were accounted for multiple times in the case of parallel formation of metabolites. See the new feature described above for the solution. + - `transform_rates=FALSE` in `mkinfit` now also works for FOMC and HS models. - Initial values for formation fractions were not set in all cases. diff --git a/R/mkinerrmin.R b/R/mkinerrmin.R index 9ebac6a4..09724730 100644 --- a/R/mkinerrmin.R +++ b/R/mkinerrmin.R @@ -65,11 +65,12 @@ mkinerrmin <- function(fit, alpha = 0.05) # Formation fractions are attributed to the target variable, so look
# for source compartments with formation fractions
for (source_var in fit$obs_vars) {
+ n.ff.source = length(grep(paste("^f", source_var, sep = "_"),
+ names(parms.optim)))
+ n.paths.source = length(fit$mkinmod$spec[[source_var]]$to)
for (target_var in fit$mkinmod$spec[[source_var]]$to) {
if (obs_var == target_var) {
- n.ff.optim <- n.ff.optim +
- length(grep(paste("^f", source_var, sep = "_"),
- names(parms.optim)))
+ n.ff.optim <- n.ff.optim + n.ff.source/n.paths.source
}
}
}
@@ -3,6 +3,7 @@ TODO for version 1.0 - Complete the main package vignette named mkin to include a method description - Improve formatting of differential equations in the summary - Improve order of parameters in output +- Write unit tests for mkinerrmin Nice to have: - Calculate confidence intervals for DT50 and DT90 values when only one |