aboutsummaryrefslogtreecommitdiff
path: root/R/endpoints.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-11-08 07:56:50 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2022-11-08 07:56:50 +0100
commit7186006740aca909660e42dce8d92eb4735af533 (patch)
tree9a761988132a652301bc35e7935bd5827e82c4af /R/endpoints.R
parentf9343a9f401dce52188fceec456865ba4f2eb95f (diff)
Simplify SFORB also in the endpoint function
Diffstat (limited to 'R/endpoints.R')
-rw-r--r--R/endpoints.R21
1 files changed, 10 insertions, 11 deletions
diff --git a/R/endpoints.R b/R/endpoints.R
index e81e7a0a..227671b5 100644
--- a/R/endpoints.R
+++ b/R/endpoints.R
@@ -10,18 +10,17 @@
#' Additional DT50 values are calculated from the FOMC DT90 and k1 and k2 from
#' HS and DFOP, as well as from Eigenvalues b1 and b2 of any SFORB models
#'
-#' @param fit An object of class [mkinfit], [nlme.mmkin] or [saem.mmkin],
-#' or another object that has list components
-#' mkinmod containing an [mkinmod] degradation model, and two numeric vectors,
-#' bparms.optim and bparms.fixed, that contain parameter values
-#' for that model.
+#' @param fit An object of class [mkinfit], [nlme.mmkin] or [saem.mmkin], or
+#' another object that has list components mkinmod containing an [mkinmod]
+#' degradation model, and two numeric vectors, bparms.optim and bparms.fixed,
+#' that contain parameter values for that model.
#' @importFrom stats optimize
-#' @return A list with a matrix of dissipation times named distimes,
-#' and, if applicable, a vector of formation fractions named ff
-#' and, if the SFORB model was in use, a vector of eigenvalues
-#' of these SFORB models, equivalent to DFOP rate constants
+#' @return A list with a matrix of dissipation times named distimes, and, if
+#' applicable, a vector of formation fractions named ff and, if the SFORB model
+#' was in use, a vector of eigenvalues of these SFORB models, equivalent to
+#' DFOP rate constants
#' @note The function is used internally by [summary.mkinfit],
-#' [summary.nlme.mmkin] and [summary.saem.mmkin].
+#' [summary.nlme.mmkin] and [summary.saem.mmkin].
#' @author Johannes Ranke
#' @examples
#'
@@ -160,7 +159,7 @@ endpoints <- function(fit) {
k_12 = degparms[paste("k", obs_var, "free", "bound", sep="_")]
k_21 = degparms[paste("k", obs_var, "bound", "free", sep="_")]
- sqrt_exp = sqrt(1/4 * (k_12 + k_21 + k_1output)^2 + k_12 * k_21 - (k_12 + k_1output) * k_21)
+ sqrt_exp = sqrt(1/4 * (k_12 + k_21 + k_1output)^2 - k_1output * k_21)
b1 = 0.5 * (k_12 + k_21 + k_1output) + sqrt_exp
b2 = 0.5 * (k_12 + k_21 + k_1output) - sqrt_exp

Contact - Imprint