View source: R/tcplfit_hillbase.R
fit_modls | R Documentation |
A convenient function to fit data using available models and to sort the outcomes by AIC values.
fit_modls(Conc, Resp, Mask = NULL, modls = c("hill", "cnst"), ...)
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. Multiple values are allowed. Currently Hill model (hill) and constant model (cnst) are implemented. Default = c("hill", "cnst"). |
... |
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. |
The backbone of fit using hill and cnst is based on the implementation from tcpl package. But the lower bound of ga is lower by log10(1/100).
A list of components named by the models. The models are sorted by their AIC values. Thus, the first component has the best fit.
Fit output from Hill equation
modl: model type, i.e., hill
fit: fittable, 1 (yes) or 0 (no)
aic: AIC value
tp: model top, <0 means the fit for decreasing direction is preferred
ga: ac50 (log10 scale)
gw: Hill coefficient
er: scale term for Student's t distribution
Fit output from constant model
modl: model type, i.e., cnst
fit: fittable?, 1 or 0
aic: AIC value
er: scale term
tcpl::tcplObjHill()
, tcpl::tcplObjCnst()
, get_hill_fit_config()
concd <- c(-9, -8, -7, -6, -5, -4) respd <- c(0, 2, 30, 40, 50, 60) 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 with mask at the highest concentration fit_modls(concd, respd, maskd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.