predict.ramps: Prediction Method for georamps Model Fits

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

Description

Obtains prediction of main effects plus spatial variability from a georamps model fit.

Usage

1
2
   ## S3 method for class 'ramps'
predict(object, newdata, type = c("response", "spatial", "error", "random"), ...)

Arguments

object

object returned by georamps.

newdata

data frame containing covariate values for the main effect, unmeasured spatial coordinates, and (if applicable) spatial variance indices with which to predict.

type

character string specifying the type of spatial prediction to perform. The default value "response" provides spatial prediction which includes measurement error and non-spatial random effects; "spatial" excludes measurement error and non-spatial random effects from the prediction; "error" excludes non-spatial random effects; and "random" excludes measurement error.

...

some methods for this generic require additional arguments. None are used in this method.

Details

Prediction will be performed only at the coordinates in newdata that differ from those used in the initial georamps model fitting. In particular, overlapping coordinates will be excluded automatically in the prediction.

Value

'predict.ramps' object, inheriting from class 'matrix', of samples from the posterior predictive distribution. Labels for the samples at each new coordinate are supplied in the returned column names and MCMC iteration numbers in the row names. A matrix containing the new coordinates is supplied in the coords attribute of the object.

Author(s)

Brian Smith [email protected]

See Also

georamps plot.predict.ramps, window.predict.ramps,

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
## Prediction for georamps example results

## Not run: 
ct <- map("state", "connecticut", plot = FALSE)
lon <- seq(min(ct$x, na.rm = TRUE), max(ct$x, na.rm = TRUE), length = 20)
lat <- seq(min(ct$y, na.rm = TRUE), max(ct$y, na.rm = TRUE), length = 15)
grid <- expand.grid(lon, lat)

newsites <- data.frame(lon = grid[,1], lat = grid[,2],
                       measurement = 1)
NURE.pred <- predict(NURE.fit, newsites)

par(mfrow=c(2,1))
plot(NURE.pred, func = function(x) exp(mean(x)),
     database = "state", regions = "connecticut",
     resolution = c(200, 150), bw = 5,
     main = "Posterior Mean",
     legend.args = list(text = "ppm", side = 3, line = 1))
plot(NURE.pred, func = function(x) exp(sd(x)),
     database = "state", regions = "connecticut",
     resolution = c(200, 150), bw = 5,
     main = "Posterior Standard Deviation",
     legend.args = list(text = "ppm", side = 3, line = 1))

## End(Not run)

brian-j-smith/ramps documentation built on May 12, 2019, 5:44 a.m.