diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 20d458c..7a35870 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,6 +18,8 @@ Added ^^^^^ * Official support for Python 3.9, 3.10, and 3.11. +* Documented computational complexity of adding new data to an online Gaussian + Process. Removed ^^^^^^^ diff --git a/goppy/core.py b/goppy/core.py index c3ebb6e..29ed587 100644 --- a/goppy/core.py +++ b/goppy/core.py @@ -120,9 +120,22 @@ def fit(self, x, y): self.trained = True def add(self, x, y): - """Adds additional training data to the Gaussian process and adjusts + r"""Adds additional training data to the Gaussian process and adjusts the fit. + The complexity of this method is in :math:`O(n \cdot \max(n^2, N^2))` + where + + * :math:`n` is the number of data points being added, + * and :math:`N` is the total number of data points added so far. + + This is better than re-initializing the Gaussian process, which would + have a complexity in :math:`O((n + N)^3)` because of the matrix + inversion. + + `See this master's thesis for more details. + `_ + Parameters ---------- x : (`N`, `D`) array-like