|
DI se.image
Creates an image object of standard errors for spatial prediction
using se.cov for the functions image or image.plot
USAGE:
se.image(nw.obj=new.network, nx=40, ny=40, ...)
REQUIRED ARGUMENTS:
nw.obj
network object as created by make.network.obj
nx
Number of x grid points
ny
Number of y grid points
OPTIONAL ARGUMENTS:
...
any other options for se.cov
VALUE:
Returns a list of x, y, z where x and y are grid
locations and z is a matrix of standard errors of
prediction at each grid location.
SEE ALSO:
se.cov
EXAMPLES:
# The function is currently defined as
function(nw.obj = new.network, nx = 40, ny = 40, ...)
{
locs <- nw.obj$locs
grid <- nw.obj$grid
cov <- nw.obj$cov.obj
#
# discern what the sd object should be.
#
if(is.null(cov$sd.obj))
sdobj <- 1
else if(is.numeric(cov$sd.obj))
sdobj <- cov$sd.obj
else sdobj <- get(cov$sd.obj)
if(is.null(grid)) {
x <- range(locs[, 1], na.rm = T)
y <- range(locs[, 2], na.rm = T)
x2 <- seq(x[1], x[2], length = nx)
y2 <- seq(y[1], y[2], length = ny)
grid <- list(x = x2, y = y2)
}
else {
if(is.matrix(grid))
grid <- list(x = grid[, 1], y = grid[, 2])
}
nx <- length(grid$x)
ny <- length(grid$y)
gridpts <- cbind(rep(grid$x, ny), rep(grid$y, rep(nx, ny)))
cov.fcn <- cov$cov.function
cov.args <- cov$args
out <- se.cov(locs, gridpts, cov.function = cov.fcn,
sd.obj = sdobj, cov.args)
z <- matrix(out, nrow = nx, ncol = ny)
list(x = grid$x, y = grid$y, z = z)
}
|
This is software for statistical research and should not be used for commercial purposes. The authors do not guarantee the correctness of any function or program in this package.