lba_lowlevel: Low-Level LBA Simulation and Parameter Validation (C++...

validate_lba_parametersR Documentation

Low-Level LBA Simulation and Parameter Validation (C++ back-end)

Description

  • simulate_lba_trials() generates synthetic choices and response times from an LBA configuration passed as an S4 model object plus a parameter vector.

  • validate_lba_parameters() checks basic validity/compatibility of a named parameter vector for a given model object.

Usage

validate_lba_parameters(rt_model_r, parameters_r, debug = FALSE)

simulate_lba_trials(
  rt_model_r,
  parameters_r,
  n_trial = 1L,
  use_inverse_method = FALSE,
  debug = FALSE
)

Arguments

rt_model_r

An S4 model object describing the LBA structure and metadata. (Typically created by package-internal builders.)

parameters_r

A named numeric vector of LBA parameters (e.g., A, b, v/mean_v, t0, optionally sd_v, st0 depending on your model).

debug

Logical. If TRUE, prints internal diagnostics during validation or simulation.

n_trial

Integer (default 1L). Number of trials to simulate.

use_inverse_method

Logical. If TRUE, use inverse-transform sampling; otherwise use the standard sampling.

Details

Internal interfaces for simulating trial-level data and validating parameter inputs for the Linear Ballistic Accumulation (LBA) model. These functions are implemented in C++ via Rcpp and are primarily intended for use by higher-level R helpers rather than for direct end-user calls.

These functions are exposed to R via Rcpp attributes and callable from R. They assume inputs with correct dimensions and names; minimal argument checking is performed for speed. See also high-level helpers in this package for safer user-facing APIs.

Value

  • simulate_lba_trials() returns a data.frame with one row per simulated trial and columns:

    • trial — Trial index (integer)

    • choice — Index of the winning accumulator (integer)

    • rt — Simulated response time (numeric)

  • validate_lba_parameters() returns a logical scalar indicating whether parameters_r is valid for rt_model_r.

See Also

simulate() on class "lba", dlba, plba

Other LBA simulation: simulate_lba

Examples


# See ?simulate_lba for the user-facing simulation function.


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