{"id":37085921,"url":"https://github.com/onnela-lab/gptools","last_synced_at":"2026-01-14T10:34:14.487Z","repository":{"id":83883625,"uuid":"584927390","full_name":"onnela-lab/gptools","owner":"onnela-lab","description":"Gaussian processes on graphs and lattices in Stan.","archived":false,"fork":false,"pushed_at":"2025-03-17T18:26:43.000Z","size":939,"stargazers_count":19,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-12T03:24:47.318Z","etag":null,"topics":["fft","gaussian-processes","graph","stan"],"latest_commit_sha":null,"homepage":"https://gptools-stan.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onnela-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-03T21:55:34.000Z","updated_at":"2025-12-09T06:15:13.000Z","dependencies_parsed_at":"2024-06-19T01:20:34.720Z","dependency_job_id":"df83ed48-c9ca-4617-8a50-294c52a263b0","html_url":"https://github.com/onnela-lab/gptools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/onnela-lab/gptools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnela-lab%2Fgptools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnela-lab%2Fgptools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnela-lab%2Fgptools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnela-lab%2Fgptools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onnela-lab","download_url":"https://codeload.github.com/onnela-lab/gptools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnela-lab%2Fgptools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:25:19.714Z","status":"ssl_error","status_checked_at":"2026-01-14T10:22:49.371Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fft","gaussian-processes","graph","stan"],"created_at":"2026-01-14T10:34:14.414Z","updated_at":"2026-01-14T10:34:14.470Z","avatar_url":"https://github.com/onnela-lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# *gptools*: Performant Gaussian Processes in [Stan](https://mc-stan.org) [![gptools: Python](https://github.com/onnela-lab/gptools/actions/workflows/python.yml/badge.svg)](https://github.com/onnela-lab/gptools/actions/workflows/python.yml) [![gptools: R](https://github.com/onnela-lab/gptools/actions/workflows/R.yml/badge.svg)](https://github.com/onnela-lab/gptools/actions/workflows/R.yml)\n\nGaussian 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.\n\n1. 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.\n2. An exact likelihood evaluation for data on regularly spaced lattices using fast Fourier transforms.\n\nThe 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*](https://doi.org/10.18637/jss.v112.i02) for details of the implementation. The comprehensive [documentation](http://gptools-stan.readthedocs.io/) includes many [examples](https://gptools-stan.readthedocs.io/docs/examples.html).\n\n## Getting Started\n\nYou can use the *gptools* package by including it the `functions` block of your Stan program, e.g.,\n\n```stan\nfunctions {\n    // Include utility functions, such as real fast Fourier transforms.\n    #include gptools/util.stan\n    // Include functions to evaluate GP likelihoods with Fourier methods.\n    #include gptools/fft.stan\n}\n```\n\nSee [here](stan/gptools) for the list of all include options. You can download the [Stan files](stan) and use them with your favorite interface or use the provided Python and R interfaces.\n\n### Python and *cmdstanpy*\n\n1. Install *cmdstanpy* and *cmdstan* if you haven't already (see [here](https://cmdstanpy.readthedocs.io/en/v1.2.5/installation.html) for details).\n2. Install *gptools* from [PyPI](https://pypi.org/project/gptools-stan/) by running `pip install gptools-stan` from the command line.\n3. Compile your first model.\n\n```python\nfrom cmdstanpy import CmdStanModel\nfrom gptools.stan import get_include\n\nmodel = CmdStanModel(\n  stan_file=\"path/to/your/model.stan\",\n  stanc_options={\"include-paths\": get_include()},\n)\n```\n\nFor an end-to-end example, see [this notebook](https://gptools-stan.readthedocs.io/docs/getting_started/getting_started.html).\n\n### R and *cmdstanr*\n\n1. Install *cmdstanr* and *cmdstan* if you haven't already (see [here](https://mc-stan.org/cmdstanr/#installation) for details).\n2. Install *gptools* from [CRAN](https://cran.r-project.org/package=gptoolsStan) by running `install.packages(\"gptoolsStan\")`.\n3. Compile your first model.\n\n```r\nlibrary(cmdstanr)\nlibrary(gptoolsStan)\n\nmodel \u003c- cmdstan_model(\n  stan_file=\"path/to/your/model.stan\",\n  include_paths=gptools_include_path(),\n)\n```\n\n\u003e [!NOTE]\n\u003e Unfortunately, [*Rstan*](https://cran.r-project.org/package=rstan) is not supported because it [does not provide an option to specify include paths](https://discourse.mc-stan.org/t/specifying-include-paths-in-rstan/32182/2).\n\nFor an end-to-end example, see [this vignette](https://cran.r-project.org/web/packages/gptoolsStan/vignettes/getting_started.html).\n\n## Contributing\n\nContributions to the package are always welcome! The repository structure is as follows:\n\n- [`stan/gptools`](stan/gptools) contains the core implementation of *gptools*.\n- [`python/stan`](python/stan) contains the Python wrapper for *gptools*.\n- [`R`](R) contains the R wrapper for *gptools*.\n- [`docs`](docs) contains the documentation hosted at https://gptools-stan.readthedocs.io.\n\n## Replicating the Results\n\nTo replicate the results presented in the accompanying publication [*Scalable Gaussian Process Inference with Stan*](https://doi.org/10.18637/jss.v112.i02), please see the [dedicated repository of replication materials](https://github.com/onnela-lab/gptools-reproduction-material).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonnela-lab%2Fgptools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonnela-lab%2Fgptools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonnela-lab%2Fgptools/lists"}