### Name: conv.gp ### Title: Gaussian process modeling via Spatial Convolutions ### Aliases: conv.gp.1d conv.gp.2d conv.gp.multi.1d conv.gp.multi.2d ### conv.gp.mc.1d ### Keywords: models spatial ### ** Examples # ------------------------- # ONE dimensional synthetic data # -------------------------------- # get the synthetic data data <- data.1d() pdata <- seq(1,10,length=100) # ----------------------- # SINGLE Resolution model # ----------------------- # centers of the kernels (must be a matrix) w <- as.matrix(seq(1-2,10+2,length=7)) # prepare the 1-d ML convolution model data.conv.gp <- conv.gp.1d(data, pdata=pdata, w=w, sdkern=2) # plot the results plot(data.conv.gp, main="1-d Single Resolution") # ---------------------- # MULTI Resolution model # ---------------------- # kernels: number of support points at each scale m1 <- c(7,14,28) # kernel centers: list to hold the support locations w1 <- list() # (must be a list) for(i in 1:3) w1[[i]] <- seq(1-2,10+2,length=m1[i]) # kernels: width by scale sdkern <- c(2,1,.5) # estimate the 1-d ML convolution model data.conv.gp.multi <- conv.gp.multi.1d(data, pdata=seq(1,10,length=100), w=w1, sdkern=sdkern) # plot the results plot(data.conv.gp.multi, main="1-d Multiple Resolution") # ___________________________________________________________________________ # ___________________________________________________________________________ # # --------------------------- # TWO dimensional ozone data # --------------------------- # get the 2d ozone data ozone <- data.ozone() x <- ozone$s[,1]; y <- ozone$s[,2] pdata <- as.matrix(grid.2d(x,y,20,20)) # ----------------------- # SINGLE Resolution model # ----------------------- # locations of support points w (must be a matrix) wrows <- 6; wcols <- 8 w <- as.matrix(grid.2d(x,y,wrows,wcols)) # width of kernel sdkern <- 2*diag(1,2,2) # prepare the 2-d ML convolution model ozone.conv.gp <- conv.gp.2d(ozone, pdata=pdata, w=w, sdkern=sdkern) # plot the results plot(ozone.conv.gp, main="2-d Ozone") # ------------------------- # MULTIPLE Resolution model # ------------------------- # make support locations w (must be a list) w <- list( sparce=grid.2d(x,y,4,5), med=grid.2d(x,y,6,8), fine=grid.2d(x,y,9,12)) # width of the kernels sdkern <- list( sparce=2*diag(1,2,2), med=1*diag(1,2,2), fine=0.5*diag(1,2,2)) # estimate the 2-d ML convolution model ozone.conv.gp.multi <- conv.gp.multi.2d(ozone, pdata=pdata, w=w, sdkern=sdkern) # plot the results plot(ozone.conv.gp.multi, main="2-d Ozone Multi")