target.and.grad.spatial: target.and.grad.spatial function

View source: R/spatialOnly.R

target.and.grad.spatialR Documentation

target.and.grad.spatial function

Description

A function to compute the target and gradient for 'spatial only' MALA

Usage

target.and.grad.spatial(
  Gamma,
  nis,
  cellarea,
  rootQeigs,
  invrootQeigs,
  mu,
  spatial,
  logspat,
  scaleconst,
  gradtrunc
)

Arguments

Gamma

current state of the chain, Gamma

nis

matrix of cell counts

cellarea

area of cells, a positive number

rootQeigs

square root of the eigenvectors of the precision matrix

invrootQeigs

inverse square root of the eigenvectors of the precision matrix

mu

parameter of the latent Gaussian field

spatial

spatial at risk function, lambda, interpolated onto correct grid

logspat

log of spatial at risk function, lambda*scaleconst, interpolated onto correct grid

scaleconst

the expected number of cases

gradtrunc

gradient truncation parameter

Value

the back-transformed Y, its exponential, the log-target and gradient for use in MALAlgcpSpatial


lgcp documentation built on Oct. 3, 2023, 5:08 p.m.