Learn R Programming

nsgp (version 1.0.5)

plot.gp: Plot a gaussian process

Description

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

Usage

"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

Run this code
# 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)

Run the code above in your browser using DataLab