Skip to contents

Plot a covariance matrix

Usage

# S3 method for GPCov
plot(x, xa, type = c("prior", "matrix"), k = 5, ...)

Arguments

x

GPCov object containing the covariance matrix

xa

numeric vector used to generate x

type

character denoting whether to plot samples from the GP prior ("prior") assuming a mean vector of zero, or to draw a heatmap of the covariance matrix ("matrix"). Defaults to "prior"

k

integer denoting number of realisations to draw if type = "prior". Defaults to 5

...

arguments to be passed to methods

Value

ggplot2 object containing the plot

Author

Trent Henderson

Examples

x1 <- 1:100
covmat <- cov_exp_quad(x1, x1, 0.05, 1)
plot(covmat, x1, type = "prior", k = 5)