aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/multistart.R8
-rw-r--r--R/parms.mkinfit.R19
2 files changed, 13 insertions, 14 deletions
diff --git a/R/multistart.R b/R/multistart.R
index 94292e82..52f279f0 100644
--- a/R/multistart.R
+++ b/R/multistart.R
@@ -15,7 +15,7 @@
#' used?
#' @param cores How many fits should be run in parallel?
#' @param \dots Passed to the update function, or to the basic plotting
-#' function in the case of the graphical function.
+#' function in the case of the graphical functions.
#' @param x The multistart object to print
#' @param breaks Passed to [hist]
#' @param main title of the plot
@@ -66,7 +66,7 @@ parms.multistart <- function(object, ...) {
#' @rdname multistart
#' @importFrom stats median
#' @export
-parhist <- function(object, lpos = "topleft", ...) {
+parhist <- function(object, lpos = "topleft", main = "", ...) {
orig <- attr(object, "orig")
orig_parms <- parms(orig)
start_parms <- orig$mean_dp_start
@@ -79,7 +79,7 @@ parhist <- function(object, lpos = "topleft", ...) {
start_scaled_parms[names(start_parms)] <-
start_parms / median_parms[names(start_parms)]
- boxplot(all_scaled_parms, log = "y", ...)
+ boxplot(all_scaled_parms, log = "y", main = main, ...)
points(orig_scaled_parms, col = 2, cex = 2)
points(start_scaled_parms, col = 3, cex = 3)
legend(lpos, inset = c(0.05, 0.05), bty = "n",
@@ -93,7 +93,7 @@ parhist <- function(object, lpos = "topleft", ...) {
#' @rdname multistart
#' @importFrom KernSmooth bkde
#' @export
-llhist <- function(object, breaks = "Sturges", main = "", lpos = "topleft", ...) {
+llhist <- function(object, breaks = "Sturges", lpos = "topleft", main = "", ...) {
ll <- sapply(object, logLik)
kde <- KernSmooth::bkde(ll)
h <- hist(ll, freq = TRUE,
diff --git a/R/parms.mkinfit.R b/R/parms.mkinfit.R
index 31ca05bc..83766355 100644
--- a/R/parms.mkinfit.R
+++ b/R/parms.mkinfit.R
@@ -1,16 +1,15 @@
-#' Extract model parameters from mkinfit models
+#' Extract model parameters
#'
-#' This function always returns degradation model parameters as well as error
-#' model parameters, in order to avoid working with a fitted model without
-#' considering the error structure that was assumed for the fit.
+#' This function returns degradation model parameters as well as error
+#' model parameters per default, in order to avoid working with a fitted model
+#' without considering the error structure that was assumed for the fit.
#'
-#' @param object A fitted model object. Methods are implemented for
-#' [mkinfit()] objects and for [mmkin()] objects.
+#' @param object A fitted model object.
#' @param \dots Not used
-#' @return For mkinfit objects, a numeric vector of fitted model parameters.
-#' For mmkin row objects, a matrix with the parameters with a row for each
-#' dataset. If the mmkin object has more than one row, a list of such matrices
-#' is returned.
+#' @return Depending on the object, a numeric vector of fitted model parameters,
+#' a matrix (e.g. for mmkin row objects), or a list of matrices (e.g. for
+#' mmkin objects with more than one row).
+#' @seealso [saem], [multistart]
#' @examples
#' # mkinfit objects
#' fit <- mkinfit("SFO", FOCUS_2006_C, quiet = TRUE)

Contact - Imprint