Learn R Programming

⚠️There's a newer version (0.2.15) of this package.Take me there.

GauPro

Overview

This package allows you to fit a Gaussian process to a dataset. A Gaussian process is a commonly used model in computer simulation. It assumes that the distribution of any set of points is multivariate normal with a constant mean and a correlation function.

The newest release allows you to use different kernel and trend functions, instead of just a squared exponential covariance.

You should probably use a different package for your modeling, such as laGP, mlegp, or GPfit if you are using R, or GPy if you are using Python.

Installation

You can install like any other package

install.packages('GauPro')

The most up-to-date version can be downloaded from my Github account.

# install.packages("devtools")
devtools::install_github("CollinErickson/GauPro")

Examples in 1-Dimension

Fit a sine curve with noise.

n <- 12
x <- matrix(seq(0,1,length.out = n), ncol=1)
y <- sin(2*pi*x) + rnorm(n,0,1e-1)
gp <- GauPro::GauPro(X=x, Z=y)
curve(gp$pred(x));points(x,y)
curve(gp$pred(x)+2*gp$pred(x,T)$se,col=2,add=T);curve(gp$pred(x)-2*gp$pred(x,T)$se,col=2,add=T)

This is the likelihood as a function of the log of theta. It is not convex and is difficult to optimize in general.

curve(sapply(x, gp$deviance_theta_log),-10,10, n = 300) # deviance profile

Fit a sawtooth function with no noise.

n <- 12
x <- matrix(seq(0,1,length.out = n), ncol=1)
y <- (2*x) %%1
gp <- GauPro::GauPro(X=x, Z=y)
curve(gp$pred(x));points(x,y)
curve(gp$pred(x)+2*gp$pred(x,T)$se,col=2,add=T);curve(gp$pred(x)-2*gp$pred(x,T)$se,col=2,add=T)

curve(sapply(x, gp$deviance_theta_log),-10,10, n = 300) # deviance profile

Copy Link

Version

Install

install.packages('GauPro')

Monthly Downloads

408

Version

0.2.2

License

GPL-3

Maintainer

Collin Erickson

Last Published

September 11th, 2017

Functions in GauPro (0.2.2)

GauPro_Gauss

Corr Gauss GP using inherited optim
GauPro_base

Class providing object with methods for fitting a GP model
corr_gauss_matrix_symC

Correlation Gaussian matrix in C (symmetric)
corr_gauss_matrix_sym_armaC

Correlation Gaussian matrix in C using Armadillo (symmetric)
Exponential

Exponential Kernel R6 class
GauPro

GauPro_selector
Gaussian_hessianC

Calculate Hessian for a GP with Gaussian correlation
Gaussian_hessianCC

Gaussian hessian in C
plot.GauPro

Plot for class GauPro
+.GauPro_kernel

Kernel sum
GauPro_kernel

Kernel R6 class
GauPro_kernel_beta

Beta Kernel R6 class
RatQuad

Rational Quadratic Kernel R6 class
Gaussian

Gaussian Kernel R6 class
Gaussian_devianceC

Calculate the Gaussian deviance in C
Gaussian_hessianR

Calculate Hessian for a GP with Gaussian correlation
Matern32

Matern 3/2 Kernel R6 class
trend_c

Trend R6 class
kernel_product

Gaussian Kernel R6 class
kernel_sum

Gaussian Kernel R6 class
corr_gauss_matrix

Gaussian correlation
trend_0

Trend R6 class
trend_LM

Trend R6 class
GauPro_kernel_model

GauPro model that uses kernels
GauPro_trend

Trend R6 class
Matern52

Matern 5/2 Kernel R6 class
Periodic

Periodic Kernel R6 class
predict.GauPro

Predict for class GauPro
*.GauPro_kernel

Kernel product