cpm.applications#

Ready-made models from the literature. Most are subclasses of Wrapper, so they can be simulated and fitted like any model you build yourself. They compute all trials of a participant at once, and are compiled with numba if it is installed; see Speed up fitting with numba.

Reinforcement learning#

reinforcement_learning.RLRW

The class implements a simple reinforcement learning model for a multi-armed bandit tasks using a standard update rule calculating prediction error and a Softmax decision rule.

reinforcement_learning.HybridMBMF

The class implements the hybrid model-based / model-free reinforcement learning model for the deterministic two-step task (Kool et al., 2016), in the 6-parameter variant used by Smid et al. (2022).

Decision making#

decision_making.PTSM

A simplified version of the Prospect Theory-based Softmax Model (PTSM) for decision-making tasks based on Tversky & Kahneman (1992), similar to the initial publication of the theory in Kahneman & Tversky (1979).

decision_making.PTSM1992

A Prospect Theory-based Softmax Model (PTSM) for decision-making tasks based on Tversky & Kahneman (1992), similar to the initial publication of the theory in Kahneman & Tversky (1979).

decision_making.PTSM2025

An Prospect Theory Softmax Model loosely based on Chew et al. (2019), incorporating a bias term (phi_gain / phi_loss) in the softmax function for risks and gains, a utility curvature parameter (alpha) for non-linear utility transformations, and an ambiguity aversion parameter (eta).

Metacognition#

signal_detection.EstimatorMetaD

Class to estimate metacognitive parameters using the meta-d model proposed by Maniscalco and Lau (2012).

signal_detection.fit_metad

Estimate metacognitive parameters using the meta-d model proposed by Maniscalco and Lau (2012).

signal_detection.metad_nll

Evaluate the negative log-likelihood of the parameters given the data.