View source: R/bnecfit-methods.R
update.bnecfit | R Documentation |
bnecfit
as fitted by function
bnec
.Update an object of class bnecfit
as fitted by function
bnec
.
## S3 method for class 'bnecfit'
update(
object,
newdata = NULL,
recompile = NULL,
x_range = NA,
resolution = 1000,
sig_val = 0.01,
loo_controls,
force_fit = FALSE,
...
)
object |
An object of class |
newdata |
Optional |
recompile |
A |
x_range |
A range of predictor values over which to consider extracting ECx. |
resolution |
The length of the predictor vector used for posterior predictions, and over which to extract ECx values. Large values will be slower but more precise. |
sig_val |
Probability value to use as the lower quantile to test significance of the predicted posterior values against the lowest observed concentration (assumed to be the control), to estimate NEC as an interpolated NOEC value from smooth ECx curves. |
loo_controls |
A named |
force_fit |
Should model truly be updated in case either
|
... |
Further arguments to |
An object of class bnecfit
. If one single model is
returned, then also an object of class bayesnecfit
; otherwise,
if multiple models are returned, also an object of class
bayesmanecfit
.
## Not run:
library(bayesnec)
data(manec_example)
# due to package size issues, `manec_example` does not contain original
# stanfit DSO, so need to recompile here
smaller_manec <- update(manec_example, chains = 2, iter = 50,
recompile = TRUE)
# original `manec_example` is fit with a Gaussian
# change to Beta distribution by adding newdata with original `nec_data$y`
# function will throw informative message.
beta_manec <- update(manec_example, newdata = nec_data, recompile = TRUE,
chains = 2, iter = 50,
family = Beta(link = "identity"), force_fit = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.