Skip to content

DDM-HMM / Future Interoperability with EmissionModels.jl #138

Description

@rsenne

Hi SSM team,

I wanted to put a few related things on your radar.

I recently posted a preprint using an HMM whose emission model is a Ratcliff-style DDM. The goal was to track how decision-making changes across the 24-hour cycle in rats performing a TAFC task. @kiante-fernandez reached out to me on Bluesky and asked why I did not use this package, and instead wrote my own DDM code here: https://github.com/depasquale-lab/DriftDiffusionModels.jl.

That is a fair question. The short answer is:

  1. I had already written most of the code for this approach before realizing this package existed.
  2. My application required a stimulus-coded DDM.

By stimulus coding, I mean that the drift is parameterized by its magnitude and then multiplied by a trial-specific sign depending on which side is correct:

$$v_{\mathrm{trial}} = s_{\mathrm{trial}} |v|, \qquad s_{\mathrm{trial}} \in \{-1, 1\}.$$

This differs from accuracy coding, where the upper bound is typically treated as “correct” and the lower bound as “incorrect.” In the stimulus-coded case, the bounds correspond to stimulus/choice identity, for example right versus left, and correctness is determined afterward from the trial condition.

I would prefer not to maintain a separate DDM implementation if the relevant functionality can live in, or be built cleanly around, this package. I would therefore be happy to help with one or more of the following:

  1. Add a tutorial showing how to implement stimulus-coded DDMs in this framework, including how stimulus coding changes the interpretation of parameters relative to accuracy coding.
  2. Add helper utilities to make stimulus-coded DDMs easier to specify.
  3. Unrelated but could also add a “coherence DDM” tutorial/helper, where drift is parameterized as something like
$$v_i = s_i k c_i^\alpha,$$

where (c_i) is stimulus coherence, (k) is gain, (\alpha) controls the nonlinearity, and (s_i) is an optional stimulus-coding sign variable.

Separately, I am working on a package called EmissionModels.jl where the goal is for it to operate with HiddenMarkovModels.jl

In relation to the DDM-HMM model above, I would ideally like to add this package as a weak dependency and create an extension that makes it possible to reproduce the DDM-HMM workflow using this package for the DDM component. That way, this package gets the appropriate credit, and my maintenance burden is limited to the HMM/emission-model interface rather than maintaining a parallel DDM implementation.

Does this sound like something that would fit the scope of the package? I am happy to help with a tutorial, helper functions, or an extension, depending on what would be most useful. And if anyone is interested in starting a PR on this over in EmissionModels.jl, I would certainly not object. 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions