GPpred: Conversion from a long dataframe to a sptm object

Description Usage Arguments Examples

View source: R/GPpred.R

Description

This function allows you to calculate a Gaussian process kernel

Usage

1
GPpred(xd, x, y, param, kernel)

Arguments

xd

Location of the GP prediction

x

support points

y

support values

param

list of parameters, with the right naming convention

kernel

list of kernel used to generate the GPs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
x = list(matrix(runif(5,0,10), ncol = 1))
y = runif(5,-2,2)
xd = list(matrix(seq(min(x[[1]])-1,max(x[[1]])+1,length.out = 100), ncol = 1))
param = list(list(q1=1, q2=2))
kernel = list(k_longterm)
t = GPpred(xd, x,y, param, kernel)

xd = list(expand.grid(seq(0,10,length.out = 10),seq(0,10,length.out = 10)))
param = list(list(s1=2, s2=2))
x = list(matrix(runif(20,0,10),ncol = 2))
y = cos(rowSums(x[[1]]))
kernel = list(k_spatial_iso)
attr(kernel, "type") <- "spatial"
tt = GPpred(xd, x,y, param, kernel)
image(matrix(tt$mp, ncol = 10,byrow=TRUE))

ick003/GPspt documentation built on March 16, 2020, 3:34 a.m.