itsdfish / SequentialSamplingModels.jl

A unified interface for simulating and evaluating sequential sampling models in Julia.
https://itsdfish.github.io/SequentialSamplingModels.jl/dev/
MIT License
27 stars 4 forks source link

numerical integration for the Ratcliff Diffusion Model #24

Open kiante-fernandez opened 1 year ago

kiante-fernandez commented 1 year ago

I am finishing up the DDM with across-trial variability in drift, starting point, and non-decision time.

For drift, you can use analytic integration of the likelihood function. See HDDM for a use case example. That works fine.

For the starting point and non-decision time, numerical integration is used (Ratcliff and Tuerlinckx, 2002). This part tends to be the most computationally expensive.

I am going to start with just coding up Simpson's Method. But I figured I would ask if you knew of some alternatives that are notoriously fast in Julia. I was looking at something like HCubature.jl or QuadGK.jl.

itsdfish commented 1 year ago

Thanks for taking the lead on this. From what I understand HCubature.jl is a good option. One thing to be aware of is that this type of numerical integration may not play well with automatic differentiation which is used for some MCMC samplers. My concern is that it might "blow up" the information that AD needs to track. It might be good to ask someone from Turing. This option we discussed in a previous issue might be more AD-friendly.