🔗 Composable Functionals
Chain evaluation, differentiation, and integration with intuitive ∘, +, ⊗ operators.
Linear transforms of GPs. Mix & match point observations, integrals and derivatives.
FunctionalGPs.jl provides a composable framework for applying linear functionals (evaluation, integration, differentiation) to Gaussian processes. Use it for GP regression with derivative or integral observations, Bayesian quadrature, physics-informed learning, and more.
using Pkg
Pkg.add("FunctionalGPs")using FunctionalGPs
using AbstractGPs
k = WendlandKernel(1, 2, 1.0)
f = GP(k)
# Condition on function values
f1 = condition_on_observation(f, [0.0, 1.0], [0.0, 0.84]; noise = 1.0e-8)
# Condition further on a derivative observation
∂x = PartialDerivative((1,))
ℒ = EvaluationFunctional([0.5]) ∘ ∂x
f2 = condition_on_observation(f1, ℒ, [1.0]; noise = 1.0e-8)For models that bundle several linear functionals of the same GP — function values, derivatives, integrals — and need their cross-covariances preserved (e.g. for hyperparameter inference in Turing), use FunctionalGaussian:
using FunctionalGPs, FunctionalGPs.Notation
fg = FunctionalGaussian(f;
y = δ(X_obs),
dy = δ(X_pred) ∘ ∂(1),
q = ∫([Interval(0.0, 1.0)]),
)
# Marginal log-likelihood for hyperparameter optimisation / sampling
ℓ = loglikelihood(fg, (; y = y_obs); noise = (; y = σ²))
# Posterior over the latent (unobserved) blocks
post = posterior(fg, (; y = y_obs); noise = (; y = σ²))
post.dy # LazyMvNormal over derivative locationsSee the Joint Functional Gaussians and Notation pages in the API Reference for details.
AbstractGPs.jl - Core GP abstractions
KernelFunctions.jl - Kernel definitions
GaussianMarkovRandomFields.jl - Sparse precision GPs