Models in bayesnec

There are a range of models available in bayesnec and the working bnec function supports individual model fitting, as well as multi-model fitting with Bayesian model averaging.

The argument model in a bayesnecformula may be a character vector of model names or a named list of equation formulas returned by models() (see ?models for more details). If a recognised model name is provided, a single model of the specified type is fit, and bnec returns a model object of class bayesnecfit. If a vector or list of two or more of the available models is supplied, bnec returns a model object of class bayesmanecfit containing Bayesian model averaged predictions for the supplied models, providing they were successfully fitted.

Model averaging is achieved through a weighted sample of each fitted model’s posterior predictions, with weights derived using the loo_model_weights function from loo (Vehtari et al. 2026, 2017). Individual brms model fits can be extracted from the mod_fits element and can be examined individually.

The model may also be one of "all", meaning all of the available models will be fit; "ecx" meaning only models excluding the η=NEC\eta = \text{NEC} step parameter will be fit; "nec" meaning only models with a specific η=NEC\eta = \text{NEC} step parameter will be fit; "bot_free" meaning only models without a "bot" parameter (without a bottom plateau) will be fit; "zero_bounded" are models that are bounded to be zero; or "decline" excludes all hormesis models, i.e., only allows a strict decline in response across the whole predictor range, or no change, for the constant equation ecxflat (see below Parameter definitions). There are a range of other pre-defined model groups available. The full list of currently implemented model groups can be seen using:

library(bayesnec)
models()
#> $nec
#>  [1] "nec3param"     "nec4param"     "nechorme"      "nechorme4"     "necsigm"       "neclin"       
#>  [7] "neclinhorme"   "nechormepwr"   "nechorme4pwr"  "nechormepwr01"
#> 
#> $ecx
#>  [1] "ecx4param"   "ecxlin"      "ecxexp"      "ecxsigm"     "ecxwb1"      "ecxwb2"      "ecxwb1p3"   
#>  [8] "ecxwb2p3"    "ecxll5"      "ecxll4"      "ecxll3"      "ecxhormebc4" "ecxhormebc5" "ecxflat"    
#> 
#> $all
#>  [1] "nec3param"     "nec4param"     "nechorme"      "nechorme4"     "necsigm"       "neclin"       
#>  [7] "neclinhorme"   "nechormepwr"   "nechorme4pwr"  "nechormepwr01" "ecxlin"        "ecxexp"       
#> [13] "ecxsigm"       "ecx4param"     "ecxwb1"        "ecxwb2"        "ecxwb1p3"      "ecxwb2p3"     
#> [19] "ecxll5"        "ecxll4"        "ecxll3"        "ecxhormebc4"   "ecxhormebc5"   "ecxflat"      
#> 
#> $bot_free
#>  [1] "nec3param"     "nechorme"      "necsigm"       "neclin"        "neclinhorme"   "nechormepwr"  
#>  [7] "ecxlin"        "ecxexp"        "ecxsigm"       "ecxwb1p3"      "ecxwb2p3"      "ecxll3"       
#> [13] "ecxhormebc4"   "nechormepwr01"
#> 
#> $zero_bounded
#>  [1] "nec3param"     "nechorme"      "necsigm"       "nechormepwr"   "nechormepwr01" "ecxexp"       
#>  [7] "ecxsigm"       "ecxwb1p3"      "ecxwb2p3"      "ecxll3"        "ecxhormebc4"  
#> 
#> $decline
#>  [1] "nec3param" "nec4param" "neclin"    "ecxlin"    "ecxexp"    "ecxsigm"   "ecx4param" "ecxwb1"    "ecxwb2"   
#> [10] "ecxwb1p3"  "ecxwb2p3"  "ecxll5"    "ecxll4"    "ecxll3"    "ecxflat"  
#> 
#> $hormesis
#> [1] "nechorme"      "nechorme4"     "neclinhorme"   "nechormepwr"   "nechorme4pwr"  "nechormepwr01" "ecxhormebc4"  
#> [8] "ecxhormebc5"

A design with few distinct predictor concentrations may not support equations with four or five curve parameters. models(max_pars = 3) lists all equations with no more than three curve parameters. The same limit can be combined with a group, for example models("decline", max_pars = 3), and the returned list can be passed directly to the model argument of crf(), as in crf(x, models("decline", max_pars = 3)).

Parameter definitions

