https://github.com/unfoldtoolbox/unfoldmixedmodels.jl
https://github.com/unfoldtoolbox/unfoldmixedmodels.jl
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/unfoldtoolbox/unfoldmixedmodels.jl
- Owner: unfoldtoolbox
- License: mit
- Created: 2025-01-11T19:08:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-27T01:12:01.000Z (11 months ago)
- Last Synced: 2025-09-05T08:15:43.909Z (11 months ago)
- Language: Julia
- Size: 1.74 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
Awesome Lists containing this project
README
# 
[](https://unfoldtoolbox.github.io/UnfoldDocs/UnfoldMixedModels.jl/stable)
[](https://unfoldtoolbox.github.io/UnfoldDocs/UnfoldMixedModels.jl/dev)
[](https://github.com/unfoldtoolbox/UnfoldMixedModels.jl/actions)
[](https://github.com/unfoldtoolbox/UnfoldMixedModels.jl/actions/workflows/Test.yml?query=branch%3Amain)
[](https://github.com/unfoldtoolbox/UnfoldMixedModels.jl/actions/workflows/Lint.yml?query=branch%3Amain)
[](https://github.com/unfoldtoolbox/UnfoldMixedModels.jl/actions/workflows/Docs.yml?query=branch%3Amain)
[](https://codecov.io/gh/unfoldtoolbox/UnfoldMixedModels.jl)
[](https://doi.org/FIXME)
[](CODE_OF_CONDUCT.md)
[](#contributors)
|Estimation|Visualisation|Simulation|BIDS pipeline|Decoding|Statistics|MixedModelling|
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
UnfoldMixedModels.jl is a package to perform hierarchical regression / **linear mixed models** on biological signals. As an experimental feature, it further allows to perform simultaneous overlap-correction / deconvolution.
This kind of modelling is also known as encoding modeling, linear deconvolution, Temporal Response Functions (TRFs), linear system identification, and probably under other names. fMRI models with HRF-basis functions and pupil-dilation bases are also supported.
## Getting started
### 🐍Python User?
We clearly recommend Julia 😉 - but [Python users can use juliacall/Unfold directly from python!](https://unfoldtoolbox.github.io/UnfoldDocs/Unfold.jl/dev/generated/HowTo/juliacall_unfold/)
### Julia installation
Click to expand
The recommended way to install julia is [juliaup](https://github.com/JuliaLang/juliaup).
It allows you to, e.g., easily update Julia at a later point, but also test out alpha/beta versions etc.
TL:DR; If you dont want to read the explicit instructions, just copy the following command
#### Windows
AppStore -> JuliaUp, or `winget install julia -s msstore` in CMD
#### Mac & Linux
`curl -fsSL https://install.julialang.org | sh` in any shell
### UnfoldMixedModels.jl installation
```julia
using Pkg
Pkg.add("UnfoldMixedModels")
```
## Usage
Please check out [the documentation](https://unfoldtoolbox.github.io/UnfoldDocs/UnfoldMixedModels.jl) for extensive tutorials, explanations and more!
### Tipp on Docs
You can read the docs online: [](https://unfoldtoolbox.github.io/UnfoldDocs/UnfoldMixedModels.jl/stable) - or use the `?fit`, `?effects` julia-REPL feature. To filter docs, use e.g. `?fit(::UnfoldMixedModel)`
Here is a quick overview on what to expect.
### What you need
```julia
using UnfoldMixedModels
events::DataFrame
# formula with or without random effects
fLMM = @formula 0~1+condA+(1|subject) + (1|item)
# in case of [overlap-correction] we need continuous data plus per-eventtype one basisfunction (typically firbasis)
data::Array{Float64,2}
basis = firbasis(τ=(-0.3,0.5),srate=250) # for "timeexpansion" / deconvolution
# in case of [mass univariate] we need to epoch the data into trials, and a accompanying time vector
epochs::Array{Float64,3} # channel x time x epochs (n-epochs == nrows(events))
times = range(0,length=size(epochs,3),step=1/sampling_rate)
```
To fit any of the models, Unfold.jl offers a unified syntax:
| Overlap-Correction | Mixed Modelling | julia syntax |
|:---:|:---:|---|
| | x | `fit(UnfoldModel,[Any=>(fLMM,times)),evts,data_epoch]` |
| x | x | `fit(UnfoldModel,[Any=>(fLMM,basis)),evts,data]` |
## Contributions
Contributions are very welcome. These could be typos, bugreports, feature-requests, speed-optimization, new solvers, better code, better documentation.
### How-to Contribute
You are very welcome to raise issues and start pull requests!
### Adding Documentation
1. We recommend to write a Literate.jl document and place it in `docs/literate/FOLDER/FILENAME.jl` with `FOLDER` being `HowTo`, `Explanation`, `Tutorial` or `Reference` ([recommended reading on the 4 categories](https://documentation.divio.com/)).
2. Literate.jl converts the `.jl` file to a `.md` automatically and places it in `docs/src/generated/FOLDER/FILENAME.md`.
3. Edit [make.jl](https://github.com/unfoldtoolbox/UnfoldMixedModels.jl/blob/main/docs/make.jl) with a reference to `docs/src/generated/FOLDER/FILENAME.md`.
## Contributors
This project follows the [all-contributors](https://allcontributors.org/docs/en/specification) specification.
Contributions of any kind welcome!
## Citation
For now, please cite
[](https://doi.org/10.5281/zenodo.5759066) and/or [Ehinger & Dimigen](https://peerj.com/articles/7838/)
## Acknowledgements
This work was initially supported by the Center for Interdisciplinary Research, Bielefeld (ZiF) Cooperation Group "Statistical models for psychological and linguistic data".
Funded by Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany´s Excellence Strategy – EXC 2075 – 390740016