precog.test
on simulated data.procog.sim
efficiently performs
precog.test
on a simulated data set.
The function is meant to be used internally by the
precog.test
function, but is
informative for better understanding the implementation
of the test.
precog.sim(
nsim = 1,
zones,
ty,
ex,
w,
pop,
max_pop,
logein,
logeout,
d,
cl = NULL,
tol_prob = 0.9,
ysim = NULL
)
A list with the vector of tolerance quantiles associated with each region and a vector with the maximum test statistic for each simulated data set.
The number of simulations from which to compute the p-value.
A list with of candidate zones that includes each regions and its adjacent neighbors.
The total number of cases in the study area.
The expected number of cases for each region. The default is calculated under the constant risk hypothesis.
A binary spatial adjacency matrix for the regions.
The population size associated with each region.
The maximum population size allowable for a cluster.
The log
of the expected number of
cases in each candidate zone.
The log
of the expected number of
cases outside of each candidate zone.
A precomputed distance matrix based on coords
A cluster object created by makeCluster
,
or an integer to indicate number of child-processes
(integer values are ignored on Windows) for parallel evaluations
(see Details on performance).
It can also be "future"
to use a future backend (see Details),
NULL
(default) refers to sequential evaluation.
A single numeric value between 0 and 1 that describes the quantile of the tolerance envelopes used to prefilter regions from the candidate zones.
A matrix of size nsim
\(\times n\),
where \(n\) is the number of regions in the study
area. This is a matrix of nsim
realizations of
the case counts for each region in the study area under
the null hypothesis. This argument is only not meant to
be used by the user.
Joshua French and Mohammad Meysami