gp_init: Initialize a GP model

View source: R/gp.R

gp_initR Documentation

Initialize a GP model

Description

Initializes a GP model with given covariance function(s) and likelihood. The model can then be fitted using gp_fit. For hyperparameter optimization, see gp_optim

Usage

gp_init(
  cfs = cf_sexp(),
  lik = lik_gaussian(),
  method = method_full(),
  approx = approx_laplace()
)

Arguments

cfs

The covariance function(s). Either a single covariance function or a list of them. See cf.

lik

Likelihood (observation model). See lik.

method

Method for approximating the covariance function. See method.

approx

Approximate inference method for Gaussian approximation for the posterior of the latent values. See approx.

Value

A GP model object that can be passed to other functions, for example when optimizing the hyperparameters or making predictions.

References

Rasmussen, C. E. and Williams, C. K. I. (2006). Gaussian processes for machine learning. MIT Press.

Examples


# Full exact GP with Gaussian likelihood
gp <- gp_init(
  cfs = cf_sexp(),
  lik = lik_gaussian(),
  method = method_full()
)

# Binary classification model with EP approximation for the latent values
# and FITC sparse approximation to facilitate large datasets
gp <- gp_init(
  cfs = cf_sexp(),
  lik = lik_bernoulli(),
  approx = approx_ep(),
  method = method_fitc(num_inducing = 100)
)



gplite documentation built on Aug. 24, 2022, 9:07 a.m.