simulate.model {ggdmc} | R Documentation |
Simulate response time data
Description
Simulate response time data either for one subject or multiple subjects.
The simulation is based on a model object. For one subject, one must supply
a true parameter vector to the ps
argument.
Usage
## S3 method for class 'model'
simulate(object, nsim = NA, seed = NULL, nsub = NA,
prior = NA, ps = NA, ...)
Arguments
object |
a model object. |
nsim |
number of trials / responses. |
seed |
a user specified random seed. |
nsub |
number of subjects |
prior |
a prior object |
ps |
a true parameter vector or matrix. |
... |
additional optional arguments. |
Details
For multiple subjects, one can enter a matrix (or a row vector) as true
parameters. Each row is to generate data separately for a subject. This is
the fixed-effect model. To generate data based on a random-effect
model, one must supply a prior object. In this case, ps
argument
is unused. Note in some cases, a random-effect model may fail to draw data
from the model, because true parameters are randomly drawn from
a prior object. This would happen sometimes in diffusion model, because
certain parameter combinations are considered invalid.
ps
can be a row vector, in which case each subject has identical
parameters. It can also be a matrix with one row per subject, in which
case it must have ns
rows. The true values will be saved as
parameters
attribute in the output object.
Value
a data frame