parms: Extract model parameters

View source: R/parms.R

parmsR Documentation

Extract model parameters

Description

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.

Usage

parms(object, ...)

## S3 method for class 'mkinfit'
parms(object, transformed = FALSE, errparms = TRUE, ...)

## S3 method for class 'mmkin'
parms(object, transformed = FALSE, errparms = TRUE, ...)

## S3 method for class 'multistart'
parms(object, exclude_failed = TRUE, ...)

## S3 method for class 'saem.mmkin'
parms(object, ci = FALSE, covariates = NULL, ...)

Arguments

object

A fitted model object.

...

Not used

transformed

Should the parameters be returned as used internally during the optimisation?

errparms

Should the error model parameters be returned in addition to the degradation parameters?

exclude_failed

For multistart objects, should rows for failed fits be removed from the returned parameter matrix?

ci

Should a matrix with estimates and confidence interval boundaries be returned? If FALSE (default), a vector of estimates is returned if no covariates are given, otherwise a matrix of estimates is returned, with each column corresponding to a row of the data frame holding the covariates

covariates

A data frame holding covariate values for which to return parameter values. Only has an effect if 'ci' is FALSE.

Value

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).

See Also

saem, multistart

Examples

# mkinfit objects
fit <- mkinfit("SFO", FOCUS_2006_C, quiet = TRUE)
parms(fit)
parms(fit, transformed = TRUE)

# mmkin objects
ds <- lapply(experimental_data_for_UBA_2019[6:10],
 function(x) subset(x$data[c("name", "time", "value")]))
names(ds) <- paste("Dataset", 6:10)
## Not run: 
fits <- mmkin(c("SFO", "FOMC", "DFOP"), ds, quiet = TRUE, cores = 1)
parms(fits["SFO", ])
parms(fits[, 2])
parms(fits)
parms(fits, transformed = TRUE)

## End(Not run)

jranke/mkin documentation built on Jan. 13, 2024, 4:59 a.m.