plot.gp: Plot a gaussian process

Description Usage Arguments Examples

View source: R/gpr_draw.R

Description

Plots a gaussian process. Several boolean parameters for modifying the plot. By default plots the data, posterior mean and 95% interval.

Usage

1
2
3
4
5
## S3 method for class 'gp'
plot(x, y = NULL, plotdata = TRUE, plotmean = TRUE,
  plotcov = TRUE, plotnoise = FALSE, samples = 0, sigma = 2,
  title = NULL, legend = FALSE, plotgradient = TRUE, plotls = FALSE,
  ...)

Arguments

x

the gp-object

y

placeholder variable

plotdata

plot the data (default)

plotmean

plot the GP mean (default)

plotcov

plot the GP covariances (default)

plotnoise

plot the observational noise (default)

samples

plot N samples from the GP

sigma

variance level to plot

title

plot title

legend

plot legend

plotgradient

use gradient graphics

plotls

plot lengthscale function

...

...

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# read toy data
data(toydata)

## Not run: can take several minutes
# perform one-sample regression
res = gpr2sample(toydata$ctrl$x, toydata$ctrl$y, seq(0,22,0.1))

# pre-computed model for toydata
data(toygps)
res = toygps$ctrlmodel

# basic plot with data, estimated mean and 95\%
plot(res)

# don't plot the data, plot some samples drawn from the learned gp
plot(res, plotdata=FALSE, samples=3)
## End(Not run)

nsgp documentation built on May 2, 2019, 9:19 a.m.