Learn R Programming

GADGET (version 0.2.0)

gp_plot: Plot 1D Gaussian Process Model

Description

Plots univariate Gaussian process (GP) models with 95% credible bands. For extremely simply visualizations.

Usage

gp_plot(model, inputs, plot_data = FALSE)

Arguments

model

A GP model of class km (see km-class).

inputs

An vector of values at which to evaluate the GP model.

plot_data

Plot data used to fit the GP as well?

Value

A list of GP predictions and uncertainties used to generate the figure.

Examples

Run this code
# NOT RUN {
x  <- matrix(seq(-1,1,0.3),ncol=1)
y  <- x^2 
gp <- gp_fit(x,
             y,
             options=list(formula=~1, 
             kernel = "matern5_2", 
             optimizer = "gen", 
             nuggetUse = FALSE))
gp_plot(gp$km.model,seq(-1.5,1.5,0.1)) 
# }

Run the code above in your browser using DataLab