Skip to main content
GPmp logo

GPmp: Gaussian Process micro package

Python PyPI License Documentation Docs build

Website and documentation | Examples | API reference | PyPI | gpmp-contrib

GPmp provides building blocks for Gaussian-process (GP) interpolation and regression, also called kriging: mean functions, covariance functions, covariance-parameter selection, diagnostics, conditional simulation, and posterior sampling of covariance parameters.

The package is meant for GP-based algorithms and research software. Its API is small and explicit: users provide the mean and covariance functions, choose or define selection criteria, inspect diagnostics, and keep numerical backend objects visible through gpmp.num. The backend can be either NumPy or PyTorch.

When to use GPmp

Use gpmp when you need an explicit GP core for kriging, parameter selection, diagnostics, posterior sampling, conditional simulation, plotting, data utilities, or integration inside another algorithm.

Use gpmp-contrib when you want complete computer-experiment procedures, Bayesian optimization algorithms, excursion-set estimation, set inversion, and related sequential-design utilities.

GPmp currently focuses on exact GP computations. For very large data sets, large-scale approximate inference is future work.

Core features

  • Exact GP interpolation and regression: zero, parameterized, and linear-predictor means, including intrinsic and universal kriging settings.
  • Covariance functions: Matérn covariances with fixed half-integer regularity (maternp) or free regularity (matern), anisotropic scaling, distance matrices, and user-defined covariance functions.
  • Parameter selection: ML, REML, REMAP, user-defined criteria, bounds, and SciPy optimizer access.
  • Diagnostics: leave-one-out quantities, prediction-performance summaries, parameter reports, and selection-criterion cross sections.
  • Posterior covariance-parameter sampling: adaptive Metropolis-Hastings, NUTS, and tempered Sequential Monte Carlo.
  • Conditional simulation: conditional sample paths of fitted GPs.
  • Data utilities: random designs, splits, cross-validation helpers, and dataloaders for batched criterion evaluation.
  • Plotting helpers: plotting utilities for GP predictions, diagnostics, and examples.

Numerical backends

GPmp supports two numerical backends:

  • NumPy: default backend when PyTorch is unavailable, and often fast for many small-to-medium exact GP computations.
  • PyTorch: enables automatic differentiation and is useful when gradient information is needed, especially in higher-dimensional parameter settings.

Backend selection order at import time:

  1. If GPMP_BACKEND is set to torch or numpy, use it.
  2. Otherwise, use PyTorch if available, then NumPy.
export GPMP_BACKEND=torch
export GPMP_DTYPE=float64

Package split

gpmp
  core model
  kernels
  parameter objects
  parameter selection
  diagnostics
  posterior samplers
  plotting helpers

gpmp-contrib
  model containers
  computer experiments
  Bayesian optimization algorithms
  expected improvement
  excursion-set estimation
  set inversion
  reGP utilities

Install

pip install gpmp
python -c "print(__import__('gpmp').__version__)"

The verification command prints the installed GPmp version.

For local development:

git clone https://github.com/gpmp-dev/gpmp.git
cd gpmp
pip install -e .

Use pip install -e ".[dev]" for development tools, or pip install -e ".[docs]" for documentation tools.

Install the companion package when you need complete computer-experiment procedures:

pip install gpmp-contrib

GPmp depends on NumPy, SciPy, and Matplotlib. PyTorch is optional. Install it when automatic differentiation is needed. For GPU-enabled PyTorch, use the official PyTorch installation selector.

Documentation

The documentation is available at https://gpmp-dev.github.io/gpmp/. It includes examples for 1D and higher-dimensional interpolation, fixed half-integer Matérn covariances, selection of the Matérn regularity parameter, posterior parameter sampling, and dataloader-based selection.

To build it locally:

cd docs
make html

Public API

The intended public API is organized around:

  • gpmp.core
  • gpmp.kernel
  • gpmp.parameter
  • gpmp.modeldiagnosis
  • gpmp.mcmc
  • gpmp.plot
  • gpmp.num

How to cite

If you use GPmp in research, please cite:

@software{gpmp2026,
  author       = {Emmanuel Vazquez},
  title        = {GPmp: Gaussian Process micro package},
  year         = {2026},
  url          = {https://github.com/gpmp-dev/gpmp},
  note         = {Version 0.9.37},
}

Update the version number when citing another release.

Minimal example

The basic sequence is: define mean and covariance functions, build a model, select covariance parameters, predict, and diagnose the result.

GPmp keeps model construction explicit: users provide the mean function and the covariance function.

import gpmp as gp
import gpmp.num as gnp


def mean(x, param):
    return gnp.ones((x.shape[0], 1))


def covariance(x, y, covparam, pairwise=False):
    p = 3  # Matérn regularity p + 1/2
    return gp.kernel.maternp_covariance(x, y, p, covparam, pairwise)


xt = gp.misc.designs.regulargrid(1, 200, [[-1.0], [1.0]])
zt = gp.misc.testfunctions.twobumps(xt)
xi = gp.misc.designs.ldrandunif(1, 6, [[-1.0], [1.0]])
zi = gp.misc.testfunctions.twobumps(xi)

model = gp.Model(mean, covariance)
model, info = gp.kernel.select_parameters_sigma2_rho_with_reml(model, xi, zi, info=True)
zpm, zpv = model.predict(xi, zi, xt)

gp.modeldiagnosis.diag(
    model, "linear_mean_maternp_anisotropic", info, xi, zi
)

The final line prints parameter-selection diagnostics. The rendered documentation page shows the corresponding interpolation plot: 1D interpolation example.

Authors

See AUTHORS.md for details.

License

GPmp is free software released under the GNU General Public License v3.0. See LICENSE for details.

Release files for gpmp 0.9.38

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpmp 0.9.38
File Size Uploaded
gpmp-0.9.38.tar.gz 198.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpmp 0.9.38
File Interpreter ABI Platform
gpmp-0.9.38-py3-none-any.whl Python 3 none any Details

Total release size: 412.0 kB

Release files / gpmp-0.9.38.tar.gz

Download URL gpmp-0.9.38.tar.gz
Size 198.9 kB
Tags Source
SHA-256 checksum
How to use checksums
157ad240c02925e6dc1d4eaf21c66dfd5d9e241d6a52928abb55490bf7c7ab4d
BLAKE2b-256 checksum
How to use checksums
aabf4dd01b30006f01450cf2727dc90a55394ab0480fe026040d0f0e0e3405f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.

Transparency log

Release files / gpmp-0.9.38-py3-none-any.whl

Download URL gpmp-0.9.38-py3-none-any.whl
Size 213.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5637850346a34fc10a92b58e079c0600d1618b7fdc28ed0f78b84a594be6f737
BLAKE2b-256 checksum
How to use checksums
626a58f4387e32e23c45fb774e7f0167ef628e27d853f7510e1d3df98a8e40a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.38 This release

2 release files

0.9.37

2 release files

0.9.36

2 release files

0.9.17

2 release files

0.9.15

2 release files

0.9.14

1 release file

0.9.13

1 release file

0.9.12

1 release file

0.9.5

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page