Where possible we have aimed for consistency in the interpretable meaning of the individual parameters across models. Across the currently implemented model set, models contain from one (the constant equation ecxflat) or two (basic linear or exponential decay, see ecxlin or ecxexp) to five possible parameters (nechorme4), including:

τ=top\tau = \text{top}, usually interpretable as either the y-intercept or the upper plateau representing the mean concentration of the response at zero concentration;

η=NEC\eta = \text{NEC}, the No-Effect-Concentration value (the x concentration value where the breakpoint in the regression is estimated at, see Model types for NEC and ECx estimation and (Fox 2010) for more details on parameter based NEC estimation);

β=beta\beta = \text{beta}, generally the exponential decay rate of response, either from 0 concentration or from the estimated η\eta value, with the exception of the neclinhorme model where it represents a linear decay from η\eta because slope (α\alpha) is required for the linear increase;

δ=bot\delta = \text{bot}, representing the lower plateau for the response at infinite concentration;

α=slope\alpha = \text{slope}, the linear decay rate in the models neclin and ecxlin, or the rate of the initial increase in the hormesis models (linear in nechorme, nechorme4, neclinhorme, ecxhormebc4 and ecxhormebc5, a power of concentration in nechormepwr and nechorme4pwr, where α\alpha sets the exponent, and logistic in nechormepwr01);

ω=EC50\omega = \text{EC}_{50}, notionally the 50% effect concentration but may be influenced by scaling and should therefore not be strictly interpreted, and

ϵ=d\epsilon = \text{d}, the exponent in the ecxsigm and necsigm models.

ϕ=f\phi = \text{f} A scaling exponent exclusive to model ecxll5.

In addition to the model parameters, all nec-containing models have a step function used to define the breakpoint in the regression, which can be defined as

