diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2019-02-22 09:46:39 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2019-02-22 09:46:39 +0100 |
commit | 39d5dc6988389f026d5165cac208ec63d0645a77 (patch) | |
tree | 9ad604208a70d9ff01fd3e77febbe3a7080dee06 /R | |
parent | 5181a55b1619c153b690db97ee82698bf76525ff (diff) |
Further adaptations for the logistic model
- Make mmkin compatible
- Return DT50 values corresponding to k0 and kmax
- Turn incompatible parameter names in parms.ini from an error to a
warning, in order to make it possible to use this argument in calls to
mmkin
Diffstat (limited to 'R')
-rw-r--r-- | R/endpoints.R | 5 | ||||
-rw-r--r-- | R/mkinfit.R | 4 | ||||
-rw-r--r-- | R/mmkin.R | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/R/endpoints.R b/R/endpoints.R index 80450185..f8a44c4d 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -166,6 +166,11 @@ endpoints <- function(fit) { r = parms.all["r"]
DT50 = (1/r) * log(1 - ((kmax/k0) * (1 - 2^(r/kmax))))
DT90 = (1/r) * log(1 - ((kmax/k0) * (1 - 10^(r/kmax))))
+
+ DT50_k0 = log(2)/k0
+ DT50_kmax = log(2)/kmax
+ ep$distimes[obs_var, c("DT50_k0")] = DT50_k0
+ ep$distimes[obs_var, c("DT50_kmax")] = DT50_kmax
}
ep$distimes[obs_var, c("DT50", "DT90")] = c(DT50, DT90)
}
diff --git a/R/mkinfit.R b/R/mkinfit.R index 40413125..2dec3a72 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -99,10 +99,10 @@ mkinfit <- function(mkinmod, observed, # Define starting values for parameters where not specified by the user
if (parms.ini[[1]] == "auto") parms.ini = vector()
- # Prevent inital parameter specifications that are not in the model
+ # Warn for inital parameter specifications that are not in the model
wrongpar.names <- setdiff(names(parms.ini), mkinmod$parms)
if (length(wrongpar.names) > 0) {
- stop("Initial parameter(s) ", paste(wrongpar.names, collapse = ", "),
+ warning("Initial parameter(s) ", paste(wrongpar.names, collapse = ", "),
" not used in the model")
}
@@ -1,4 +1,4 @@ -# Copyright (C) 2015 Johannes Ranke +# Copyright (C) 2015,2019 Johannes Ranke # Contact: jranke@uni-bremen.de # The summary function is an adapted and extended version of summary.modFit # from the FME package, v 1.1 by Soetart and Petzoldt, which was in turn @@ -22,7 +22,7 @@ mmkin <- function(models = c("SFO", "FOMC", "DFOP"), datasets, cores = round(detectCores()/2), cluster = NULL, ...) { - parent_models_available = c("SFO", "FOMC", "DFOP", "HS", "SFORB", "IORE") + parent_models_available = c("SFO", "FOMC", "DFOP", "HS", "SFORB", "IORE", "logistic") n.m <- length(models) n.d <- length(datasets) n.fits <- n.m * n.d |