<commit_before>---
layout: post
title: "Bayesian model of recognition memory"
date: 2017-11-22
categories:
- Bayesian
- Psychophysics
description:
image: https://sammosummo.github.io/images/glass-tears-1932.jpg
image-sm: https://sammosummo.github.io/images/glass-tears-1932-sm.jpg
image-description: "Glass Tears (1932) by <NAME>"
---
Recognition-memory experiments require subjects to memorise a set of stimuli (targets) and subsequently discriminate them from new stimuli (foils), typically rating the confidence of their responses. In this post, I describe a Bayesian hierarchical model for applying signal detection theory (SDT) to data from such experiments.

A classic finding from studies of recognition memory is that receiver operating characteristic (ROC) curves are asymmetric. This asymmetry occurs because the variance associated with the target stimuli is greater than that associated with the foils. It has been suggested that ROC asymmetry could be a methodological artifact, related to averaging over items and/or stimuli, rather than a feature of recognition memory per se. This possibility was investigated by Pratte and colleagues, who applied a Bayesian hierarchical SDT model (developed in an earlier paper) which separated methodological and memory-based influences on the data. They concluded that although there were clear methodological effects, ROC asymmetry was indeed related to memory.

A typical experiment
---------------------

A typical recognition-memory experiment consists of two phases. During the *learning phase*, the subject is presented with a sequence of target stimuli, such as words or faces, and is instructed to remember them. Later, during the *test phase*, the subject is presented with a mixture of targets and foils (one per trial). On each trial, the subject discriminates whether the stimulus was a target or foil using a confidence-rating scheme. For example, the subject may be asked whether they were presented with the stimulus previously, and the response options may be ’definitely no’, ‘perhaps no’, ‘perhaps yes’, and ‘definitely yes’. In what follows, I assume that there are always four response options, but the model and code can be modified to include more or fewer response options, as necessary.

The decision process
--------------------- 

Let $$y$$ denote the subject’s response on a given trial with $$y =1$$ denoting ’definitely no’, $$y=2$$ denoting ‘perhaps no’, and so on. We assume that the subject bases his or her response on a latent decision variable, $$\psi$$, which corresponds to the perceived familiarity of the stimulus. A large value of $$\psi$$ corresponds to a highly familiar stimulus. The decision rule can be written as follows

$$
y=1\textrm{ if }c_0<\psi\le{}c_1
y=2\textrm{ if }c_1<\psi\le{}c_2
y=3\textrm{ if }c_2<\psi\le{}c_3
y=4textrm{ if }c_3<\psi\le{}c_4
$$

where $$c$$ are response criteria: $c_0=-\inf$, $c_2=0$, $c_4=\inf$, and $c_1$ and $c_3$ are free parameters. <commit_msg>changed logo<commit_after>---
layout: post
title: "Bayesian model of recognition memory"
date: 2017-11-22
categories:
- Bayesian
- Psychophysics
description:
image: https://sammosummo.github.io/images/glass-tears-1932.jpg
image-sm: https://sammosummo.github.io/images/glass-tears-1932-sm.jpg
image-description: "Glass Tears (1932) by <NAME>"
---
Recognition-memory experiments require subjects to memorise a set of stimuli (targets) and subsequently discriminate them from new stimuli (foils), typically rating the confidence of their responses. In this post, I describe a Bayesian hierarchical model for applying signal detection theory (SDT) to data from such experiments.

A classic finding from studies of recognition memory is that receiver operating characteristic (ROC) curves are asymmetric. This asymmetry occurs because the variance associated with the target stimuli is greater than that associated with the foils. It has been suggested that ROC asymmetry could be a methodological artifact, related to averaging over items and/or stimuli, rather than a feature of recognition memory per se. This possibility was investigated by Pratte and colleagues, who applied a Bayesian hierarchical SDT model (developed in an earlier paper) which separated methodological and memory-based influences on the data. They concluded that although there were clear methodological effects, ROC asymmetry was indeed related to memory.

A typical experiment
---------------------

A typical recognition-memory experiment consists of two phases. During the *learning phase*, the subject is presented with a sequence of target stimuli, such as words or faces, and is instructed to remember them. Later, during the *test phase*, the subject is presented with a mixture of targets and foils (one per trial). On each trial, the subject discriminates whether the stimulus was a target or foil using a confidence-rating scheme. For example, the subject may be asked whether they were presented with the stimulus previously, and the response options may be ’definitely no’, ‘perhaps no’, ‘perhaps yes’, and ‘definitely yes’. In what follows, I assume that there are always four response options, but the model and code can be modified to include more or fewer response options, as necessary.

The decision process
--------------------- 

Let $$y$$ denote the subject’s response on a given trial with $$y =1$$ denoting ’definitely no’, $$y=2$$ denoting ‘perhaps no’, and so on. We assume that the subject bases his or her response on a latent decision variable, $$\psi$$, which corresponds to the perceived familiarity of the stimulus. A large value of $$\psi$$ corresponds to a highly familiar stimulus. The decision rule can be written as follows

$$
y=1\textrm{ if }c_0<\psi\le{}c_1\\
y=2\textrm{ if }c_1<\psi\le{}c_2\\
y=3\textrm{ if }c_2<\psi\le{}c_3\\
y=4textrm{ if }c_3<\psi\le{}c_4\\
$$

where response criteria $$c_0=-\inf$$, $$c_2=0$$, $$c_4=\inf$$, and $$c_1$$ and $$c_3$$ are free parameters. 
{'fraction_non_alphanumeric': 0.08796916890080429, 'fraction_numerical': 0.013404825737265416, 'mean_word_length': 4.537105751391466, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1335814', 'n_tokens_mistral': 1557, 'n_tokens_neox': 1444, 'n_words': 817}