surveillance (version 1.12.1)

twinstim_siaf: Spatial Interaction Function Objects

Description

A spatial interaction function for use in twinstim can be constructed via the siaf function. It checks the supplied function elements, assigns defaults for missing arguments, and returns all checked arguments in a list. However, for standard applications it is much easier to use one of the pre-defined spatial interaction functions, e.g., siaf.gaussian.

Usage

siaf(f, F, Fcircle, effRange, deriv, Deriv, simulate, npars,
     validpars = NULL)

Arguments

f
the spatial interaction function. It must accept two arguments, the first one being a (2-column) coordinate matrix, the second one a parameter vector. For marked twinstim, it must accept the type of the event (integer code) as its
F
function computing the integral of $f(s)$ (passed as second argument) over a polygonal "owin" domain (first argument). The third and fourth argument are the parameter vector and the (single) type, respectively. There
Fcircle
optional function for fast calculation of the (two-dimensional) integral of $f(s)$ over a circle with radius r (first argument). Further arguments are as for f. It must not be vectorized (will always be called with si
effRange
optional function returning the effective range of $f(s)$ for the given set of parameters (the first and only argument) such that the circle with radius effRange contains the numerically essential proportion of th
deriv
optional derivative of $f(s)$ with respect to the parameters. It takes the same arguments as f but returns a matrix with as many rows as there were coordinates in the input and npars columns. This derivativ
Deriv
function computing the integral of deriv (passed as second argument) over a polygonal "owin" domain (first argument). The return value is thus a vector of length npars. The third argument is the parameter
simulate
optional function returning a sample drawn from the spatial kernel (only required for the simulation of twinstim models). Its first argument is the size of the sample to generate, next the parameter vector, an optional single eve
npars
the number of parameters of the spatial interaction function f (i.e. the length of its second argument).
validpars
optional function taking one argument, the parameter vector, indicating if it is valid. This approach to specify parameter constraints is rarely needed, because usual box-constrained parameters can be taken into account by using L-BFGS-B as th

Value

  • list of checked arguments.

See Also

siaf.gaussian for a pre-defined spatial interaction function, and tiaf for the temporal interaction function.