CyMR: Computational modeling of free recall data
Project description
cymr
Package for fitting and simulating free recall data. Includes a fast implementation of the context maintenance and retrieval (CMR) model using Cython.
See the website for full documentation.
Installation
For the latest stable version:
pip install cymr
To get the development version:
pip install git+https://github.com/mortonne/cymr
To install for development, clone the repository and run:
python install -e .
This will set links to the package modules so that you can edit the source code and have changes be reflected in your installation.
Quickstart
Fit the context maintenance and retrieval model (CMR) to sample data:
from cymr import fit, cmr
# load sample data
data = fit.sample_data('Morton2013_mixed').query('subject <= 3')
# define model weights
n_items = 768
param_def, patterns = cmr.config_loc_cmr(n_items)
param_def.set_fixed(
T=0.1, Lfc=0.15, Lcf=0.15, Afc=0, Acf=0, Dfc=0.85, Dcf=0.85,
P1=0.2, P2=2, B_start=0.3, B_rec=0.9, X1=0.001, X2=0.25
)
param_def.set_free(B_enc=(0, 1))
# fit the model to sample data
model = cmr.CMR()
results = model.fit_indiv(data, param_def, patterns=patterns, tol=0.1)
See the documentation for details.
Unit tests
First, install extra packages needed for testing:
pip install .[test]
To run all tests (from the main repository directory)
pytest
Benchmark
To run a speed benchmark test, first install snakeviz (pip install snakeviz
).
To run likelihood calculation with a sample dataset and then display an html
report:
./benchmark
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file cymr-0.12.1.tar.gz
.
File metadata
- Download URL: cymr-0.12.1.tar.gz
- Upload date:
- Size: 622.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe8449b56aa10af34907277a935947b1651677b49ae7ff3cba90cd133049f06f |
|
MD5 | 416568d3608632357210efdb9da6a01f |
|
BLAKE2b-256 | b7ef642eff18581b60ce229cb4fa42c62ff54a8d13906a579b2a38a401f0a535 |