Skip to main content

No project description provided

Project description

https://github.com/tillahoffmann/gptools/actions/workflows/main.yml/badge.svg https://readthedocs.org/projects/gptools-stan/badge/?version=latest https://img.shields.io/pypi/v/gptools-stan https://img.shields.io/static/v1?label=&message=GitHub&color=gray&logo=github

Gaussian processes (GPs) are flexible distributions to model functional data. Whilst theoretically appealing, they are computationally cumbersome except for small datasets. This package implements two methods for scaling GP inference in Stan:

  1. a sparse-approximation of the likelihood that is generally applicable.

  2. an exact method for regularly spaced data modeled by stationary kernels using fast Fourier-methods.

The implementation follows Stan’s design and exposes performant inference through a familiar interface.

Getting Started

The library is loaded with Stan’s #include statement, and methods to evaluate or approximate the likelihood of a GP use the declarative ~ sampling syntax. The following brief example uses Fourier-methods to sample GP realizations.

You can learn more by following the docs/examples or delving into the docs/interface. The docs/background section offers a deeper explanation of the methods used to evaluate likelihoods and the pros and cons of different parameterizations. See the accompanying publication “Scalable Gaussian process inference with Stan” for further details.

Installation

If you have a recent python installation, the library can be installed by running

pip install gptools-stan

from the command line. The library exposes a function gptools.stan.compile_model for compiling cmdstanpy.CmdStanModels with the correct include paths. For example, the example above can be compiled using the following snippet.

stan_file = “stan/docs/getting_started/getting_started.stan”

>>> from gptools.stan import compile_model
>>>
>>> # stan_file = path/to/getting_started.stan
>>> model = compile_model(stan_file=stan_file)
>>> model.name
'getting_started'

If you use cmdstanr or another Stan interface, you can download the library files from GitHub. Then add the library location to the compiler include_paths as described in the manual (see here for cmdstanr instructions).

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

gptools-stan-0.1.1.tar.gz (20.3 kB view hashes)

Uploaded Source

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