calc_pdfs: Calculate the PDFs

View source: R/core_solve.R

calc_pdfsR Documentation

Calculate the PDFs

Description

This method takes the a model, the time and space vectors, and the unpacked parameters for solving the PDF to derive the first passage time across all conditions. It is a wrapper around the cpp implementations and add_residual. Important: This function is used in the depths of the package and the generic method is not exported.

Usage

calc_pdfs(drift_dm_obj, x_vec, t_vec, prms_solve)

## S3 method for class 'ratcliff_dm'
calc_pdfs(drift_dm_obj, x_vec, t_vec, prms_solve)

## S3 method for class 'drift_dm'
calc_pdfs(drift_dm_obj, x_vec, t_vec, prms_solve)

Arguments

drift_dm_obj

a model of type drift_dm

x_vec

numeric vector, the evidence space

t_vec

numeric vector, the time space

prms_solve

the discretization (see prms_solve)

Details

calc_pdfs is a generic method which dispatches the function call (not exported).

calc_pdfs.ratcliff_dm, is a specific method that checks for the presence of the parameter sd_muc, and, if present, calls the calc_pdfs.drift_dm function multiple times with different value for muc to approximate the variable drift rate.

calc_pdfs.drift_dm is the function that will be called for all models. It evaluates the different components of a model, and subsequently calls the cpp implementations for the KFE or integral method. It also calls the add_residual function to convolute the non-decision time to the first passage time.

The numerical methods for deriving the PDFs are based on the code provided by \insertCiteRichteretal.2023dRiftDM.

Value

a list of PDFs, with named entries for each condition. Each of this entry contains a list of vectors, named "pdf_u" and "pdf_l"

References

\insertRef

Richteretal.2023dRiftDM

See Also

add_residual


dRiftDM documentation built on April 3, 2025, 7:48 p.m.