Abstract types and methods for Gaussian Processes.
Author JuliaGaussianProcesses
81 Stars
Updated Last
2 Years Ago
Started In
April 2020


Dev CI Codecov Code Style: Blue ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

AbstractGPs.jl is a package that defines a low-level API for working with Gaussian processes (GPs), and basic functionality for working with them in the simplest cases. As such it is aimed more at developers and researchers who are interested in using it as a building block than end-users of GPs.



AbstractGPs is an officially registered Julia package, so the following will install AbstractGPs using the Julia's package manager:

] add AbstractGPs


# Import packages.
using AbstractGPs, Plots

# Generate toy synthetic data.
X = rand(10)
Y = sin.(rand(10))

# Define GP prior with Matern32 kernel
f = GP(Matern32Kernel())

# Finite projection at the inputs `X`
fx = f(X, 0.001)

# Data's log-likelihood w.r.t prior GP `f`. 
logpdf(fx, Y)

# Exact posterior given `Y`.
p_fx = posterior(fx, Y)

# Data's log-likelihood w.r.t posterior GP `p_fx`. 
logpdf(p_fx(X), Y)

# Plot posterior.
scatter(X, Y; label="Data")
plot!(-0.5:0.001:1.5, p_fx; label="Posterior")

Related Julia packages


If you notice a problem or would like to contribute by adding more kernel functions or features please submit an issue.