Skip to main content

Gaussian processes in nonlinear least-squares fits

Project description

PyPI Tests

lsqfitgp

Python module for manipulating gaussian processes. Features:

  • Use gvar to keep track transparently of correlations between prior, data and posterior.

  • Fit a latent gaussian process in a nonlinear model with lsqfit.

  • autograd-friendly.

  • Supports multidimensional structured non-numerical input with named dimensions.

  • Apply arbitrary linear transformations to the process.

  • Use dictionaries to manipulate hyperparameters and hyperpriors. Use gvar.BufferDict to transparently apply transformations.

  • Get a covariance matrix for the optimized hyperparameters.

Installation

Python >= 3.6 required. Then:

$ pip install lsqfitgp

Documentation

The complete manual is available online at gattocrucco.github.io/lsqfitgp/docs. All the code is documented with docstrings, so you can also use the Python help system directly from the shell:

>>> import lsqfitgp as lgp
>>> help(lgp)
>>> help(lgp.something)

or, in an IPython shell/Jupyter notebook/Spyder IDE, use the question mark shortcut:

In [1]: lgp?

In [2]: lgp.something?

Development

Clone the repository, create a virtual environment and install the requirements:

$ git clone https://github.com/Gattocrucco/lsqfitgp.git
$ cd lsqfitgp
$ python -m venv myenv
$ . myenv/bin/activate
(myenv) $ pip install -r requirements.txt

The Makefile in the root directory contains targets to build the documentation, run the tests, and prepare a release. Run make without arguments to show the available targets:

$ make
available targets: upload release tests examples docscode docs covreport
release = tests examples docscode docs (in order)
$ make tests # or make examples, or ...

The tests are run on each push and the resulting coverage report is published online at gattocrucco.github.io/lsqfitgp/htmlcov. To browse it locally after make tests etc., do make covreport and open htmlcov/index.html in your browser.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lsqfitgp-0.8.tar.gz (62.5 kB view hashes)

Uploaded Source

Built Distribution

lsqfitgp-0.8-py3-none-any.whl (70.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page