show_lambda {stelfi} | R Documentation |
Plot the estimated intensity from a fitted LGCP model
Description
Plots the estimated spatial intensity from
a fitted log-Gaussian Cox process model. If obj
is a
spatiotemporal model then timestamp
provides control
over which temporal index to plot the estimated spatial intensity.
Usage
show_lambda(
obj,
smesh,
sf,
tmesh,
covariates,
clip = FALSE,
dims = c(500, 500),
timestamp = 1
)
Arguments
obj |
A fitted LGCP model object for, for example, |
smesh |
A Delaunay triangulation of the spatial domain returned by |
sf |
An |
tmesh |
Optional, a temporal mesh returned by |
covariates |
Optional, a |
clip |
Logical, if |
dims |
A numeric vector of length 2 specifying
the spatial pixel resolution. Default |
timestamp |
The index of time stamp to plot. Default |
Value
A gg
class object, values returned by geom_tile
and geom_sf
.
See Also
fit_lgcp
, show_field
, and get_fields
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)))
show_lambda(fit, smesh = smesh, sf = domain)
}