Skip to contents

Generate predictions from a temporal discounting drift diffusion model.

Usage

# S3 method for class 'td_ddm'
predict(
  object,
  newdata = NULL,
  type = c("indiff", "link", "response", "rt"),
  ...
)

Arguments

object

A temporal discounting drift diffusion model. See td_ddm.

newdata

Optionally, a data frame to use for prediction. If omitted, the data used to fit the model will be used for prediction.

type

The type of prediction required. As in predict.glm, "link" (default) and "response" give predictions on the scales of the linear predictors and response variable, respectively. "indiff" gives predicted indifference points. For predicting indifference points, newdata needs only a del column. "rt" gives predicted reaction times.

...

Additional arguments currently not used.

Value

A vector of predictions.

Note

When type = 'rt', expected RTs are computed irrespective of which reward was selected, per equation 5 in Grasman, Wagenmakers, & van der Maas (2009, doi:10.1016/j.jmp.2009.01.006 ).

See also

Other drift diffusion model functions: coef.td_ddm(), deviance.td_ddm(), fitted.td_ddm(), logLik.td_ddm(), td_ddm()

Examples

if (FALSE) { # \dontrun{
data("td_bc_single_ptpt")
mod <- td_ddm(td_bc_single_ptpt, discount_function = 'exponential')
pred_rts <- predict(mod, type = 'rt')
} # }