Metadata-Version: 2.1
Name: lqg
Version: 0.1.5
Summary: (Inverse) optimal control for linear quadratic Gaussian systems
Home-page: https://github.com/dominikstrb/lqg
Author: Dominik Straub
Author-email: dominik.straub@tu-darmstadt.de
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# Inverse optimal control for continuous psychophysics

![Experimenter-actor-loop](https://raw.githubusercontent.com/RothkopfLab/lqg/main/img/experimenter-actor-loop.png)


This repository contains the official implementation of the inverse optimal control method presented in the paper:

> Straub, D., & Rothkopf, C. A. (2021). Putting perception into action: Inverse optimal control for continuous psychophysics. [bioRxiv.](https://www.biorxiv.org/content/10.1101/2021.12.23.473976v1.abstract)

## CCN 2022 tutorial
For our [tutorial at CCN 2022](https://2022.ccneuro.org/view_event.php?mid=19), you can follow along in the Jupyter notebook [CCN_2022_Tutorial.ipynb](https://github.com/RothkopfLab/lqg/blob/main/CCN_2022_Tutorial.ipynb). To run the notebook, you can either install the `lqg` package locally (see [below](https://github.com/RothkopfLab/lqg#installation)) or [open it in the browser](https://colab.research.google.com/github/dominikstrb/lqg/blob/main/CCN_2022_Tutorial.ipynb) on Google Colab.

## Installation
The package can be installed via `pip`

```bash
python -m pip install lqg
```

although I recommend cloning the repository to get the most recent version and installing locally with a virtual environment

```bash
python -m venv env
source env/bin/activate
python -m pip install -e .
```

## Usage examples
- `main.py` shows how to simulate data and infer parameters using the LQG model of the tracking task.

- [`notebooks/01-HowTo.ipynb`](https://github.com/RothkopfLab/lqg/blob/main/notebooks/01-HowTo.ipynb) explains the model and its parameters in more detail, including the extension to subjective internal models.

- [`notebooks/02-Data.ipynb`](https://github.com/RothkopfLab/lqg/blob/main/notebooks/02-Data.ipynb) fits the ideal observer and bounded actor model to the [data](https://github.com/kbonnen/BonnenEtAl2015_KalmanFilterCode) from [Bonnen et al. (2015)](https://jov.arvojournals.org/article.aspx?articleid=2301260) to reproduce Fig. 4A from our paper.

## Citation
If you use our method in your research, please cite our preprint:

```
@article{straub2021putting,
  title={Putting perception into action: Inverse optimal control for continuous psychophysics},
  author={Straub, Dominik and Rothkopf, Constantin A},
  journal={bioRxiv},
  year={2021},
  publisher={Cold Spring Harbor Laboratory}
}
```
