get_fields: Estimated random field(s)

View source: R/helpers.r

get_fieldsR 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 fit_lgcp.

smesh

A Delaunay triangulation of the spatial domain returned by fmesher::fm_mesh_2d().

tmesh

Optional, a temporal mesh returned by fmesher::fm_mesh_1d().

plot

Logical, if TRUE then the returned values are plotted. Default FALSE.

sd

Logical, if TRUE then standard errors returned. Default FALSE.

Value

A numeric vector or a list of returned values at each smesh node.

See Also

fit_lgcp and fit_mlgcp

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)
}


cmjt/stelfi documentation built on Oct. 25, 2023, 2:53 p.m.