Open kendalfoster opened 3 years ago
Sorry for the late response. I see the PR associated with this and I'll make comments.
First question: is this the right name to call it?
ddm_lpdf
is: I did a google search and it didn't go so well. normal_id_glm_lpdf
, so it's not unprecedented. I'll review the code in earnest now.
Second question: can you write down the distribution here in math or link to papers?
Description
Ratcliff's Diffusion Decision Model (DDM) is a popular model for jointly modelling binary responses and their associated response times. The DDM exists in several parameterizations, and currently Stan Math contains the PDF of the 4-parameter variant (i.e., the parameters for threshold separation, non-decision time, relative starting point of the diffusion process, and drift rate of the diffusion process) via the function
wiener_lpdf()
. This issue proposes to add the 5-parameter variant of the DDM (i.e., including the parameter for inter-trial variability in the drift rate) to Stan Math by adding the new functionsddm_lpdf()
andddm_lcdf()
.I am submitting a pull request to add these two new functions (
ddm_lpdf()
andddm_lcdf()
). Both functions accept the following parameters: response time, response, threshold separation, drift rate, non-decision time, relative starting point, inter-trial variability in the drift rate. This pull request has been discussed in this Discourse thread.Example
An example call to the (logged) PDF is
ddm_lpdf(1, 1, 1, -1, 0, 0.5, 0.1)
and would return the log of the PDF. An example call to the (logged) CDF isddm_lcdf(1, 1, 1, -1, 0, 0.5, 0.1)
and would return the log of the CDF.Expected Output
We should expect the example call to
ddm_lpdf(1, 1, 1, -1, 0, 0.5, 0.1)
to return0.02250968
. We should expect the example call toddm_lcdf(1, 1, 1, -1, 0, 0.5, 0.1)
to return0.7264627
.Current Version:
v4.1.0