blob: 281d06de23625282c942cce42e8a054fb12eb88d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#' Extract model parameters from mkinfit models
#'
#' 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.
#'
#' @param object A fitted model object
#' @param \dots Not used
#' @return A numeric vector of fitted model parameters
#' @export
parms <- function(object, ...)
{
UseMethod("parms", object)
}
#' @param transformed Should the parameters be returned
#' as used internally during the optimisation?
#' @rdname parms
#' @examples
#' fit <- mkinfit("SFO", FOCUS_2006_C)
#' parms(fit)
#' parms(fit, transformed = TRUE)
#' @export
parms.mkinfit <- function(object, transformed = FALSE, ...)
{
if (transformed) object$par
else c(object$bparms.optim, object$errparms)
}
|