The mathematics behind ANCCR
The ANCCR (Jeong et al., 2022) model, which stands for adjusted net contingency for causal relations, proposes that mesolimbic dopaminergic conveys an adjusted net contingency for causal relationships (to biologically meaningful targets). The mathematics (and logic) behind the model go well beyond what I can cover here, but for now, it will suffice to say that the model:
- Uses a “Hebbian” mechanism to learn retrospective associations after experiencing a meaningful causal target.
- Derives prospective associations using Bayes’s rule.
- Combines those associations into contingency terms that represent dopaminergic activity.
- Uses the sign of dopaminergic activity to strengthen or weaken causal weights.
- Responds as a function of prospective associations and causal links.
1 - Maintaining stimulus representations
The degree to which a stimulus at time is “active” in memory is denoted by:
where are all the time steps up to time , and is a time constant (usually meant to be the inter-reward rate)1
2 - Learning stimulus associations:
The model learns retrospective associations after meaningful causal targets occur. Whether event is a meaningful causal target is given by:
where plays the role of an indicator function, is the total dopamine activity at the time of event , is the unconditioned value of event and is a global threshold parameter.2 Note that the indicator function is self-preserving: once a stimulus becomes a meaningful causal target, it does not stop being so.
After stimulus is observed, the predecessor representation contingency, or PRC, for each stimulus is updated via:
where is the predecessor representation of given has occurred, and is the base rate with which occurs. Both of these quantities are given by:
and
where and are the quantities before was observed, and are learning rate parameters, and is the eligibility trace of stimulus at the time occurs (see Eq. 1).
Then, the PRC can be used to derive the prospective association, aptly named the successor representation contingency, or SRC via Bayes rule:
The base rate for , is calculated via Eq.4b.
3 - Releasing Dopamine
The model postulates that dopaminergic signaling encodes the adjusted net contingencies for causal relations between stimuli, or ANCCRs. The total dopaminergic activity at the time of event is equal to:
And the ANCCR from stimulus to stimulus is given by:
where is the net contingency between stimuli and , is the causal weight that has with , is the recency of stimulus with respect to stimulus , and is an indicator function denoting whether and have a putative causal relationship with each other.
The net contingency between stimuli and , , is given by:
or a weighted sum of successor and predecessor representation contingencies.
The net contingency is used to calculate the indicator function above, as:
where is the same threshold parameter used in Eq.23, and the indicator function for a stimulus and itself, , is 0.
The recency term, , is given by:
where is the same parameter used in Eq.1. Note however that Eq.9 does not include the sum term in Eq. 1. Finally, the causal weight from stimulus to stimulus is given by:
where is the previous causal weight, is a learning rate parameter exclusive for causal weights, and is a delta term depending on the sign of the total dopaminergic activity, given by:
where above is the reward magnitude of stimulus . In plain words, when dopaminergic activity is positive, causal weights (from all present and absent stimuli) strengthen. Conversely, when dopaminergic activity is negative, causal weights (from all present and absent stimuli) weaken, proportional to their normalized frequency and recency (as long as they have putative causal relations with ).
4 - Generating responses
Responding in ANCCR is lightly specified. The value of responding upon presentation of stimulus is given by:
which can then be mapped onto probabilities via a softmax function4.
A diagram
The diagram below shows the dependencies in the model. I am excluding the indicator functions and parameters for simplicity.5
Note
The implementation of this model is a port from the MATLAB code that
Jeong et al. shared in the GitHub repository
associated with their paper. The output of the R model was checked
against the outputs of the MATLAB model, using training routines
(“eventlogs” in their parlance) generated using their MATLAB code. The
training routines generated in calmr
differ somewhat, to
accommodate generality. For example, as of version 0.6.1
,
it is not possible to specify probabilistic relations between cues and
rewards. Instead, it is left to the user to specify an exact probability
via trial numbers (e.g., an 80% reward probability can be specified as
“80A>(US)/20A”). The naming of parameters also differs between
codebases.