Learn R Programming

BayesGPfit

An R package for Bayesian Gaussian process regression on regular grid points based on modified exponential sqaured kernel

  • Install and load the package
devtools::install_github("kangjian2016/BayesGPfit")
library(BayesGPfit)
  • Simulate curve on d-dimensional Euclidean space
library(lattice)
set.seed(1224)
dat = list()
dat$x = GP.generate.grids(d=2,num_grids = 100)
curve = GP.simulate.curve.fast(dat$x,a=0.01,b=0.5,poly_degree=20L)
GP.plot.curve(curve,main="Simulated Curve")
  • Bayesian model fitting based on two methods
dat$f = curve$f + rnorm(length(curve$f),sd=1)
fast_fit = GP.fast.Bayes.fit(dat$f,dat$x,a=0.01,b=0.5,poly_degree=20L,progress_bar = TRUE)
reg_fit = GP.Bayes.fit(dat$f,dat$x,a=0.01,b=0.5,poly_degree=20L,progress_bar = TRUE)
mse = c(reg = mean((reg_fit$f - curve$f)^2),
       fast = mean((fast_fit$f - curve$f)^2))
print(mse)

Copy Link

Version

Install

install.packages('BayesGPfit')

Monthly Downloads

209

Version

1.1.0

License

GPL-2

Maintainer

Jian Kang

Last Published

August 6th, 2022

Functions in BayesGPfit (1.1.0)

GP.plot.curve

Graphical representation of one, two, three-dimensional curves
GP.Bayes.fit

Regular Bayesian fitting of Gaussian process regression on regular grid points with the modified exponential sqaured kernel.
GP.plot.curves

Graphical representation of multiple curves in one and two-dimensional curves
GP.eigen.funcs.fast

Compute eigen functions
GP.eigen.value

Compute eigen values for the standard modified exponential squared correlation kernel.
GP.simulate.curve.fast

Simulate curve on d-dimensional Euclidean space based on Gaussian processes via modified exponential squared kernel.
GP.summary

Summary of posterior inference on the Bayesian Gaussian process regression model
GP.std.grids

Compute the standardized grids
GP.simulate.curves.fast

Simulate multiple curves on d-dimensional Euclidean space based on Gaussian processes via modified exponential squared kernel.
GP.create.cols

Create 256 colors gradually transitioning from Blue to Yellow to Red.
GP.generate.grids

Create spatial grids.
GP.eigen.funcs.fast.orth

Create orthogonal eigen functions
GP.fast.Bayes.fit

Fast Bayesian fitting of Gaussian process
GP.predict

Gaussian process predictions