gptools-stan

Gaussian processes on graphs and lattices in Stan.

https://github.com/onnela-lab/gptools

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.2%) to scientific vocabulary

Keywords

fft gaussian-processes graph stan
Last synced: 6 months ago · JSON representation ·

Repository

Gaussian processes on graphs and lattices in Stan.

Basic Info
Statistics
  • Stars: 18
  • Watchers: 3
  • Forks: 0
  • Open Issues: 2
  • Releases: 0
Topics
fft gaussian-processes graph stan
Created about 3 years ago · Last pushed 11 months ago
Metadata Files
Readme License Citation

README.md

gptools: Performant Gaussian Processes in Stan gptools: Python gptools: R

Gaussian processes (GPs) are powerful distributions for modeling functional data, but using them is computationally challenging except for small datasets. gptools implements two methods for performant GP inference in Stan.

  1. A sparse approximation of the likelihood. This approach includes nearest neighbor Gaussian processes but also supports more general dependence structures, e.g., for periodic kernels.
  2. An exact likelihood evaluation for data on regularly spaced lattices using fast Fourier transforms.

The implementation follows Stan’s design and exposes performant inference through a familiar interface. We provide interfaces in Python and R. See the accompanying publication Scalable Gaussian Process Inference with Stan for details of the implementation. The comprehensive documentation includes many examples.

Getting Started

You can use the gptools package by including it the functions block of your Stan program, e.g.,

stan functions { // Include utility functions, such as real fast Fourier transforms. #include gptools/util.stan // Include functions to evaluate GP likelihoods with Fourier methods. #include gptools/fft.stan }

See here for the list of all include options. You can download the Stan files and use them with your favorite interface or use the provided Python and R interfaces.

Python and cmdstanpy

  1. Install cmdstanpy and cmdstan if you haven't already (see here for details).
  2. Install gptools from PyPI by running pip install gptools-stan from the command line.
  3. Compile your first model.

```python from cmdstanpy import CmdStanModel from gptools.stan import get_include

model = CmdStanModel( stanfile="path/to/your/model.stan", stancoptions={"include-paths": get_include()}, ) ```

For an end-to-end example, see this notebook.

R and cmdstanr

  1. Install cmdstanr and cmdstan if you haven't already (see here for details).
  2. Install gptools from CRAN by running install.packages("gptoolsStan").
  3. Compile your first model.

```r library(cmdstanr) library(gptoolsStan)

model <- cmdstanmodel( stanfile="path/to/your/model.stan", includepaths=gptoolsinclude_path(), ) ```

[!NOTE] Unfortunately, Rstan is not supported because it does not provide an option to specify include paths.

For an end-to-end example, see this vignette.

Contributing

Contributions to the package are always welcome! The repository structure is as follows:

  • stan/gptools contains the core implementation of gptools.
  • python/stan contains the Python wrapper for gptools.
  • R contains the R wrapper for gptools.
  • docs contains the documentation hosted at https://gptools-stan.readthedocs.io.

Replicating the Results

To replicate the results presented in the accompanying publication Scalable Gaussian Process Inference with Stan, please see the dedicated repository of replication materials.

Owner

  • Name: onnela-lab
  • Login: onnela-lab
  • Kind: organization

Citation (CITATION.cff)

# yaml-language-server: $schema=https://citation-file-format.github.io/1.2.0/schema.json
cff-version: 1.2.0
message: If you use this software, please cite it as below.
title: Scalable Gaussian Process Inference with Stan
url: "https://github.com/onnela-lab/gptools"
authors:
- family-names: Hoffmann
  given-names: Till
  orcid: https://orcid.org/0000-0003-4403-0722
- family-names: Onnela
  given-names: Jukka-Pekka
  orcid: https://orcid.org/0000-0001-6613-8668
preferred-citation:
  type: article
  authors:
  - family-names: Hoffmann
    given-names: Till
    orcid: https://orcid.org/0000-0003-4403-0722
  - family-names: Onnela
    given-names: Jukka-Pekka
    orcid: https://orcid.org/0000-0001-6613-8668
  doi: 10.18637/jss.v112.i02
  journal: Journal of Statistical Software
  volume: 112
  issue: 2
  start: 1
  end: 31
  title: Scalable Gaussian Process Inference with Stan
  year: 2025

GitHub Events

Total
  • Issues event: 3
  • Watch event: 3
  • Delete event: 6
  • Issue comment event: 6
  • Push event: 47
  • Pull request event: 14
  • Create event: 6
Last Year
  • Issues event: 3
  • Watch event: 3
  • Delete event: 6
  • Issue comment event: 6
  • Push event: 47
  • Pull request event: 14
  • Create event: 6

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 5
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 2 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 4.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 5
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 2 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 4.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • tillahoffmann (2)
  • andrewGhazi (1)
Pull Request Authors
  • tillahoffmann (8)
Top Labels
Issue Labels
enhancement (2)
Pull Request Labels
documentation (1) enhancement (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 97 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 10
  • Total maintainers: 1
pypi.org: gptools-stan

Gaussian processes on graphs and lattices in Stan.

  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 97 Last month
Rankings
Dependent packages count: 6.6%
Average: 18.6%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/main.yml actions
  • actions/cache v3 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • pypa/gh-action-pypi-publish release/v1 composite
dev_requirements.in pypi
  • jupytext * development
  • pip-tools * development
dev_requirements.txt pypi
  • 164 dependencies
shared_requirements.in pypi
  • docutils <0.18
  • nbclient <=0.5.13
stan/setup.py pypi
  • Required *
  • cmdstanpy >=1.0.7
  • gptools-util *
  • https *
  • numpy *
stan/test_requirements.txt pypi
  • 157 dependencies
torch/setup.py pypi
  • gptools-util *
  • numpy *
  • torch *
torch/test_requirements.txt pypi
  • 153 dependencies
util/setup.py pypi
  • numpy *
util/test_requirements.txt pypi
  • 152 dependencies
Dockerfile docker
  • python 3.10.0 build
stan/test_requirements.in pypi
torch/test_requirements.in pypi
util/test_requirements.in pypi