findBestHillModel {basicdrm} | R Documentation |
Selects a best-fitting Hill model given defaults
Description
Using the function fitHillModel()
, this function fits four Hill models
with minimal and maximal effects either varying or fixed at the given
default values; it then selects the best fitting model based on the Bayesian
information criterio or Akaike information criterion, and returns a Hill fit
object with information from all fits included.
Usage
findBestHillModel(
formula,
data,
defaults,
weights = NULL,
start = NULL,
direction = 0,
lower = NULL,
upper = NULL,
useBIC = TRUE
)
Arguments
formula |
Either an object of class |
data |
If |
defaults |
A two value numeric vector containing the default minimal effect and the default maximal effect, in that order |
weights |
A vector of weights (between 0 and 1) the same length as
|
start |
A vector of four starting values for the Hill model to be fit.
Any values not being fit will be fixed at these starting values. If left as
|
direction |
Determines the possible directionality of the dose response model. If 0 (the default) no additional constraints are placed on the parameters. If greater than 0, the fitting will require that the maximal effect is greater than the minimal effect. If less than 0, the fitting wll require tha the maximal effect is less than the minimal effect. |
lower |
A length-four vector of lower bounds on the Hill parameter
values. Any parameters for which you do not wish to specify a bound can be
set to |
upper |
A vector of upper bounds on the Hill parameter values. Works
the same as parameter |
useBIC |
Determines the information criterion to be used. If |
Value
An object of class hillrm
. Contains all of the values found in
any hillrm
object (see fitHillModel()
), as well as allfits
, a named
list of lists containing the coefficients
and par
vectors for each of the
individual fits, as well as the Bayesian information criterion (bic
) and
Akaike informtion criterion (aic
) values for each fit.
Examples
conc <- c(0,2^(-6:3),Inf)
hpar <- c(1,3,0,75)
response <- evalHillModel(conc, hpar) + rnorm(length(conc),sd=7.5)
hfit <- findBestHillModel(conc,response,defaults=c(0,100))