dlba_inverse_external: Density Function for the LBA Model Using Inverse Transform...

View source: R/RcppExports.R

dlba_inverse_externalR Documentation

Density Function for the LBA Model Using Inverse Transform Method

Description

Computes the probability density of response times for the Linear Ballistic Accumulator (LBA) model using an inverse transform formulation.

Usage

dlba_inverse_external(
  rt_r,
  response_r,
  parameter_r,
  is_positive_drift_r,
  time_parameter_r
)

Arguments

rt_r

A numeric vector of response times (RTs) for which the density should be computed.

response_r

An integer vector of response choices (indices of winning accumulators), same length as rt_r.

parameter_r

A numeric matrix of LBA parameters. Each column corresponds to an accumulator, and each row corresponds to a parameter, with the expected order being:

  • A - Starting point variability

  • b - Thresholds

  • mean_v - Mean drift rates

  • sd_v - Standard deviation drift rates

  • st0 - Variability of the non-decision

  • t0 - Non-decision time

is_positive_drift_r

A logical vector indicating whether the drift rate must be positive for each trial.

time_parameter_r

A numeric vector to set the simulated time grid, with the expected value for: minimal and maximum decision times and the difference time (i.e., min dt, max dt and dt).

Details

This function is a lower-level computational routine intended to be used inside higher-level LBA model evaluation or fitting functions. It uses the inverse transform method to compute exact LBA densities in a numerically stable and efficient way. The function assumes consistent input dimensions across all arguments.

Value

A numeric vector of LBA densities, one per trial.


lbaModel documentation built on Sept. 15, 2025, 9:08 a.m.