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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpmp-0.9.38.tar.gz (198.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpmp-0.9.38-py3-none-any.whl (213.1 kB view details)

Uploaded Python 3

File details

Details for the file gpmp-0.9.38.tar.gz.

File metadata

  • Download URL: gpmp-0.9.38.tar.gz
  • Upload date:
  • Size: 198.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gpmp-0.9.38.tar.gz
Algorithm Hash digest
SHA256 157ad240c02925e6dc1d4eaf21c66dfd5d9e241d6a52928abb55490bf7c7ab4d
MD5 3cfe7110e1e8b840cf9869d1a4677d6f
BLAKE2b-256 aabf4dd01b30006f01450cf2727dc90a55394ab0480fe026040d0f0e0e3405f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpmp-0.9.38.tar.gz:

Publisher: publish.yml on gpmp-dev/gpmp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gpmp-0.9.38-py3-none-any.whl.

File metadata

  • Download URL: gpmp-0.9.38-py3-none-any.whl
  • Upload date:
  • Size: 213.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gpmp-0.9.38-py3-none-any.whl
Algorithm Hash digest
SHA256 5637850346a34fc10a92b58e079c0600d1618b7fdc28ed0f78b84a594be6f737
MD5 cd9e8ea5eec022ac0d0834c08ecf68cb
BLAKE2b-256 626a58f4387e32e23c45fb774e7f0167ef628e27d853f7510e1d3df98a8e40a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpmp-0.9.38-py3-none-any.whl:

Publisher: publish.yml on gpmp-dev/gpmp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page