Summaries of the posterior predictive quantities
Source:R/methods-draws.R
frmtmb-draws-summaries.Rdbrms's three summarizing methods, each a summary of the draws method beside it:
fitted()summarizesposterior_epred()(orposterior_linpred()underscale = "linear");predict()summarizesposterior_predict();residuals()summarizespredictive_error().
summary = FALSE returns the draws themselves, which is what the
method it wraps returns.
Usage
# S3 method for class 'frmtmb_draws'
fitted(
object,
newdata = NULL,
re_formula = arg_unset(),
scale = c("response", "linear"),
resp = NULL,
dpar = NULL,
nlpar = NULL,
ndraws = NULL,
draw_ids = NULL,
sort = FALSE,
summary = TRUE,
robust = FALSE,
probs = c(0.025, 0.975),
...
)
# S3 method for class 'frmtmb_draws'
predict(
object,
newdata = NULL,
re_formula = arg_unset(),
transform = NULL,
resp = NULL,
negative_rt = FALSE,
ndraws = NULL,
draw_ids = NULL,
sort = FALSE,
ntrys = NULL,
cores = NULL,
summary = TRUE,
robust = FALSE,
probs = c(0.025, 0.975),
...
)
# S3 method for class 'frmtmb_draws'
residuals(
object,
newdata = NULL,
re_formula = arg_unset(),
method = "posterior_predict",
type = c("ordinary", "pearson"),
resp = NULL,
ndraws = NULL,
draw_ids = NULL,
sort = FALSE,
summary = TRUE,
robust = FALSE,
probs = c(0.025, 0.975),
...
)Arguments
- object
A
frmtmb_drawsfromfrm_sample().- newdata, re_formula, resp, dpar, nlpar, ndraws, draw_ids
Passed to the draws method, where they are documented.
- scale
"response"for the expected response,"linear"for the linear predictor.- summary
If
FALSE, the draws instead of their summary.- robust
If
TRUE, the median and MAD instead of the mean and standard deviation.- probs
Probabilities of the quantile columns.
- ...
Passed to the draws method, which is where brms's
point_estimateandndraws_point_estimateare answered.- transform
Applied to the draws before they are summarized.
- negative_rt, ntrys, cores, sort
brms's remaining arguments, carried so that a positional brms call asks the same question; each is passed on or refused by the method it belongs to.
- method
For
residuals(), which predictive distribution the error is taken against.- type
For
residuals(),"ordinary"(brms's name for the raw error) or"pearson".