{'fraction_non_alphanumeric': 0.03512481644640235, 'fraction_numerical': 0.01908957415565345, 'mean_word_length': 4.287577639751553, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Detection of spatial pattern through independence of thinned processes

Let N, N' and N'' be point processes such that N' is obtained from N by homogeneous independent thinning and N''= N- N'. We give a new elementary proof that N' and N'' are independent if and only if N is a Poisson point process. We present some applications of this result to test if a homogeneous point process is a Poisson point process.


Introduction
In spatial statistics, it is common to consider simultaneously two spatial point patterns. A common applied setting is that where the researcher considers a pattern composed by the location of disease cases in a planar region, and another set of locations labeled as control individuals. Generally, the location of case and control individuals are their residences. The attention in the first situation is concentrated on the comparison of the marginal distributions of the two processes. Usually, the interest is to decide if the disease cases have some degree of spatial clustering with respect to the controls' pattern (Diggle, 1993;Kelsall and Diggle, 1995), specially around putative sources of increased risk (Diggle, 1990;Diggle and Rowlingson, 1994). If cases and controls exhibit the same spatial pattern, it makes sense to consider the null hypothesis that cases and controls are independent random samples from the same population at risk. This hypothesis implies that, conditionally on the observed locations of cases and controls, the events are labeled by the random outcome of fliping a coin of constant probability p, where p reflects the relative sizes of the cases and controls samples. It is usual to carry out the test conditioned on the observed number of cases of controls.
Another common situation in spatial statistics is when the interest concentrates on testing the independence of two point patterns and therefore attention is directed to the joint distribution of the processes. For example, the researcher could be studying two species of plants in the same region. From theoretical reasons or empirical knowledge, the species could be known to have quite different spatial configurations. Therefore, there would be no interest in testing if they arise by randomly labeling an original process. In this situation, it is more usual to test either they are independent point processes or, alternatively, if there is interaction between the two processes (Lotwick and Silverman, 1982;Wiegand et al., 2000). If the independence hypothesis holds, the expected number of individuals from one species in a disc centered at x = (x 1 , x 2 ) is independent of the presence in x of an individual from the other species.
Hence, the two hypothesis are considered in very different situations and they imply different consequences to the observed point patterns. However, these two hypothesis are not exclusive. Suppose that N is a Poisson process with intensity function λ(x) and that N = N 1 + N 2 where N 1 is a thinning of N obtained through the function p(x) = p, a constant independent of N. That is, N 1 is a random labeling of the N events. Then, it is well known that N 1 and N 2 are independent Poisson processes with intensities p λ(x) and (1 − p) λ(x), respectively (Cressie, 1991, page 690).
This result raises the question of the converse statement. Consider a point process N 1 arising as a random thinning of a point process N and let N 2 be the complementary point process such that N = N 1 + N 2 . If N 1 and N 2 are independent point processes, is it true that N is a Poisson point process ? The answer is positive and, since the Poisson process is the only point process with this property, this result gives a characterization of this process. This characterization result is not well known among spatial statisticians but it is not new. Srivastava (1971) proved this characterization for the particular case of stationary point processes evolving in time. He provided a short proof using two previous results: a Poisson distribution characterization by Moran (1952) and the characterization of a Poisson process by the Poisson distribution on compact sets by Rényi (1967). Fichtner (1975) extended Srivastava's (1971) characterization theorem for non-stationary point processes occuring in R d .
In this paper, we present a new proof of this characterization of Poisson processes, possibly non-stationary. We believe our proof is simpler than Fichtner's. It only uses Moran's theorem and well known point processes results. We also present a new and elementary proof of Moran's theorem without using characteristic functions (Lemma 1 below). Since this important characterization theorem is absent even from major point processes references, such as Daley and Vere-Jones (1988), we think it will be useful for spatial statisticians to present it here.
Based on this characterization theorem, we present a new approach to test for spatial pattern in an observed point process. Although the theorem characterizes also inhomogeneous Poisson processes, in this paper we concentrate on the detection of homogeneous Poisson process. We present two different tests, one based on the bivariate K function, and another based on empty space methods.
We give the definitions and set the notation in Section 2 where we also prove our main result concerning the characterization of the Poisson process through the independence of the processes formed by randomly labeling an initial process. In Section 3, we discuss some implications for statistical inference about homogeneous Poisson point processes and we finish with discussion and conclusions in Section 4.

The characterization of a Poisson point processes
Let N be a point process in R d with locally finite intensity ν: ν(K) < ∞ for each compact set K. Let N 1 and N 1 independent thinnings of N with acceptance value p and 1 − p respectively, with p ∈ [0, 1]. These processes are characterized by for any compact set K.

Theorem 1
The process N is a Poisson process if and only if N 1 and N 2 are independent.
The proof of the theorem is based on an elementary lemma about Poisson random variables. Let Z be a random variable with values in N and finite mean λ > 0. Let (U i : i ∈ N) be a sequence of independent random variables and independent of Z with Bernoulli distribution: where p ∈ [0, 1] is a parameter.
Let X and Y be thinnings of Z using U i : By Wald identity Write r k = P(Z = k), p k = P(X = k) and q k = P(Y = k). Then, by definition: and Lemma 1 The variable Z has Poisson distribution if and only if X and Y are independent.
Proof. The implication "Z Poisson implies X and Y independent" is in textbooks (Cressie, 1991, page 690, for instance). To show the reverse we first establish the strict positivity of all r n . Since X and Y are independent, then By (5) r n > 0 implies q k > 0 and p k > 0 for all k ≤ n. Since Z is not identically equal to zero, r n > 0 for some n ≥ 1 and hence p 0 , q 0 , p 1 , q 1 > 0. By (7) r 0 = p 0 q 0 > 0 and r 1 ≥ p 0 q 1 > 0. By induction, fixing n ≥ 1 and assuming r n > 0, we get r n+1 ≥ p n q 1 > 0. This shows that r n > 0 for all n ≥ 0.
Using the hypothesis of independence and taking alternatively i = x, j = y + 1 and then i = x + 1 and j = y in (6) we get Fixing x = 0, (10) and the fact that (q y ) is a probability imply that q y must satisfy: whose solution is: Hence Y has Poisson distribution with mean 1−p p p 1 p 0 . By (4) this mean also equals λ(1 − p). The same argument shows that X is Poisson with mean p 1−p q 1 q 0 = λp. Since X and Y are independent and Z = X + Y , Z must be Poisson.
Proof of Theorem 1. A point process is completely determined by the null probabilities (P(N(K) = 0 : K compact) (Theorem 7.3.II in page 216 of Daley and Vere-Jones, 1988). Denoting Z = N(K), X = N 1 (K) and Y = N 2 (K), we have that Z, X, Y satisfy the hypothesis of Lemma 1 with λ = ν(K). Hence N is Poisson with intensity ν.

New tests for homogeneous Poisson point processes
This characterization of the Poisson process suggests a different way to test if a point process is a stationary Poisson process. Assume N is a stationary process and, using a coin with success probability p, randomly label some of its events with mark 1, the remaining events being marked as 2. Only the stationary Poisson process has the two marked processes independent. Therefore, to test if the randomly labelled processes N 1 and N 2 are independent is equivalent to test the hypothesis that N is a stationary Poisson process.
The usual way to test if two stationary processes observed in a finite sampling window A with area |A| are independent is that proposed by Lotwick and Silverman (1982) based on conditional Monte Carlo tests (Ripley, 1977;Besag and Diggle, 1977) when A is a rectangle. Firstly, a suitable test statistic is chosen reflecting a particular alternative hypothesis of interest. If no specific alternatives are enviosioned, it is common to consider the bivariate Ripley's K function defined for d > 0 by where λ i is the first-order intensity of process N i and λ 12 (u) is the second-order intensity function of processes N 1 and N 2 . It is clear that K 12 (d) = K 21 (d). From the definitions, it follows that, under independence of N 1 and N 2 , we have K 12 (d) = πd 2 , whatever the marginal distributions of the two processes.
Let n 1 and n 2 be the number of events of N 1 and N 2 , respectively, observed in the rectangular sampling window A. Convert the rectangle to a torus by identifying the opposite edges of A. With this toroidal idea, no edge correction is necessary in the definition of the estimator of K 12 (d). Define I d (u) to be 1 if u ≤ d, and 0 otherwise. Let u ij be the distance from the ith N 1 -type event located at x 1i to the jth N 2 -type event.
The test statistic is based on the empirical functionK 12 (d), first proposed by Hanisch and Stoyan (1979), and defined byK The equality K 12 (d) = K 21 (d) is also valid for its empirical counterpartsK 12 (d) andK 21 (d) in this case of a toroidal region.
Keeping the N 1 process fixed, randomly shift the observed N 2 pattern in the torus and recal-culateK 12 (d). After many independent shifts, we have the empirical distribution ofK 12 (d) under independence of the processes conditioned on the observed marginal structure. Percentiles from this distribution for several different values of d can be used to construct acceptance envelopes for the hypothesis.
In the procedure we are proposing, the N 1 events are chosen out of those from the N process independently with probability p. To choose the value of p, consider the variance of (15). If N 1 and N 2 are independent Poisson processes then, conditionally on the values of n 1 and n 2 , where X and Y are independent random variables uniformly distributed over A identified with the torus (Silverman, 1978). If n 1 + n 2 = n is fixed, the optimal choice of n 1 and n 2 in the sense of minimizing the variance (17) is given by n 1 = n 2 = n/2. This suggests labeling the processes with p = 0.5.
Another possible test statistic is based on the avoidance set function P (N(A) = 0) or "empty space" techniques. There are examples of ergodic stationary dependent bivariate point processes that are judged independent by second-order methods, such as theK 12 (d) function, but with interactions detected by the avoidance function (Lotwick, 1984). This leads to the consideration of another test.
Let G 1 (d) be the probability that a disc of radius d contains no events of the N 1 process. Define G 2 (d) and G(d) similarly for the processes N 2 and N = N 1 + N 2 , respectively. If N 1 and N 2 are independent processes we have the following identity holding for all d: G(d) = G 1 (d) G 2 (d). As a consequence, we can use the following statistic to investigate the interaction between the processes N 1 and N 2 : As previously described, a conditional Monte Carlo test is used to assess the significance of empirical estimates of T (d). Lotwick and Silverman (1984) use the Green-Sibson Dirichlet tesselation algorithm for computing the function estimates while we prefer to estimate them from m randomly distributed sample points in A as decribed in Diggle (1983, page 20).
To choose the value of p, consider the variance of (17). Assuming that N is a Poisson process with intensity λ and n observed events and ignoring boundary effects, we use a standard delta method argument (Taylor expansion) to find It is clear that the variance is zero when p = 0 or p = 1. The reason is that, in this case, T (d) = 0 because either N = N 1 or N = N 2 . Since logĜ(d) is fixed whatever value of p is chosen, a better strategy is to select p to minimize the variance of the log(G 1 (d) G 2 (d)) estimator. Hence, which is minimized when p = 0.5, giving a minimum of 2/n(exp(πλd 2 ) − 1) > 0, if d > 0. As we found previously, this new result also suggests to label the processes using p = 0.5.

Example
We illustrate the techniques described with some real data: the locations of 62 redwood seedlings in a square of 23 meters, the locations of 42 biological cell centers in a unit square, and the locations of 65 Japanese black pine saplings in a square of side 5.7 meters. All the data are as reported by Diggle (1983) from the references therein.
Figure 1 around here Figure 1 shows the results of our two tests, based on the K 12 (d) function and in the empty space function. The first, second and third columns of plots refer to the redwood seedlings, cell centers, and pine saplings, respectively. The first row of plots shows the three point patterns. We used p = 0.5 to generate the thinned processes showed as circles and crosses in Figure 1. The second and third rows of plots refer to theK 12 (r) andT (d) tests, respectively.
Several tests have been used previously in these datasets and usually they accept the hypothesis of a homogeneous Poisson process for the pine saplings, and reject this hypothesis for the clustered redwood seedlings pattern and the regularly spaced cell centers. Our tests find these same results as can be seen by the behavior of the observedK 12 (r) andT (d) functions with respect to the 95% confidence envelopes. Both test functions lie outside the envelopes for the first and second datasets and inside the envelope for the third dataset.

Discussion and conclusions
A fundamental property characterizing the Poisson process is the independence of counts on disjoint areas. The characterization theorem presented in this paper suggests that independence of random partitions of events in the same area is also capable of characterizing the Poisson process. This is another justification for the usual labeling of a homogeneous Poisson process as complete spatial randomness (Diggle, 1983).
A result related to this theorem is Raikov's theorem (see Daley and Vere-Jones, 1988, page 31) which shows that if Z is a Poisson random variable expressible as a sum Z = X + Y of independent nondegenerate, nonnegative random variables then X and Y are Poisson random variables. The present characterization theorem drops the hypothesis that Z has a Poisson distribution and shows that this is a consequence of the independence of X and Y if they are obtained through the thinning of Z.
We used the characterization result to propose two tests, based on empty space and secondorder methods, for the hypothesis that a point process is a stationary Poisson process. It has not been considered in this paper their relative power in detecting departures from the null hypothesis of a Poisson process and the kind of departure detected by the two techniques. Likewise, we have not considered the relative merits of other techniques such as that based on the K function of the single type N process.
Although the characterization result is also valid for non-homogeneous Poisson point processes, it is not clear how this could be used to set up a hypothesis test in this case. The main problem in the non-homogeneous situation is the dependence of the thinned processes on the unknown first-order intensity function of N. Similar problems have made difficult the estimation of second moment functions for stationary Cox process (Chetwynd and Diggle, 1998).
The examples in Section 3 demonstrate that tests for interaction between two complementary processes obtained through the random thinning of a stationary point process N can be an alternative to test the hypothesis that N is a stationary Poisson process. Both tests, that based on the K 12 function and that based on empty space methods, lead to the same conclusions in the examples considered in this paper. These conclusions are the same reached using other tests previously proposed in the literature.  Figure 1: The first, second and third columns of plots refer to the redwood seedlings, cell centers, and pine saplings datasets, respectively. The first, second and third rows of plots refer to the point patterns, the bivariate K functions and the T (d) statistic, respectively. The dashed lines are approximate 95% confidence bands.