Fitting Approaches
The function supports different "approaches" to fitting data.
"sep_c": This means that data is always considered separately for
each participant (if there are multiple participants) and that a
classical approach to parameter optimization is used. This means that
a standard cost_function is minimized (e.g., the negative
log-likelihood). If users provide only a single participant or a data set
without an ID column, then the model is fitted just once to that data
set.
"agg_c": This fits the model to aggregated data. For each individual in
a data set, summary statistics (e.g., quantiles, accuracies) are
calculated, and the model is fitted once to the average of these summary
statistics.
"sep_b": Similar to sep_b", although a Bayesian approach is used to
sample from the posterior distribution.
"hier_b": A hierarchical approach to parameter estimation. In this case
all participants are considered simultaneously and samples are drawn both
at the individual-level and group-level.
The optimizers "nmkb", "L-BFGS-B", and "DEoptim" (for classical
parameter optimization) require the specification of the lower/upper
arguments.
Fitting to Aggregated Data
For aggregated fits, aggregated statistics are set to the model and the cost
function is switched to "rmse". If incompatible settings are requested,
the function switches to a compatible configuration and informs the user
with messages (these messages can be suppressed via the messaging argument).
Specifying lower/upper for Classical optimization
the function estimate_model_dm() provides a flexible way of specifying the
optimization space; this is identical to specifying the parameter simulation
space in simulate_data.drift_dm().
Users have three options to specify the search space (see also the examples
below):
Plain numeric vectors (not very much recommended). In this case,
lower/upper must be sorted in accordance with the parameters in the
underlying flex_prms object of drift_dm_obj that vary for at
least one condition (call print(drift_dm_obj) and have a look at the
columns of the Parameter Settings output; for each column that has a
number > 0, specify an entry in lower/upper).
Named numeric vectors. In this case lower/upper have to provide labels
in accordance with the parameters that are considered "free" at least once
across conditions (call coef(drift_dm_obj) and provide one named entry for
each parameter; dRiftDM will try to recycle parameter values across
conditions).
The most precise way is when lower/upper are lists. In this case, the
list requires an entry called "default_values" which specifies the named or
plain numeric vectors as above. If the list only contains this entry, then
the behavior is as if lower/upper were already numeric vectors. However,
the lower/upper lists can also provide entries labeled as specific
conditions, which contain named (!) numeric vectors with parameter labels.
This will modify the value for the upper/lower parameter space with respect
to the specified parameters in the respective condition.
Specifying Priors for Bayesian Estimation
(Default) Prior settings in the non-hierarchical case:
Let \(\theta^{(j)}\) indicate parameter \(j\) of a model (e.g., the
drift rate).
The prior on \(\theta^{(j)}\) is a truncated normal distribution:
$$
\theta^{(j)} \sim NT(\mu^{(j)}, \sigma^{(j)}, l^{(j)}, u^{(j)})
$$
With \(\mu^{(j)}\) and \(\sigma^{(j)}\) representing the mean and standard
deviation of parameter \(j\). \(l^{(j)}\) and \(u^{(j)}\) represent the
lower and upper boundary. \(\mu^{(j)}\) is taken from the mean
argument or the currently set model parameters (i.e., from
coef(drift_dm_obj)) when calling the function. \(\sigma^{(j)}\) is, per
default, equal to \(\mu^{(j)}\). This can be changed by passing
the sd argument. The lower and upper boundaries of the truncated normal
are -Inf and Inf per default. This can be altered by passing the
arguments lower and upper (see the examples below).
(Default) Prior settings in the hierarchical case:
Let \(\theta_i^{(j)}\) indicate parameter \(j\) for participant \(i\)
(e.g., the drift rate estimated for individual \(i\)). The prior on
\(\theta_i^{(j)}\) is a truncated normal distribution:
$$
\theta_i^{(j)} \sim NT(\mu^{(j)}, \sigma^{(j)}, l^{(j)}, u^{(j)})
$$
With \(\mu^{(j)}\) and \(\sigma^{(j)}\) representing the mean and
standard deviation of parameter \(j\) at the group level. \(l^{(j)}\) and
\(u^{(j)}\) represent the lower and upper boundary. The lower and upper
boundaries of the truncated normal are -Inf and Inf per default.
This can be altered by passing the arguments lower and upper.
For a group-level mean parameter, \(\mu^{(j)}\), the prior is also a
truncated normal distributions:
$$
\mu^{(j)} \sim NT(M^{(j)}, SD^{(j)}, l^{(j)}, u^{(j)})
$$
With \(M^{(j)}\) specified by the mean argument or the currently
set model parameters. \(SD^{(j)}\) is, per default, equal to \(M^{(j)}\).
This can be changed by passing the sd argument.
For a group-level standard deviation parameter, \(\sigma^{(j)}\), the prior
is a gamma distribution:
$$
\sigma^{(j)} \sim \Gamma(shape^{(j)},rate^{(j)})
$$
With \(shape^{(j)}\) and \(rate^{(j)}\) being 1 by default. This
can be changed by passing the arguments shape and rate.
Specifying Prior Settings/Arguments
Argument specification for mean, sd, lower, upper, shape and
rate is conceptually identical to specifying lower/upper for the
classical optimization approach (see the subsection above and the examples
below).