mtdr¶
Model-based targeted dimensionality reduction (mTDR) for neural population data, in Python.
mTDR models population activity on trial \(k\) as a sum of low-rank, time-varying regression coefficient matrices, one per task variable:
and chooses each rank \(r_p\) by AIC. A per-trial observation mask lets neurons recorded in different sessions be fitted jointly.
Start with Getting started to fit, evaluate and decode data
with MTDR. The model and its estimation explains
the assumptions and outputs; Differences from MATLAB
describes validation and departures from the reference. Data utilities, plotting,
simulation and functional estimators are documented in the API reference.
Status: alpha
The API may still change between minor versions before 1.0; changes are listed in the Changelog.
Installation¶
pip install mtdr # the core: NumPy and SciPy
pip install "mtdr[plot,xarray]" # with the optional extras
The core needs only NumPy and SciPy (Python >= 3.11). The extras are optional:
plot: matplotlib, formtdr.plot;xarray: xarray and pandas, forMTDR.to_xarrayandRankSearchHistory.to_frame.
For development (tests, linters, this site): pip install -e ".[dev]".
Notation and references¶
- (Mk) is equation k of The model and its estimation, the derivation the code implements; the docstrings cite these numbers.
- NeurIPS supplement and Nature Neuroscience supplement refer to the supplements of Aoi & Pillow (2018) and Aoi, Mante & Pillow (2020). Citations specify a section (ยง), equation (eq.) or algorithm within the supplement.
Credit¶
mTDR was introduced by Aoi & Pillow (NeurIPS 2018) and Aoi, Mante & Pillow
(Nature Neuroscience 2020). This package is an independent Python port of the
authors' MATLAB demo, pillowlab/mTDRdemo,
made by reproducing that code's output; it is not affiliated with or endorsed by the
authors. Please cite both papers along with this software.
Differences from MATLAB explains how the port was checked,
where its defaults and results differ from the demo's, and which options restore the
reference's behaviour.