fit_modls {Rcurvep}R Documentation

Fit one set of concentration-response data using types of models

Description

A convenient function to fit data using available models and to sort the outcomes by AIC values.

Usage

fit_modls(Conc, Resp, Mask = NULL, modls, ...)

Arguments

Conc

A vector of log10 concentrations.

Resp

A vector of numeric responses.

Mask

Default = NULL or a vector of 1 or 0. 1 is for masking the respective response.

modls

The model types for the fitting. Currently available models are 3-parameter Hill model (hill), constant model (cnst), and Curve Class2 4-parameter Hill model (cc2). Multiple values are only allowed for the hill and cnst combination.

...

The named input configurations for replacing the default configurations. The input configuration needs to add model type as the prefix. For example, hill_pdir = -1 will set the Hill fit only to the decreasing direction. Another common parameter for cc2 model is cc2_classSD. The default value of cc2_classSD is 5%, which might be too small for noiser endpoints.

Details

The backbone of fit method using hill (3-parameter Hill model) and cnst (constant model) is based on the implementation from tcpl package. But the lower bound of ga is lower by log10(1/100). The cc2 model is the 4-parameter Hill model from Curve Class2.

Value

A list of components named by the models. The models are sorted by their AIC values (when multiple models are used). Thus, the first component has the best fit.

hill

Fit output from Hill equation

cnst

Fit output from constant model

cc2

Fit output from Curve Class 2 model

See Also

tcpl::tcplObjHill(), tcpl::tcplObjCnst(), get_hill_fit_config() fit_cc2_modl()

Examples


concd <- c(-9, -8, -7, -6, -5, -4)
respd <- c(0, 2, 30, 40, 50, 20)
maskd <- c(0, 0, 0, 0, 0, 1)

# run hill only
fit_modls(concd, respd, modls = "hill")

# run hill only + increasing direction only
fit_modls(concd, respd, modls = "hill", hill_pdir = 1)

# run cc2 only + change of classSD
fit_modls(concd, respd, modls = "cc2", cc2_classSD = 10)

# run hill + cnst
fit_modls(concd, respd, modls = c("hill", "cnst"))

# run with mask at the highest concentration
fit_modls(concd, respd, maskd, modls = "hill")



[Package Rcurvep version 1.3.1 Index]