| 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 third argument
(either a single type for all locations or separate types for each
location). | 
| 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 may be additional arguments, which can then be specified in
thecontrol.siaf$Fargument list oftwinstim. If theFfunction is missing, a general default (polyCub) 
will be used, with extra argumentsmethod(default:"SV") 
and corresponding accuracy parameters. | 
| 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 forf. It
must not be vectorized (will always be called with single radius
and a single type). If this function is specified, integration of
thesiafover the spatial influence region of an event will
be faster if the region is actually circular. This is the case if
the event is located at least a distanceeps.sfrom the border
of the observation regionW, or if the distance to the border
is larger than the effective integration range (if specified, seeeffRangebelow). | 
| 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 effRangecontains the numerically essential proportion of the 
integral mass. For the Gaussian kernel the default isfunction (logsd) 6*exp(logsd). The return value must be a
vector of lengthnTypes(effective range for each type). This
function is only used ifFcircleis also specified. | 
| deriv | optional derivative of f(s) with respect to
the parameters. It takes the same arguments as fbut
returns a matrix with as many rows as there were coordinates in the
input andnparscolumns. This derivative is necessary for the
calculation of the score function intwinstim(), which is
advantageous for the numerical log-likelihood maximization. | 
| 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 lengthnpars.
The third argument is the parameter vector and the fourth argument
is a (single) type and must be namedtype.
There may be additional arguments, which can then be specified in
thecontrol.siaf$Derivargument list oftwinstim. If theDerivfunction is missing, a general default
(polyCub) will be used, with extra argumentsmethod(default:"SV") and corresponding accuracy parameters. | 
| simulate | optional function returning a sample drawn from the
spatial kernel (only required for the simulation of twinstimmodels).  Its first argument is the size of the sample to
generate, next the parameter vector, an optional single event type,
and an optional upper bound for the radius within which to simulate
points. The function must return a two-column matrix of the
sampled locations. 
Note that the simulation method actually samples only one location
at a time, thus it is sufficient to have a workingfunction(n=1, pars, type, ub). | 
| 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 the optimization method in
twinstim(with argumentslowerandupper), and
positivity constraints by using log-parametrizations.
This component is not necessary (and ignored) ifnpars == 0. |