get_fields {stelfi} | R Documentation |
Estimated random field(s)
Description
Extract the estimated mean, or standard deviation, of the
values of the Gaussian Markov random field for a fitted log-Gaussian
Cox process model at each node of smesh
.
Usage
get_fields(obj, smesh, tmesh, plot = FALSE, sd = FALSE)
Arguments
obj |
A fitted model object returned by |
smesh |
A Delaunay triangulation of the spatial domain returned by |
tmesh |
Optional, a temporal mesh returned by |
plot |
Logical, if |
sd |
Logical, if |
Value
A numeric
vector or a list
of returned values at each smesh
node.
See Also
Examples
if(requireNamespace("fmesher")) {
data(xyt, package = "stelfi")
domain <- sf::st_as_sf(xyt$window)
locs <- data.frame(x = xyt$x, y = xyt$y)
bnd <- fmesher::fm_as_segm(as.matrix(sf::st_coordinates(domain)[, 1:2]))
smesh <- fmesher::fm_mesh_2d(boundary = bnd, max.edge = 0.75, cutoff = 0.3)
fit <- fit_lgcp(locs = locs, sf = domain, smesh = smesh,
parameters = c(beta = 0, log_tau = log(1), log_kappa = log(1)))
get_fields(fit, smesh, plot = TRUE)
}
[Package stelfi version 1.0.1 Index]