From a69bf39427ff4f93eebdc8bceacb8174ff13c085 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 14 Jul 2014 19:07:54 +0200 Subject: Nearly complete support for IORE, pending mkinerrmin --- R/mkinerrmin.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'R/mkinerrmin.R') 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 } -- cgit v1.2.1