Multiple models fitted with the bayesnec package are represented as a bayesmanecfit object, which contains the original brmsfit fitted objects, names of non-linear models that were fitted, model averaging WAIC stats, sample size, mean posterior no-effect toxicity values (NEC, NSEC or N(S)EC), mean model averaged predictions on the data scale, model averaged residuals, full posterior distribution of predicated values, and summary statistics of no-effect toxicity.

Details

See methods(class = "bayesmanecfit") for an overview of available methods.

Slots

mod_fits

A list of fitted model outputs of class prebayesnecfit for each of the fitted models.

retained_data

A data.frame containing columns of the data supplied to bnec that brm() omitted from its stored model frame. The columns are stored once for the model set, in fitted-data order. The element is absent when every supplied column was used by the fit.

success_models

A character vector indicating the name of the successfully fitted models.

mod_stats

A data.frame of model fit statistics, including elpd, the expected log predictive density the weights wi were computed from. Attribute "leave_out" of wi names the grouping each of whose levels that score left out, or is "observation". See the loo_controls argument of bnec.

sample_size

The number of draws in the model-averaged mixture, set to the smallest posterior draw count among the component models.

w_draw_index

The realised model-averaging draw: a list of the row indices kept for each component model. Model averaging keeps a weighted subset of each model's draws, and this records which ones, so every call on the object uses the same subset. fitted, posterior_epred, ecx and nsec are therefore reproducible, and agree with w_ne_posterior and w_pred_vals. predict and posterior_predict still vary between calls unless a seed is set, because they simulate new observations from the likelihood, as they do for a single brmsfit.

w_draw_seed

The seed that realised w_draw_index. Used only where the stored index cannot apply: when a caller thins to a different number of draws, and for an object saved by an earlier version that carries neither field, which falls back to a fixed seed.

w_ne_posterior

The model-weighted posterior estimate of the no-effect toxicity estimate. Its draws beyond the prediction range are recorded and stored as described for ne_posterior in bayesnecfit.

w_predicted_y

The model-weighted predicted values for the observed data.

w_residuals

Model-weighted residual values (i.e. observed - w_predicted_y).

w_pred_vals

A list with data, a data.frame of summary model-weighted posterior predicted values over a grid set by resolution and x_range, and the observed_levels and band flags described for pred_vals in bayesnecfit. It does not hold the matrix of weighted draws those summaries came from. To obtain it, use posterior_epred(x, newdata = bnec_newdata(x, resolution = 1000), re_formula = NA), which draws from the component models in the same weighted proportions where no group term spans concentrations. A fit saved before observed-level curves were stored retains its earlier values and gives a warning when they are displayed.

w_ne

The summary stats (median and 95% credibility intervals) of w_ne_posterior.

ne_type

A character vector indicating the type of no-effect toxicity estimate. A monotone threshold equation contributes its sampled no-effect-concentration (NEC, see Fox 2010). A smooth or hormesis threshold equation contributes a curve-read no-significant-effect-concentration (NSEC, see Fisher and Fox 2023). A set containing both contributions reports their model-averaged mixture as the N(S)EC (see Fisher et al. 2023).

References

Fisher R, Barneche DR, Ricardo GF, Fox, DR (2024) An R Package for Concentration-Response Modeling and Estimation of Toxicity Metrics doi:10.18637/jss.v110.i05.

Fisher R, Fox DR (2023). Introducing the no significant effect concentration (NSEC).Environmental Toxicology and Chemistry, 42(9), 2019–2028. doi: 10.1002/etc.5610.

Fisher R, Fox DR, Negri AP, van Dam J, Flores F, Koppel D (2023). Methods for estimating no-effect toxicity concentrations in ecotoxicology. Integrated Environmental Assessment and Management. doi:10.1002/ieam.4809.

Fox DR (2010). A Bayesian Approach for Determining the No Effect Concentration and Hazardous Concentration in Ecotoxicology. Ecotoxicology and Environmental Safety, 73(2), 123–131. doi: 10.1016/j.ecoenv.2009.09.012.