A mathematically grounded R toolkit for Gaussian processes, with an emphasis on transparent implementations, numerical stability, uncertainty quantification, and reproducible statistical workflows.
This project provides:
The package is developed from first principles. Established R packages may be used as optional references for validation, but the core implementation remains explicit and inspectable.
The package depends only on base R. Install a released version from the source tarball attached to its GitLab release:
install.packages("gaussianprocesses_1.0.0.tar.gz", repos = NULL, type = "source")
Or install the development version from GitLab:
# install.packages("remotes")
remotes::install_gitlab("DiogoRibeiro7/gaussian-processes-r", build_vignettes = TRUE)
From a local clone, run R CMD INSTALL . in the repository root.
library(gaussianprocesses)
set.seed(1)
x <- seq(-3, 3, length.out = 40)
y <- sin(x) + rnorm(length(x), sd = 0.1)
# Estimate kernel and noise hyperparameters by maximizing the marginal likelihood.
model <- optimize_gp(x, y, kernel = rbf_kernel(), noise_variance = 0.05)
# Latent-function and noisy-observation intervals are reported separately.
prediction <- predict_gp(model, c(-4, 0, 4))
prediction$latent_interval
prediction$prediction_interval
Inside the data (x = 0) the latent interval is narrow and the prediction interval adds the estimated observation noise; outside the data (x = -4, x = 4) both widen. The vignettes and the worked time-series example develop this further.
R/ R source code
man/ generated/reference documentation
tests/testthat/ unit tests
vignettes/ mathematical derivations and worked examples
inst/ examples, benchmark scripts, and technical notes
ci/ scripts run by the GitLab CI jobs
The documentation is organized as a sequence rather than a single large tutorial:
Research notes under inst/notes/ document the heteroscedastic approximation, FITC approximation, and benchmark protocol separately. The documentation site publishes them alongside the vignettes and worked examples: a time-series workflow and a spectral-mixture kernel on Mauna Loa CO2.
Install the development dependencies:
install.packages(c(
"testthat",
"roxygen2",
"knitr",
"rmarkdown"
))
Suggested packages, which the validation references compare against (their tests are skipped without them):
install.packages(c(
"DiceKriging",
"gplite",
"kernlab",
"nlme"
))
Run tests:
testthat::test_local()
Build the vignettes:
devtools::build_vignettes()
Run package checks:
devtools::check()
Build the documentation site locally (requires pkgdown); it is written to public/:
pkgdown::build_site()
GitLab CI runs R CMD check on merge requests, builds the documentation site with pkgdown, and publishes it to GitLab Pages from the default branch at https://gaussian-processes-r-12efed.gitlab.io/. The pipeline is designed to use little compute; see CONTRIBUTING.md for its design and for reproducing every job locally with Docker. Releases are published from a manual pipeline as described in RELEASING.md, and changes are recorded in NEWS.md.
Every exported function is marked stable or experimental on its help page, and the reference index is grouped by tier:
Stable interfaces change incompatibly only in a major release, and experimental ones may change in a minor release; ?gaussianprocesses sets out the policy. Changes are listed in NEWS.md, released versions are on the GitLab releases page, planned work is outlined in ROADMAP.md, and bugs and planned work are tracked in the GitLab issue tracker.
After installing the package, use:
citation("gaussianprocesses")
The package-native citation metadata is defined in inst/CITATION.
MIT License. See LICENSE.