new.mapping: Map arbitrary locations to gridpoints of spectral GP object

Description Usage Arguments Value Author(s) References See Also Examples

Description

Finds the nearest gridpoint in a spectral GP representation for each supplied location based on Euclidean distance.

Usage

1
new.mapping(object, locations)

Arguments

object

A GP object, created by gp.

locations

A two-column matrix-like object (vector for one-dimensional data) of locations of interest, for which the first column is the first coordinate and the second column the second coordinate. Locations should lie in (0,1)^d, as the process representation is on a grid on (0,1)^d.

Value

A vector for which each element is the index of the gridpoint nearest the location. The indices run from 1 to (k/2)^d where k the number of gridpoints in each direction (assuming there are an equal number in each direction). The indices run along the first dimension from the lower right corner of the space, e.g., 13 14 15 16 9 10 11 12 5 6 7 8 1 2 3 4

Author(s)

Christopher Paciorek paciorek@alumni.cmu.edu

References

Type 'citation("spectralGP")' for references.

See Also

gp, predict.gp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(spectralGP)
loc1=runif(100)
loc2=cbind(runif(100),runif(100,0,1))
gp1=gp(128,matern.specdens,c(1,4))
gp2=gp(c(64,64),matern.specdens,c(1,4))
map1=new.mapping(gp1,loc1)
map2=new.mapping(gp2,loc2)
simulate(gp1)
simulate(gp2)
vals1=predict(gp1,mapping=map1)
vals2=predict(gp2,mapping=map2)
plot(gp1)
points(loc1,vals1)

spectralGP documentation built on May 2, 2019, 2:40 a.m.