covarmat: gpe covariance matrix class

Description Usage Arguments Details Examples

Description

Generic functions associated with the covarmat class.

Usage

1
2
3
4
5
6
7
is.covarmat(x)

## S3 method for class 'covarmat'
image(x, axes = TRUE, legend = TRUE,
  col = palPuRd(100), ...)

palPuRd(n)

Arguments

x

an object of class covarmat, or an object to be tested as one.

axes

whether to add axes to the image plot of x.

legend

whether to add a legend to the image plot of x.

col

colour table used to plot the image

n

length of the continuous colour vector required

...

other arguments to be passed to lower-level functions, such as image.

Details

is.covarmat returns a logical indicating whether the object is a gpe covarmat object and image.covarmat provides a nice plot of the values in the covariance matrix; in the style of, and depending on image.plot. palPuRd uses the PuRd color palette from RColorBrewer to produce a non-divergent colour palette for visualising these matrices.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
# construct a kernel with one feature
k1 <- rbf('a')

# create a fake dataframe
df <- data.frame(a = sort(runif(50, -3, 3)))
 
# evaluate the kernel
K <- k1(df)


# is it a covarmat object? 
is.covarmat(K)
 

# visualise it 
image(K)

# create a new dataframe
df2 <- data.frame(a = sort(runif(100, -3, 3)))

# visualise the covariance matrix between the two dataframes
image(k1(df, df2))


# visualise the covariance matrix between these dataframes using
# the purple-red colour scheme (actually the default) but with fewer levels
image(k1(df, df2), col = palPuRd(10))

goldingn/gpe documentation built on May 17, 2019, 7:41 a.m.