# 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)

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(sapply(x, gp\$deviance_theta_log),-10,10, n = 300) # deviance profile``