precog.sim: Perform 'precog.test' on simulated data.

View source: R/precog.sim.R

precog.simR Documentation

Perform precog.test on simulated data.

Description

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.

Usage

precog.sim(
  nsim = 1,
  zones,
  ty,
  ex,
  w,
  pop,
  max_pop,
  logein,
  logeout,
  d,
  cl = NULL,
  tol_prob = 0.9,
  ysim = NULL
)

Arguments

nsim

The number of simulations from which to compute the p-value.

zones

A list with of candidate zones that includes each regions and its adjacent neighbors.

ty

The total number of cases in the study area.

ex

The expected number of cases for each region. The default is calculated under the constant risk hypothesis.

w

A binary spatial adjacency matrix for the regions.

pop

The population size associated with each region.

max_pop

The maximum population size allowable for a cluster.

logein

The log of the expected number of cases in each candidate zone.

logeout

The log of the expected number of cases outside of each candidate zone.

d

A precomputed distance matrix based on coords

cl

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.

tol_prob

A single numeric value between 0 and 1 that describes the quantile of the tolerance envelopes used to prefilter regions from the candidate zones.

ysim

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.

Value

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.

Author(s)

Joshua French and Mohammad Meysami


jfrench/smerc documentation built on Oct. 27, 2024, 5:13 p.m.