mTRFpy - multivariate linear modeling
This is an adaptation of the matlab mTRF-toolbox using only basic Python and Numpy. It aims to implement the same methods as the original toolbox and advance them. This documentation provides tutorial-like demonstrations of the core functionalities like model fitting, visualization and optimization as well as a comprehensive reference documentation.
News
- [2025.10.13] 🔧 Version 2.1.1 has been released for fixing the bug when fs is provided as a native int. A native int causes the array-api-compat.floor/ceil throw the error that fs doesn't have the attribute 'dtype'.
- [2025.10.11] 🚀 Version 2.1.0 has been released! mTRFpy is now compatible with the Array API standard through array-api-compat. ✨ New feature: Support for fitting a separate regularization parameter for each output channel.
Installation
You can get the stable release from PyPI:
pip install mtrf
Or get the latest version from this repo:
pip install git+https://github.com/powerfulbean/mTRFpy.git
While mTRFpy only depends on numpy, matplotlib is an optional dependency used to visualize models. It can also be installed via pip:
pip install matplotlib
We also provide an optional interface to MNE-Python so it might be useful to install mne as well.
Getting started
For a little tutorial on the core features of mTRFpy, have a look at our online documentation
Found a bug?
- Please use the issue search to check if the issue has already been reportet.
- Try to reproduce problem using the latest
masterbranch. - Create an issue with a minimal example that reproduces the problem.
Missing a feature?
Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.
Want to contribute to the project?
Great! Please take a moment to read the before you do.
Citing mTRFpy
Bialas et al., (2023). mTRFpy: A Python package for temporal response function analysis. Journal of Open Source Software, 8(89), 5657, https://doi.org/10.21105/joss.05657
@article{Bialas2023,
doi = {10.21105/joss.05657},
url = {https://doi.org/10.21105/joss.05657},
year = {2023}, publisher = {The Open Journal},
volume = {8},
number = {89},
pages = {5657},
author = {Ole Bialas and Jin Dou and Edmund C. Lalor},
title = {mTRFpy: A Python package for temporal response function analysis},
journal = {Journal of Open Source Software} }
Metadata
Release files for mtrf 2.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mtrf-2.1.2.tar.gz | 23.8 kB | Without provenance | Details for mtrf-2.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mtrf-2.1.2-py3-none-any.whl | Python 3 | none | any | Details for mtrf-2.1.2-py3-none-any.whl |
Total release size: 45.1 kB
Release files / mtrf-2.1.2.tar.gz
| Download URL | mtrf-2.1.2.tar.gz |
|---|---|
| Size | 23.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa111e8b17d68ede1f76dfa29950003bf2192c308f4fe8bc15bfe00579f6bf53
|
|
BLAKE2b-256 checksum How to use checksums |
6f73239079ba7636b1e063697d93a691349632fd1f533806ebde154c84eb5c9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / mtrf-2.1.2-py3-none-any.whl
| Download URL | mtrf-2.1.2-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e64e51aabfdb937e729baa64a8f206e2a0216526e290f61ade17f834bf97549
|
|
BLAKE2b-256 checksum How to use checksums |
b100069a8f4aa148419bf9fd685be7434f3f994856fabc9888410e889e4cc833
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for mtrf 2.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.