Modeling Dreams

Dreams are a universal and critical human experience. In the far past of our species right up to the present day, dreams and nightmares have been associated with profound meaning. Some dreams seem to convey religious revelations while others express our deepest moral feelings and thoughts. CMAC is harnessing the potential of computational models for sleep and dream/nightmare studies through several sub-projects. We employ a wide range of techniques from individual dream narratives to longitudinal dream journals, and from sleep studies to life histories. We aim to tease out the ways dreams and waking life are entangled, which will shed light on big questions such as the evolutionary origins of religion and morality, the formation of life-guiding conviction, how dreams turn to nightmares (and how we can regain control if they do) and the role dreaming could play in the formation of religious and supernatural beliefs.


CMAC is putting the power of Virtual Reality to a creative use: subduing the nightmares that keep us awake. We have developed program called ReScript that can help those with Nightmare Disorder condition their brains, gaining greater control over visual imagery. They can then use those skills to dispel their nightmares.

Users are shown generic images that are violent, intense or scary and are not connected to their personal experiences. They use the tools provided to edit those images into a form they prefer – for example, changing a shot of a charging bear into a movie poster, or making a shark friendly with a smile. After changing the image, they record a new narrative that reinterprets the image within a new framework, and they then listen to their own voices. This process of repetition enables them to systematically build better and better control over distressing imagery.

In a pilot study, team members found that the ReScript therapy was significant in reducing anxiety and improving image control. This finding indicates that there is great potential in refining technologies such as the Oculus Rift for the mental health field. By taking a step into the virtual world, ReScript may empower those who are suffering to find effective control over their own minds.

Cognitive Neuroscience of Religious Cognition

How does REM sleep affect one’s sense of attachment to people in one’s social network?
Does it similarly impact one’s sense of attachment to gods and other supernatural agents?

A new research project led by CMAC co-founder Dr. Patrick McNamara and Northcentral University is attempting to answer these questions. The project will assess the impact of the quantity and quality of nightly REM sleep upon participant’s sense of attachment to people in their social networks as well as to gods and other supernatural agents. Through a subcontract with NCU, researchers at CMAC will also be building and preregistering a computational model that expresses a complex hypothesis about REM sleep’s role in reinforcing attachment.

This project looks at the intricate connections between dreams and the construction of human meanings. In this effort to tease out the ways that dreams and religion are entangled, CMAC employs a wide range of techniques, from individual dream narratives to longitudinal dream journals, sleep studies to life histories. CMAC is currently focused on creating a preliminary working computational simulation of the REM-Theta system in individual AI agents and an artificial society in which AI agents interact around religious cognitions. Data gathered fromthe sleep surveys will be analyzed to validate the REM-Theta model.

Neurocomputational Theory of Nightmares

CMAC created an agent-based model of the qualitative effects of imagery in nightmare disorders. Building on Levin & Nielsen’s Affective Network Dysfunction (AND) model, we incorporated quantitative effects of image characteristics including valence, dominance, and arousal.

The Disturbed Dreaming Model (DDM) expressed the neuropsychology of dreaming and nightmare processing as an extension of the AND model. We explored the DDM parameter space by varying parameters, running approximately one million runs, each for one month of model time, varying pathway bifurcation thresholds, image characteristics, and individual-difference variables to quantitively evaluate their combinatory effects on nightmare symptomology.

We are continuing to develop the DDM model by collecting data to update and calibrate individual differences variables in the model and for use as a virtual testing platform for experimenting with nightmare mechanisms and therefore treatment alternatives, probing their benefits and risks relative to individual differences, treatment modalities, and dosage. This is a necessary next step in bringing safe, short-term and effective imagery-based therapies to portable hand-held devices.

Latest updates

No posts found.


P. McNamara, W. Wildman, G. Hodulik, D. Rohr, “A neurocomputational theory of nightmares: the role of formal properties of nightmare images,” SLEEP Advances, June 17, 2021.

Mcalpine, Kat, “How virtual reality might help fight recurring nightmares,” Medical X Press, February 1, 2019.

Futurity News, “V.R. could take scary nightmares down a notch,” Medium, January 30, 2019.

P. McNamara, K. Moore, Y. Papelis, “Virtual reality-enabled treatment of nightmares,” Dreaming (American Psychological Association), 2018.