gptools-stan
Gaussian processes on graphs and lattices in Stan.
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
Repository
Gaussian processes on graphs and lattices in Stan.
Basic Info
- Host: GitHub
- Owner: onnela-lab
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://gptools-stan.readthedocs.io
- Size: 917 KB
Statistics
- Stars: 18
- Watchers: 3
- Forks: 0
- Open Issues: 2
- Releases: 0
Topics
Metadata Files
README.md
gptools: Performant Gaussian Processes in Stan

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.
- 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.
- 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
- Install cmdstanpy and cmdstan if you haven't already (see here for details).
- Install gptools from PyPI by running
pip install gptools-stanfrom the command line. - 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
- Install cmdstanr and cmdstan if you haven't already (see here for details).
- Install gptools from CRAN by running
install.packages("gptoolsStan"). - 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/gptoolscontains the core implementation of gptools.python/stancontains the Python wrapper for gptools.Rcontains the R wrapper for gptools.docscontains 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
- Repositories: 10
- Profile: https://github.com/onnela-lab
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
Pull Request Labels
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.
- Documentation: https://gptools-stan.readthedocs.io
- License: MIT License
-
Latest release: 1.0.0
published 11 months ago
Rankings
Maintainers (1)
Dependencies
- actions/cache v3 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- pypa/gh-action-pypi-publish release/v1 composite
- jupytext * development
- pip-tools * development
- 164 dependencies
- docutils <0.18
- nbclient <=0.5.13
- Required *
- cmdstanpy >=1.0.7
- gptools-util *
- https *
- numpy *
- 157 dependencies
- gptools-util *
- numpy *
- torch *
- 153 dependencies
- numpy *
- 152 dependencies
- python 3.10.0 build