diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2019-10-26 20:50:09 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2019-10-26 20:50:09 +0200 |
commit | 7b7729694363515007193d1c3e29e9b76271abb3 (patch) | |
tree | 3aa572fb56d26d4ad53463e320ee9e75ff4a2321 /R/parms.mkinfit.R | |
parent | af2e1540cdad2fd00bb6216a38a754ff748629ad (diff) |
parms and confint methods
The confint method can do profile likelihood based confidence intervals!
Diffstat (limited to 'R/parms.mkinfit.R')
-rw-r--r-- | R/parms.mkinfit.R | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/R/parms.mkinfit.R b/R/parms.mkinfit.R new file mode 100644 index 00000000..250d9d1f --- /dev/null +++ b/R/parms.mkinfit.R @@ -0,0 +1,24 @@ +#' 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 complete Unused argument for compatibility with the generic coef function from base R +#' @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 +#' @export +parms.mkinfit <- function(object, transformed = FALSE, ...) +{ + if (transformed) object$par + else c(object$bparms.optim, object$errparms) +} |