Skip to content

Instantly share code, notes, and snippets.

@penkovsky
penkovsky / gp_example.py
Last active July 27, 2025 07:51
Gaussian Processes
"""
The kernel function computes covariance between points using the RBF formula.
The posterior predictive function calculates the mean and covariance of the GP posterior at new test points, using the kernel and training data.
The noise term sigma_y accounts for observation (aleatoric) noise in training data.
"""
import numpy as np
from numpy.linalg import inv