f(xi,η)={0,xi−η<01,xi−η≥0 f(x_i, \eta) = \begin{cases} 0, & x_i - \eta < 0 \\ 1, & x_i - \eta \geq 0 \\ \end{cases}

Model types for NEC and ECx estimation

In principle all models provide an estimate for “no-effect” toxicity concentration. For the monotone threshold equations, nec3param, nec4param, neclin and necsigm, the NEC is estimated directly as the parameter η=NEC\eta = \text{NEC}, the concentration up to which the response stays at its control level, as per Fox (2010). Model strings with ecx as a prefix are continuous curve models with no threshold, typically used for extracting ECx values from concentration-response data. In this instance, the NEC reported is the No-Significant-Effect-Concentration (NSEC, see details in Fisher and Fox 2023), defined as the concentration at which the predicted response falls below a lower quantile of the posterior distribution of the control response, which is the predicted mean at the lowest concentration in the supplied predictor (i.e., the response value is significantly lower than that expected in the case of no exposure). The quantile is set by the sig_val argument. Its default value of 0.01 corresponds to an alpha value (Type-I error rate) of 0.01 for a one-sided test of significance. The NSEC concept has been recently explored using simulation studies and case study examples, and when combined with the NEC estimates of threshold models within a model‐ averaging approach, can yield robust estimates of N(S)EC and of their uncertainty within a single analysis framework (Fisher, Fox, et al. 2024). Both NEC and NSEC can be calculated from fitted models using the functions nec() and nsec(). The significance level used can be adjusted from the default value using amend().

The six hormesis threshold equations, nechorme, nechorme4, neclinhorme, nechormepwr, nechorme4pwr and nechormepwr01, also estimate η\eta, but in these equations it is the concentration at which the decline term starts. Where stimulation is fitted, the response at η\eta is above the control, and where the slope of the stimulation term exceeds the initial rate of decline the curve continues to rise beyond it. For these equations nec() returns the NSEC instead: the concentration at which the fitted curve, after any rise, falls below the lower sig_val quantile of the fitted control. The η\eta parameter remains available through curve_params(), where it describes the shape of the response. This use of the NSEC extends the method of Fisher and Fox (2023) from monotone to hormetic curves. When a model set combines sampled NEC estimates from monotone threshold equations with NSEC estimates from smooth or hormesis threshold equations, its model-averaged estimate is labelled N(S)EC (Fisher, Fox, et al. 2024).

ECx estimates can be equally obtained from both "nec" and "ecx" models. ECx estimates will usually be lower (more conservative) for "ecx" models fitted to the same data as "nec" models (see the Comparisons and exceedance probabilities article for an example). However, we recommend using "all" models where ECx estimation is required because "nec" models can fit some datasets better than "ecx" models and the model averaging approach will place the greatest weight for the outcome that best fits the supplied data. This approach will yield ECx estimates that are the most representative of the underlying relationship in the dataset.

Every ECx is measured from the control—the predicted mean at the lowest concentration in the supplied predictor, taken per posterior draw—and the type argument names what the percentage is measured towards. For type = "absolute" (the default) the target is 0. For type = "relative" it is the equation’s theoretical asymptote: the bot parameter where the equation has one, and 0 otherwise; it is refused where the equation has no bot and the family is unbounded below, because there is then no finite denominator. For type = "range" it is the lowest response the curve predicts over the predictor range. For type = "direct", ecx_val is a response value rather than a percentage and the concentration at which the curve reaches it is returned.

Measuring from the control is what makes an ECx well defined for a hormesis model—these allow an initial increase in the response (see Mattson 2008) and include models with the character string horme in their name. The target lies below the control and the rising limb lies above it, so the curve crosses the target exactly once. The same control reference defines the NSEC of a hormesis equation.

Model suitability for response types

Models that have an exponential decay (most models with parameter β=beta\beta = \text{beta}) with no δ=bot\delta = \text{bot} parameter are 0-bounded, because they cannot generate predictions of negative response values, and are therefore not suitable for any family modelled using a "logit" or "log" link. Conversely, models with a linear decay (containing the string lin in their name) are not suitable for modelling families that are 0-bounded (Gamma, Poisson, Negative Binomial, Beta, Binomial, Beta-Binomial) using an "identity" link. These restrictions do not need to be controlled by the user, as a call to bnec with model = "all" in the formula will simply exclude inappropriate models, albeit with a message.

Fisher, Barneche, et al. (2024) also describe the 0-bounded models as not suitable for the Gaussian family. That restriction has been relaxed since publication, and bnec fits these models to a Gaussian response. A Gaussian mean is unconstrained, because the data enter the likelihood only through the residual, so a curve that cannot fall below zero is still a valid description of a response that can. This allows a lower asymptote fixed at zero (representing, for example, complete inhibition of algal growth rate) to be fitted to measurements that include negative values without first replacing them. The Modelling growth data and other potentially negative response values article sets out the reasoning, and compares fitting the measurements as recorded with altering them first, for example by replacing negative values with zero.

An exclusion also applies to the 0, 1-bounded families (Binomial, Beta and Beta-Binomial) on an "identity" link, and two of the hormesis equations are excluded by it. nechormepwr and nechorme4pwr include the hormesis term xi1/(1+eα)x_i^{1/(1+e^{\alpha})}, which has no coefficient to shrink it. The term approaches 1 as α\alpha grows, at every concentration above zero, so for any τ\tau above zero there is an α\alpha at which the mean exceeds 1. That holds whatever the predictor range, which is why the exclusion does not depend on the data supplied. The other hormesis equations — nechorme, nechorme4, nechormepwr01, ecxhormebc4 and ecxhormebc5 — are fitted on these families, because their increase prior to η\eta is scaled by a parameter. The initial-value search starts them inside the support: it draws from the priors, and accepts a draw only where the whole initial curve falls within a band built from the replicated level means and their spread, intersected with the support of the mean.

Where the predictor includes negative values, ecxsigm, necsigm, nechormepwr and nechorme4pwr, each of which includes a fractional power, are also dropped. The predictor is checked on the scale the model is fitted on, so they are dropped from a fit using crf(log(x), ...) whenever a concentration is below 1.

Model definitions

ECx models

Figure 1 shows the shape of each equation whose name begins with ecx.

A grid of panels, one for each ECx equation, each showing the shape of its curve against concentration.

Figure 1. The shape of each equation whose name begins with ecx, drawn from chosen parameter values without fitting, in one panel for each equation. The axes have no scale.

ecxlin

The ecxlin model is a basic linear decay model, given by the equation: yi=τ−eαxiy_i = \tau - e^{\alpha} x_i with the respective brmsformula being

#> y ~ top - exp(slope) * x 
#> top ~ 1
#> slope ~ 1

Because the model contains linear predictors it is not suitable for 0, 1-bounded data (i.e. Binomial and Beta families with an "identity" link function). As the model includes a linear decline with concentration, it is also not suitable for 0, Inf bounded data (Gamma, Poisson, Negative Binomial with an "identity" link).

ecxexp

The ecxexp model is a basic exponential decay model, given by the equation: yi=τe−eβxiy_i = \tau e^{-e^{\beta} x_i} with the respective brmsformula being

#> y ~ top * exp(-exp(beta) * x) 
#> top ~ 1
#> beta ~ 1

The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function.

ecxsigm

The ecxsigm model is a simple sigmoidal decay model, given by the equation: yi=τe−eβxieϵy_i = \tau e^{-e^{\beta} x_i^{e^\epsilon}} with the respective brmsformula being

#> y ~ top * exp(-exp(beta) * x^exp(d)) 
#> d ~ 1
#> top ~ 1
#> beta ~ 1

The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function.

ecx4param

The ecx4param model is a 4-parameter sigmoidal decay model, given by the equation: yi=τ+(δ−τ)/(1+eeβ(ω−xi))y_i = \tau + (\delta - \tau)/(1 + e^{e^{\beta} (\omega - x_i)}) with the respective brmsformula being

#> y ~ top + (bot - top)/(1 + exp((ec50 - x) * exp(beta))) 
#> bot ~ 1
#> ec50 ~ 1
#> top ~ 1
#> beta ~ 1
ecxwb1

The ecxwb1 model is a 4-parameter sigmoidal decay model which is a slight reformulation of the Weibull1 model of Ritz et al. (2015), given by the equation: yi=δ+(τ−δ)e−eeβ(xi−ω)y_i = \delta + (\tau - \delta) e^{-e^{e^{\beta} (x_i - \omega)}} with the respective brmsformula being

#> y ~ bot + (top - bot) * exp(-exp(exp(beta) * (x - ec50))) 
#> bot ~ 1
#> ec50 ~ 1
#> top ~ 1
#> beta ~ 1
ecxwb1p3

The ecxwb1p3 model is a 3-parameter sigmoidal decay model which is a slight reformulation of the Weibull1 model of Ritz et al. (2015), given by the equation: yi=0+(τ−0)e−eeβ(xi−ω)y_i = {0} + (\tau - {0}) e^{-e^{e^{\beta} (x_i - \omega)}} with the respective brmsformula being

#> y ~ 0 + (top - 0) * exp(-exp(exp(beta) * (x - ec50))) 
#> ec50 ~ 1
#> top ~ 1
#> beta ~ 1

The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function.

ecxwb2

The ecxwb2 model is a 4-parameter sigmoidal decay model which is a slight reformulation of the Weibull2 model of Ritz et al. (2015), given by the equation: yi=δ+(τ−δ)(1−e−e−eβ(xi−ω))y_i = \delta + (\tau - \delta) (1 - e^{-e^{-e^{\beta} (x_i - \omega)}}) with the respective brmsformula being

#> y ~ bot + (top - bot) * (1 - exp(-exp(-exp(beta) * (x - ec50)))) 
#> bot ~ 1
#> ec50 ~ 1
#> top ~ 1
#> beta ~ 1

While very similar to the ecxwb1 (according to Ritz et al. 2015), fitted ecxwb1 and ecxwb2 models can differ slightly.

ecxwb2p3

The ecxwb2p3 model is a 3-parameter sigmoidal decay model, which is a slight reformulation of the Weibull2 model of Ritz et al. (2015), given by the equation: yi=0+(τ−0)(1−e−e−eβ(xi−ω))y_i = {0} + (\tau -{0}) (1 - e^{-e^{-e^{\beta} (x_i - \omega)}}) with the respective brmsformula being

#> y ~ 0 + (top - 0) * (1 - exp(-exp(-exp(beta) * (x - ec50)))) 
#> ec50 ~ 1
#> top ~ 1
#> beta ~ 1

While very similar to the ecxwb1p3 (according to Ritz et al. 2015), fitted ecxwb1p3 and ecxwb2p3 models can differ slightly. The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function.

ecxll5

The ecxll5 model is a 5-parameter sigmoidal log-logistic decay model, which is a slight reformulation of the LL.5 model of Ritz et al. (2015), given by the equation: yi=δ+(τ−δ)/(1+eeβ(xi−ω))eϕy_i = \delta + (\tau - \delta) / (1 + e^{e^{\beta} (x_i - \omega)})^{e^\phi} with the respective brmsformula being

#> y ~ bot + (top - bot)/(1 + exp(exp(beta) * (x - ec50)))^exp(f) 
#> bot ~ 1
#> top ~ 1
#> beta ~ 1
#> ec50 ~ 1
#> f ~ 1
ecxll4

The ecxll4 model is a 4-parameter sigmoidal log-logistic decay model which is a slight reformulation of the LL.4 model of Ritz et al. (2015), given by the equation: yi=δ+(τ−δ)/(1+eeβ(xi−ω))y_i = \delta + (\tau - \delta)/ (1 + e^{e^{\beta} (x_i - \omega)}) with the respective brmsformula being

#> y ~ bot + (top - bot)/(1 + exp(exp(beta) * (x - ec50))) 
#> bot ~ 1
#> top ~ 1
#> beta ~ 1
#> ec50 ~ 1
ecxll3

The ecxll3 model is a 3-parameter sigmoidal log-logistic decay model, which is a slight reformulation of the LL.3 model of Ritz et al. (2015), given by the equation: yi=0+(τ−0)/(1+eeβ(xi−ω))y_i = 0 + (\tau - 0)/ (1 + e^{e^{\beta} (x_i - \omega)}) with the respective brmsformula being

#> y ~ 0 + (top - 0)/(1 + exp(exp(beta) * (x - ec50))) 
#> top ~ 1
#> beta ~ 1
#> ec50 ~ 1

The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function.

ecxflat

The ecxflat model is the constant equation, given by the equation: yi=τy_i = \tau with the respective brmsformula being

#> y ~ top + 0 * atan(x) 
#> top ~ 1

The term 0 * atan(x) is zero at every concentration and keeps the predictor in the fitted object. A fit of ecxflat states that the response did not change over the range tested. It has no step and no η=NEC\eta = \text{NEC} parameter, so its no-effect estimate is an NSEC, and its curve reaches no ECx target, so every ECx it gives is reported as censored above the upper end of the prediction range. It is suitable for every family.

ecxhormebc5

The ecxhormebc5 model is a 5 parameter log-logistic model modified to accommodate a non-linear hormesis at low concentrations. It has been modified from the “Brain-Cousens” (BC.5) model of Ritz et al. (2015), given by the equation: yi=δ+(τ−δ+eαxi)/(1+eeβ(xi−ω))y_i = \delta + (\tau - \delta + e^{\alpha} x_i)/ (1 + e^{e^{\beta} (x_i - \omega)}) with the respective brmsformula being

#> y ~ bot + (top - bot + exp(slope) * x)/(1 + exp(exp(beta) * (x - ec50))) 
#> bot ~ 1
#> top ~ 1
#> beta ~ 1
#> ec50 ~ 1
#> slope ~ 1
ecxhormebc4

The ecxhormebc4 model is a 4 parameter log-logistic model similar to the ecxhormebc5 model but with a lower bound of 0, given by the equation: yi=0+(τ−0+eαxi)/(1+eeβ(xi−ω))y_i = 0 + (\tau - 0 + e^{\alpha} x_i)/ (1 + e^{e^{\beta} (x_i - \omega)}) with the respective brmsformula being

#> y ~ 0 + (top - 0 + exp(slope) * x)/(1 + exp(exp(beta) * (x - ec50))) 
#> top ~ 1
#> beta ~ 1
#> ec50 ~ 1
#> slope ~ 1

The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function.

NEC models

Figure 2 shows the shape of each equation whose name begins with nec.

A grid of panels, one for each NEC equation, each showing the shape of its curve against concentration.

Figure 2. The shape of each equation whose name begins with nec, drawn from chosen parameter values without fitting, in one panel for each equation. The threshold is at the same concentration in every panel, and the axes have no scale.

neclin

The neclin model is a basic linear decay model equivalent to ecxlin with the addition of the NEC step function, given by the equation: yi=τ−eα(xi−η)f(xi,η)y_i = \tau - e^{\alpha} \left(x_i - \eta \right) f(x_i, \eta) with the respective brmsformula being

#> y ~ top - exp(slope) * (x - nec) * step(x - nec) 
#> top ~ 1
#> slope ~ 1
#> nec ~ 1

Because the model contains linear predictors it is not suitable for 0, 1-bounded data (Binomial and Beta distributions with "identity" link). As the model includes a linear decline with concentration, it is also not suitable for 0, Inf bounded data (Gamma, Poisson, Negative Binomial with "identity" link).

nec3param

The nec3param model is a basic exponential decay model equivalent to ecxexp with the addition of the NEC step function, given by the equation: yi=τe−eβ(xi−η)f(xi,η)y_i = \tau e^{-e^{\beta} \left(x_i - \eta \right) f(x_i, \eta)} with the respective brmsformula being

#> y ~ top * exp(-exp(beta) * (x - nec) * step(x - nec)) 
#> top ~ 1
#> beta ~ 1
#> nec ~ 1

For Binomial-distributed response data in the case of "identity" link this model is equivalent to that in Fox (2010). The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function.

nec4param

The nec4param model is a 3-parameter decay model with the addition of the NEC step function, given by the equation: yi=δ+(τ−δ)e−eβ(xi−η)f(xi,η)y_i = \delta + (\tau - \delta) e^{-e^{\beta} \left(x_i - \eta \right) f(x_i, \eta)} with the respective brmsformula being

#> y ~ bot + (top - bot) * exp(-exp(beta) * (x - nec) * step(x - nec)) 
#> bot ~ 1
#> top ~ 1
#> beta ~ 1
#> nec ~ 1
nechorme

The nechorme model is a basic exponential decay model with an NEC step function equivalent to nec3param, with the addition of a linear increase prior to η\eta, given by the equation yi=(τ+eαxi)e−eβ(xi−η)f(xi,η)y_i = (\tau + e^{\alpha} x_i) e^{-e^{\beta} \left(x_i - \eta \right) f(x_i, \eta)} with the respective brmsformula being

#> y ~ (top + exp(slope) * x) * exp(-exp(beta) * (x - nec) * step(x - nec)) 
#> top ~ 1
#> beta ~ 1
#> nec ~ 1
#> slope ~ 1

The nechorme model is a hormesis model (Mattson 2008), allowing an initial increase in the response variable at concentrations below η\eta. The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function. In this case the linear version (neclinhorme) should be used.

nechormepwr

The nechormepwr model is a basic exponential decay model with an NEC step function equivalent to nec3param, with the addition of a power increase prior to η\eta, given by the equation: yi=(τ+xi1/(1+eα))e−eβ(xi−η)f(xi,η)y_i = (\tau + x_i^{1/(1+e^{\alpha})}) e^{-e^{\beta} \left(x_i - \eta \right) f(x_i, \eta)} with the respective brmsformula being

#> y ~ (top + x^(1/(1 + exp(slope)))) * exp(-exp(beta) * (x - nec) * step(x - nec)) 
#> top ~ 1
#> beta ~ 1
#> nec ~ 1
#> slope ~ 1

The nechormepwr model is a hormesis model (Mattson 2008), allowing an initial increase in the response variable at concentrations below η\eta. The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function. Because the model can generate predictions above 1 it is excluded from the Binomial, Beta and Beta-Binomial distributions with an "identity" link. nechormepwr01 has a non-linear increase bounded at 1, and is available on those families.

neclinhorme

The neclinhorme model is a basic linear decay model with an NEC step function equivalent to neclin, with the addition of a linear increase prior to η\eta, given by the equation: yi=(τ+eαxi)−eβ(xi−η)f(xi,η)y_i = (\tau + e^{\alpha} x_i) - e^{\beta} \left(x_i - \eta \right) f(x_i, \eta) with the respective brmsformula being

#> y ~ (top + exp(slope) * x) - exp(beta) * (x - nec) * step(x - nec) 
#> top ~ 1
#> beta ~ 1
#> nec ~ 1
#> slope ~ 1

The neclinhorme model is a hormesis model (Mattson 2008), allowing an initial increase in the response variable at concentrations below η\eta. This model contains linear predictors and is not suitable for 0, 1-bounded data (Binomial and Beta distributions with "identity" link). As the model includes a linear decline with concentration, it is also not suitable for 0, Inf bounded data (Gamma, Poisson, Negative Binomial with "identity" link).

nechorme4

The nechorme4 model is a 4-parameter decay model with an NEC step function equivalent to nec4param with the addition of a linear increase prior to η\eta, given by the equation: yi=δ+((τ+eαxi)−δ)e−eβ(xi−η)f(xi,η)y_i = \delta + ((\tau + e^{\alpha} x_i) - \delta ) e^{-e^{\beta} \left(x_i - \eta \right) f(x_i, \eta)} with the respective brmsformula being

#> y ~ bot + ((top + exp(slope) * x) - bot) * exp(-exp(beta) * (x - nec) * step(x - nec)) 
#> bot ~ 1
#> top ~ 1
#> beta ~ 1
#> nec ~ 1
#> slope ~ 1

The nechorme4 model is a hormesis model (Mattson 2008), allowing an initial increase in the response variable at concentrations below η\eta.

nechorme4pwr

The nechorme4pwr model is a 4-parameter decay model with an NEC step function equivalent to nec4param with the addition of a power increase prior to η\eta, given by the equation: yi=δ+((τ+xi1/(1+eα))−δ)e−eβ(xi−η)f(xi,η)y_i = \delta + ((\tau + x_i^{1/(1+e^{\alpha})}) - \delta) e^{-e^{\beta} \left(x_i - \eta \right) f(x_i, \eta)} with the respective brmsformula being

#> y ~ bot + ((top + x^(1/(1 + exp(slope)))) - bot) * exp(-exp(beta) * (x - nec) * step(x - nec)) 
#> bot ~ 1
#> top ~ 1
#> beta ~ 1
#> nec ~ 1
#> slope ~ 1

The nechorme4pwr model is a hormesis model (Mattson 2008), allowing an initial power increase in the response variable at concentrations below η\eta. Because the model can generate predictions above 1 it is excluded from the Binomial, Beta and Beta-Binomial distributions with an "identity" link. nechormepwr01 has a non-linear increase bounded at 1, and is available on those families.

nechormepwr01

The nechormepwr01 model is a basic exponential decay model with an NEC step function equivalent to nec3param, with the addition of a logistic increase from τ\tau towards 1 prior to η\eta, given by the equation: yi=(11+((1/τ)−1)e−eαxi)e−eβ(xi−η)f(xi,η)y_i = \left(\frac{1}{1 + ((1/\tau)-1) e^{-e^{\alpha}x_i}}\right) e^{-e^{\beta} \left(x_i - \eta \right) f(x_i, \eta)} with the respective brmsformula being

#> y ~ (1/(1 + ((1/top) - 1) * exp(-exp(slope) * x))) * exp(-exp(beta) * (x - nec) * step(x - nec)) 
#> top ~ 1
#> beta ~ 1
#> nec ~ 1
#> slope ~ 1

The nechormepwr01 model is a hormesis model (Mattson 2008), allowing an initial increase in the response variable at concentrations below η\eta. The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function. In this case the linear version (neclinhorme) should be used. The increase of nechormepwr01 is bounded above at 1 by construction, which is what keeps it available on the 0, 1-bounded families. The same bound excludes it from the 0, Inf bounded families (Gamma, Poisson, Negative Binomial with an "identity" link), whose response may exceed 1.

necsigm

The necsigm model is a simple sigmoidal decay model equivalent to ecxsigm with the addition of the NEC step function, given by the equation: yi=τe−eβ((xi−η)f(xi,η))eϵf(xi,η)y_i = \tau e^{-e^{\beta} ((x_i - \eta) f(x_i, \eta))^{e^\epsilon}f(x_i, \eta)} with the respective brmsformula being

#> y ~ top * exp(-exp(beta) * (step(x - nec) * (x - nec))^exp(d) * step(x - nec)) 
#> top ~ 1
#> beta ~ 1
#> nec ~ 1
#> d ~ 1

The model is 0-bounded, thus not suitable for the use of a "logit" or "log" link function. In addition, there may be theoretical issues with combining a sigmoidal decay model with an NEC step function because where there is an upper plateau in the data the location of η\eta may become ambiguous. Estimation of No-Effect-Concentrations using this model are not currently recommended without further testing.

Relationship to the drc NEC models

The drc package (Ritz et al. 2015) fits NEC models with the functions NEC.2(), NEC.3() and NEC.4(), and two of the three have an exact equivalent in bayesnec. Given b=eβb = e^{\beta}, the two packages evaluate the same expression. The nec4param curve and the NEC.4() curve of drc 3.0.1 were computed at 201 concentrations between 0 and 10, for 135 combinations of parameter values that included thresholds below and above that range, and the two were identical in every case.

drc’s three functions are wrappers around a single generator that differ only in which parameters they hold fixed (Table 1).

Table 1. The three NEC functions of drc, the parameters each fixes, and the equivalent equation in bayesnec.
drc fixes bayesnec
NEC.4() nothing nec4param
NEC.3() c=0c = 0 nec3param
NEC.2() c=0c = 0, d=d =upper none, by choice — see below

The parameters map as c=δc = \delta ("bot"), d=τd = \tau ("top"), e=ηe = \eta ("nec") and b=eβb = e^{\beta} (exp("beta")).

The decay rate is the only substantive difference between the two implementations. drc estimates the decay rate bb directly, whereas bayesnec estimates β\beta and uses eβe^{\beta}, so the decay rate is positive by construction. This is a reparameterisation of the same model over b>0b > 0, which includes every decline. drc can therefore return b<0b < 0, a threshold followed by unbounded exponential growth, which bayesnec cannot represent. A threshold followed by an increase is available here as nec4param with δ>τ\delta > \tau, which stays bounded.

The equivalence is exact in one direction only. Converting a drc estimate by setting β=log⁡(b)\beta = \log(b) does not always recover bb, because elog⁡(b)e^{\log(b)} is not the identity in floating point. For 200 decay rates between 0.01 and 20, elog⁡(b)e^{\log(b)} differed from bb for 89, and the largest relative difference between the resulting curves was 3×10−143 \times 10^{-14}. A difference of that size between two curves computed from one set of estimates therefore arises from the round trip, not from either model.

The model given in ?drc::NEC differs from the model drc fits. The help page includes an additional log-logistic term, d2/(1+eb2(log⁡(x)−log⁡(e2)))d_2 / (1 + e^{b_2(\log(x) - \log(e_2))}), reproducing the general model of Pires et al. (2002), but the function drc fits does not include that term. The equivalences in Table 1 are therefore with the fitted model, not the documented one.

The absence of an equivalent of NEC.2()

NEC.2() fixes the upper asymptote at a constant, by default 1. Fixing τ\tau in this way asserts that the control response is exactly that constant with no error, which is only defensible for data normalised to a control.

Normalising to an estimated control discards the control’s uncertainty and propagates none of it into the NEC, so the resulting interval is narrower than the data support, and bnec() gives a message where the response appears to have been normalised in this way. Where the upper bound is structural, not estimated (for example, a proportion that cannot exceed one by construction), the same constraint is available without a new model, either as a brms constant() prior on "top" or as a tight informative prior (see Fixing a parameter in the Priors vignette). Either way the assumption is written in the prior, where it can be inspected, instead of being fixed within the equation.

References

Fisher, Rebecca, Diego R. Barneche, Gerard F. Ricardo, and David R. Fox. 2024. “bayesnec: An R Package for Concentration-Response Modeling and Estimation of Toxicity Metrics.” Journal of Statistical Software 110 (5). https://doi.org/10.18637/jss.v110.i05.
Fisher, Rebecca, and David R Fox. 2023. “Introducing the No Significant Effect Concentration (NSEC).” Journal Article. Environmental Toxicology and Chemistry 42 (9): 2019–28. https://doi.org/https://doi.org/10.1002/etc.5610.
Fisher, Rebecca, David R. Fox, Andrew P. Negri, Joost van Dam, Florita Flores, and Darren Koppel. 2024. “Methods for Estimating No-Effect Toxicity Concentrations in Ecotoxicology.” Integrated Environmental Assessment and Management 20 (1): 279–93. https://doi.org/https://doi.org/10.1002/ieam.4809.
Fox, David R. 2010. “A Bayesian approach for determining the no effect concentration and hazardous concentration in ecotoxicology.” Ecotoxicology and Environmental Safety 73 (2): 123–31.
Mattson, Mark P. 2008. “Hormesis Defined.” Ageing Research Reviews 7 (1): 1–7. https://doi.org/https://doi.org/10.1016/j.arr.2007.08.007.
Pires, Ana M., João A. Branco, Ana Picado, and Elsa Mendonça. 2002. “Models for the estimation of a ’no effect concentration’.” Environmetrics 13: 15–27. https://doi.org/10.1002/env.501.
Ritz, Christian, Florent Baty, Jens C Streibig, and Daniel Gerhard. 2015. “Dose-Response Analysis Using R.” PLoS ONE 10 (12): e0146021. https://doi.org/10.1371/journal.pone.0146021.
Vehtari, Aki, Jonah Gabry, Mans Magnusson, et al. 2026. Loo: Efficient Leave-One-Out Cross-Validation and WAIC for Bayesian Models. https://mc-stan.org/loo/.
Vehtari, Aki, Andrew Gelman, and Jonah Gabry. 2017. “Practical Bayesian Model Evaluation Using Leave-One-Out Cross-Validation and WAIC.” Statistics and Computing 27: 1413–32. https://doi.org/10.1007/s11222-016-9696-4.