# Replacing nested for loops from JAGS code for cognitive model of temporal discounting

**URL:** <https://discourse.pymc.io/t/replacing-nested-for-loops-from-jags-code-for-cognitive-model-of-temporal-discounting/6763>\
**Category:** Questions\
**Created:** [February 15, 2021, 5:12am UTC](https://discourse.pymc.io/t/replacing-nested-for-loops-from-jags-code-for-cognitive-model-of-temporal-discounting/6763 "2021-02-15T05:12:21Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![drbenvincent](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/drbenvincent/32/4313_2.png) [@drbenvincent](https://discourse.pymc.io/u/drbenvincent)\
**Post date:** [February 17, 2021, 4:53pm UTC](https://discourse.pymc.io/t/replacing-nested-for-loops-from-jags-code-for-cognitive-model-of-temporal-discounting/6763/6 "2021-02-17T16:53:15Z")

</div>

> [@awhug](#):
>
> `V_A = pm.Deterministic("V_A", A / (1 + k[:, None] * DA))`

If you are dealing with data where the delayed rewards are always immediate, then all the `DA` values will be zero. I had previously gotten around this by simply setting `V_A = A`, that is the subjective value of choice A is equal to its objective value. This is only valid to do if choice A is delivered immediately and is equivalent to saying it is not discounted at all.

---

_[View the full topic](https://discourse.pymc.io/t/replacing-nested-for-loops-from-jags-code-for-cognitive-model-of-temporal-discounting/6763)._
