Produces the process values of a spectral GP object on the defined grid or predicts process values for a new set of inputs (domain points).
A GP object, created by
An optional 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.
Optional output of
Does prediction for a spectral GP, either at the gridpoints or
for locations by associating locations with the nearest gridpoint,
depending on the arguments supplied. If
mapping are both NULL, then prediction is done on the grid. If only
newdata is supplied, the mapping is done using
new.mapping and then the prediction is done. If
is supplied (this should be done for computational efficiency if
prediction at the same locations will be done repeatedly) then the
mapping is used directly to calculate the predictions.
A vector of process values (matrix for two-dimensional processes in which prediction on the grid is requested).
Christopher Paciorek email@example.com
Type 'citation("spectralGP")' for references.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
library(spectralGP) gp1=gp(128,matern.specdens,c(1,4)) gp2=gp(c(64,64),matern.specdens,c(1,4)) simulate(gp1) simulate(gp2) gridvals=predict(gp1) gridvals2=predict(gp2) loc1=runif(100) loc2=cbind(runif(100),runif(100,0,1)) map1=new.mapping(gp1,loc1) map2=new.mapping(gp2,loc2) vals1=predict(gp1,mapping=map1) vals2=predict(gp2,mapping=map2) #equivalently: vals1=predict(gp1,loc1) vals2=predict(gp2,loc2) plot(gp1) points(loc1,vals1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.