diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2014-07-02 17:30:56 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2014-07-02 17:30:56 +0200 |
commit | 4bf5aeb552bab6e4fac98acf0b590e3f46e53354 (patch) | |
tree | 50091f6e0de85ff91721b7a993e96032ad4ae8b8 /R | |
parent | e4dc404220b9a867d73d5aa11f7d52673c8a67db (diff) |
Set implicit formation fraction to 1 even if set otherwise in parms.ini
Diffstat (limited to 'R')
-rw-r--r-- | R/mkinfit.R | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/R/mkinfit.R b/R/mkinfit.R index ae30be43..8ad91981 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -110,6 +110,14 @@ mkinfit <- function(mkinmod, observed, if (mkinmod$use_of_ff == "max") {
for (box in mod_vars) {
f_names <- mkinmod$parms[grep(paste0("^f_", box), mkinmod$parms)]
+ # When we have no sink and only one pathway, we get an implicitly
+ # fixed parameter which we need in the model
+ if (!mkinmod$spec[[box]]$sink && length(f_names) == 1) {
+ if (f_names %in% names(parms.ini)) warning("Setting ", f_names, " to 1")
+ parms.ini[f_names] = 1
+ defaultpar.names <- setdiff(defaultpar.names, f_names)
+ f_fixed_implicit[f_names] = 1
+ }
f_default_names <- intersect(f_names, defaultpar.names)
f_specified_names <- setdiff(f_names, defaultpar.names)
sum_f_specified = sum(parms.ini[f_specified_names])
@@ -119,13 +127,7 @@ mkinfit <- function(mkinmod, observed, }
if (mkinmod$spec[[box]]$sink) n_unspecified = length(f_default_names) + 1
else {
- # When we have no sink and only one pathway, we get an implicitly
- # fixed parameter which we need in the model
n_unspecified = length(f_default_names)
- if (length(f_names) == 1) {
- f_fixed_implicit[f_names] = 1
- fixed_parms = c(fixed_parms, f_names)
- }
}
parms.ini[f_default_names] <- (1 - sum_f_specified) / n_unspecified
}
|