View source: R/helpers-postprocess.R
| posterior_epred.bmmfit | R Documentation |
posterior_epred() returns draws of the expected value of the
response for each observation: the mean of what brms::posterior_predict()
simulates for it. What that is depends on the model:
| Model | Expected response |
ddm(), cswald() | Mean response time, averaged over both responses, under the diffusion process that posterior_predict() simulates from |
ezdm(), version "3par" | Mean response time of the cell |
ezdm(), version "4par" | Mean response time of the cell's upper-boundary responses |
sdt_yn() | Number of "old"/"signal" responses, the number of trials times their probability |
sdt_mafc() | Number of correct responses, the number of trials times their probability |
m3(), sdt_rating(), sdt_ranking(), sdt_cdp() | Expected count of each response category, from the multinomial family of brms |
sdm(), mixture2p(), mixture3p(), imm() | Not defined: the mean of a circular response error is not a useful quantity, so these models stop with an error |
With dpar or nlpar, posterior_epred() returns draws of that model
parameter for every model, as in brms: a dpar on its native scale,
an nlpar on the scale of its link. native_parameters() returns the
model parameters on their native scale over a grid of predictor values.
## S3 method for class 'bmmfit'
posterior_epred(object, ..., dpar = NULL, nlpar = NULL)
## S3 method for class 'bmmfit'
fitted(object, ..., scale = c("response", "linear"), dpar = NULL, nlpar = NULL)
object |
A |
... |
Further arguments passed to |
dpar, nlpar |
Name of a distributional or non-linear parameter whose draws are returned instead of the expected response. |
scale |
As in |
A draws by observations matrix (an array with a third dimension for the response categories of the multinomial models).
brms::posterior_epred(), native_parameters()
## Not run:
fit <- bmm(
bmf(drift ~ 1, bound ~ 1, ndt ~ 1),
data = rddm(200, drift = 1.5, bound = 1.2, ndt = 0.3),
model = ddm(rt = "rt", response = "response"),
backend = "cmdstanr"
)
# expected response time of each observation, one row per draw
epred <- posterior_epred(fit)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.