aboutsummaryrefslogtreecommitdiff
path: root/R/mkinerrmin.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2014-07-14 19:07:54 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2014-07-14 19:07:54 +0200
commita69bf39427ff4f93eebdc8bceacb8174ff13c085 (patch)
treec5fcafef941417941db880b119a0452f19a3a51b /R/mkinerrmin.R
parent59f96473c7ee7b00f8b4fe5bd8d866ad6cadd048 (diff)
Nearly complete support for IORE, pending mkinerrmin
Diffstat (limited to 'R/mkinerrmin.R')
-rw-r--r--R/mkinerrmin.R8
1 files changed, 5 insertions, 3 deletions
diff --git a/R/mkinerrmin.R b/R/mkinerrmin.R
index 671bcaab..d89a2f91 100644
--- a/R/mkinerrmin.R
+++ b/R/mkinerrmin.R
@@ -55,13 +55,15 @@ mkinerrmin <- function(fit, alpha = 0.05)
# Check if initial value is optimised
n.initials.optim <- length(grep(paste(obs_var, ".*", "_0", sep=""), names(parms.optim)))
- # Rate constants are attributed to the source variable
+ # Rate constants and IORE exponents are attributed to the source variable
n.k.optim <- length(grep(paste("^k", obs_var, sep="_"), names(parms.optim)))
+ n.k.iore.optim <- length(grep(paste("^k.iore", obs_var, sep="_"), names(parms.optim)))
+ n.N.optim <- length(grep(paste("^N", obs_var, sep="_"), names(parms.optim)))
# Formation fractions are attributed to the target variable
n.ff.optim <- length(grep(paste("^f", ".*", obs_var, "$", sep=""), names(parms.optim)))
- n.optim <- n.k.optim + n.initials.optim + n.ff.optim
+ n.optim <- sum(n.initials.optim, n.k.optim, n.k.iore.optim, n.N.optim, n.ff.optim)
# FOMC, DFOP and HS parameters are only counted if we are looking at the
# first variable in the model which is always the source variable
@@ -74,7 +76,7 @@ mkinerrmin <- function(fit, alpha = 0.05)
if ("tb" %in% names(parms.optim)) n.optim <- n.optim + 1
}
- # Calculate and add a line to the results
+ # Calculate and add a line to the dataframe holding the results
errmin.tmp <- kinerrmin(errdata.var, n.optim)
errmin[obs_var, c("err.min", "n.optim", "df")] <- errmin.tmp
}

Contact - Imprint