# How to implement a go/nogo paradigm

**URL:** <https://discuss.bayesflow.org/t/how-to-implement-a-go-nogo-paradigm/94>\
**Category:** General\
**Created:** [June 24, 2024, 9:28am UTC](https://discuss.bayesflow.org/t/how-to-implement-a-go-nogo-paradigm/94 "2024-06-24T09:28:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AminGhaderi](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@AminGhaderi](https://discuss.bayesflow.org/u/AminGhaderi)\
**Post date:** [June 24, 2024, 9:28am UTC](https://discuss.bayesflow.org/t/how-to-implement-a-go-nogo-paradigm/94/1 "2024-06-24T09:28:55Z")

</div>

Hello Bayesflow team,

I wonder whether it is possible to implement a go/nogo task in Bayeflow, wherein incorrectly inhibited go trials (omission) and correctly inhibited no-go trials only have responses, but no RTs?

kind regards,  
Amin

---

<div class="post-metadata">

**Author:** ![LuSchumacher](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.bayesflow.org/luschumacher/32/68_2.png) [@LuSchumacher](https://discuss.bayesflow.org/u/LuSchumacher)\
**Post date:** [June 25, 2024, 8:16am UTC](https://discuss.bayesflow.org/t/how-to-implement-a-go-nogo-paradigm/94/2 "2024-06-25T08:16:08Z")

</div>

Hi Amin,

I think this should work (but not sure though).

What you could try is to set the RT to 0 or -1 in trials where your simulator produces only a response. Also, use a one-hot encoded context variable indicating whether it is a go or a no-go trial. I am not sure if this works. Maybe you could provide a bit more details on your simulator.

Best,  
Lukas

---

<div class="post-metadata">

**Author:** ![KLDivergence](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.bayesflow.org/kldivergence/32/15_2.png) [@KLDivergence](https://discuss.bayesflow.org/u/KLDivergence)\
**Post date:** [June 25, 2024, 9:05am UTC](https://discuss.bayesflow.org/t/how-to-implement-a-go-nogo-paradigm/94/3 "2024-06-25T09:05:34Z")

</div>

I second that Lukas suggested. Simply code the non-responses as -1 (ideally it should be a value that does not occur in the regular data domain) and append a binary mask to your simulator outputs indicating the presence (1) or the absence of a response (0). The latter is not strictly necessary when using a filler value outside the data domain (e.g., RTs are always positive, so -1 should be fine), but it may facilitate training.

---

<div class="post-metadata">

**Author:** ![marvinschmitt](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.bayesflow.org/marvinschmitt/32/98_2.png) [@marvinschmitt](https://discuss.bayesflow.org/u/marvinschmitt)\
**Post date:** [June 25, 2024, 9:22am UTC](https://discuss.bayesflow.org/t/how-to-implement-a-go-nogo-paradigm/94/4 "2024-06-25T09:22:24Z")

</div>

I agree with the recommendations from @LuSchumacher and @KLDivergence.

To add to it, here’s a pointer to a paper on Missing Data in Neural Posterior Estimation as a source for the recommendations. The paper proposes the _special-value coding_ in conjunction with the _binary mask_ to encode missingness, but your scenario is closely related because you also aim to encode some _special_ binary structure in the data:

> **[Missing data in amortized simulation-based neural posterior estimation - PubMed](https://pubmed.ncbi.nlm.nih.gov/38885265/)**
>
> Amortized simulation-based neural posterior estimation provides a novel machine learning based approach for solving parameter estimation problems. It has been shown to be computationally efficient and able to handle complex models and data sets. Yet,...

---

<div class="post-metadata">

**Author:** ![AminGhaderi](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@AminGhaderi](https://discuss.bayesflow.org/u/AminGhaderi)\
**Post date:** [June 25, 2024, 3:12pm UTC](https://discuss.bayesflow.org/t/how-to-implement-a-go-nogo-paradigm/94/5 "2024-06-25T15:12:34Z")

</div>

I really appreciate your input.

Indeed a comparison of both ideas, filling missing RTs by -1 and adding binary indicators of the presence or absence of missing data, will be useful.

@LuSchumacher There is no special thing for the simulator yet, other than a typical go/nogo task.
