scieee AI-readable full text Open interactive document viewer

Testing similarity between first-order intensities of spatial point processes. A comparative study

Fuentes-Santos, Isabel; González Manteiga, Wenceslao; Mateu, Jorge

Abstract

Testing whether two spatial point processes have the same spatial distribution is an important task that can be addressed from different perspectives. A Kolmogorov-Smirnov test with asymptotic calibration and a Cramer von Mises type test with bootstrap calibration have recently been developed to compare the first-order intensity of two observed patterns. Motivated by common practice in epidemiological studies, we introduce a regression test based on the relative risk function with two alternative bootstrap calibrations. This paper compares the performance of these nonparametric tests through both an intensive simulation study, and the application to wildfire and crime data. The three tests provide good calibrations of the null hypothesis for simulated Poisson and non-Poisson spatial point processes, but the Cramer von Mises and regression tests outperform the costefficient Kolmogorov-Smirnov test in terms of power. In the real data analysis we have seen that the Kolmogorov-Smirnov test does not detect differences between spatial point patterns when dealing with sparse data. In view of these results, it would be preferable using the Cramer von Mises or regression tests despite their higher computational demand.

Full text

Full Terms & Conditions of access and use can be found at https://www.tandfonline.com/action/journalInformation?journalCode=lssp20 Communications in Statistics - Simulation and Computation ISSN: (Print) (Online) Journal homepage: www.tandfonline.com/journals/lssp20 Testing similarity between first-order intensities of spatial point processes. A comparative study I. Fuentes-Santos, W. González-Manteiga & J. Mateu To cite this article: I. Fuentes-Santos, W. González-Manteiga & J. Mateu (2023) Testing similarity between first-order intensities of spatial point processes. A comparative study, Communications in Statistics - Simulation and Computation, 52:5, 2210-2230, DOI: 10.1080/03610918.2021.1901118 To link to this article: https://doi.org/10.1080/03610918.2021.1901118 © 2021 The Author(s). Published with license by Taylor & Francis Group, LLC Published online: 19 Mar 2021. Submit your article to this journal Article views: 961 View related articles View Crossmark data Testing similarity between first-order intensities of spatial point processes. A comparative study I. Fuentes-Santos a , W. Gonz alez-Manteiga b , and J. Mateu c a Marine Research Institute, Spanish National Research Council, Vigo, Spain; b Department of Statistics, Mathematical Analysis and Optimization, Universidade de Santiago de Compostela, Santiago de Compotela, Spain; c Department of Mathematics, University Jaume I, Castell on, Spain ABSTRACT Testing whether two spatial point processes have the same spatial distribution is an important task that can be addressed from different perspectives. A Kolmogorov-Smirnov test with asymptotic calibration and a Cramer von Mises type test with bootstrap calibration have recently been developed to compare the first-order intensity of two observed patterns. Motivated by common practice in epidemiological studies, we introduce a regression test based on the relative risk function with two alternative bootstrap calibrations. This paper compares the performance of these nonparametric tests through both an intensive simulation study, and the application to wildfire and crime data. The three tests provide good calibrations of the null hypothesis for simulated Poisson and non-Poisson spatial point processes, but the Cramer von Mises and regression tests outperform the costefficient Kolmogorov-Smirnov test in terms of power. In the real data analysis we have seen that the Kolmogorov-Smirnov test does not detect differences between spatial point patterns when dealing with sparse data. In view of these results, it would be preferable using the Cramer von Mises or regression tests despite their higher computational demand. ARTICLE HISTORY Received 16 June 2020 Accepted 25 February 2021 KEYWORDS Bootstrap calibration; Conditional intensity; Criminology; Environmental risk; Inhomogeneous point process; Nonparametric inference 1. Introduction A common question in the analysis of multitype spatial point processes is whether two types of events have the same spatial structure. This question arises in a wide variety of areas, such as ecology, environmental risk assessment, epidemiology or criminology. We can, for instance, compare the spatial distribution of several species in a given region. In the analysis of environmental risks, we can be interested in assessing if the spatial distribution of arson and natural wildfires in a given region is the same (Fuentes-Santos, Gonz alez-Manteiga, and Mateu 2017), or whether the spatial pattern of earthquakes in a given region changes after the occurrence of extremely large events (Zhang and Zhuang 2017). Comparison between the spatial distribution of disease cases and the population at risk in order to identify areas with high disease risk has been a major issue for epidemiologists (Kelsall and Diggle 1995; Davies and Hazelton 2010). Differences between the observed patterns imply that they have been generated by different point processes and, consequently, different models should be used to characterize their distribution. In spite of its relevance when dealing with real data, this issue has received little attention, while the analysis of multitype point processes has mainly focused on testing for interactions between different types of events CONTACT I. Fuentes-Santos isafus[email protected]om Marine Research Institute, Spanish National Research Council, Vigo, Spain. ß2021 The Author(s). Published with license by Taylor & Francis Group, LLC This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. COMMUNICATIONS IN STATISTICS - SIMULATION AND COMPUTATION V R 2023, VOL. 52, NO. 5, 2210–2230 https://doi.org/10.1080/03610918.2021.1901118 through Monte Carlo tests based on second-order characteristics such as the K-cross and the mark correlation functions (Ripley 1981; Diggle 2013). These techniques have been widely used to search for relationships between different types of wildfires (Hering, Bell, and Genton 2009; Juan, Mateu, and Saez 2012; Fuentes-Santos, Marey-P erez, and Gonz alez-Manteiga 2013), or to analyze species distribution in plant ecology (Perry, Miller, and Enright 2006;Getzinetal.2008;Fibichetal.2016). A spatial point process is a stochastic process governing the location of a random number of events, X¼fx1,:::,xNg, irregularly placed in a planar region WR2:If each event has associated any measure or mark, we have a marked point process. A multitype point process is a marked point process with categorical marks that define different groups or types of events (Diggle 2013). Throughout this paper, point processes and patterns are denoted in bold capitals, and events are denoted in bold. The spatial distribution of events in Poisson point processes, i.e., those with independent events, is determined by the first-order intensity function (Illian et al. 2008; Diggle 2013), which measures the expected number of events per unit area, and is defined as follows kðxÞ¼ lim jdxj!0 ENðdxÞ½ jdxj  (1) where jdxjand N(dx) denote the area and number of events of Xin the infinitesimal disk dx centered at location x2W:Events in a spatial point process may not occur independently, and interactions between them are characterized through second-order properties such as the K- function K(r) (Ripley 1977) and the second-order intensity function, defined as k2ðx,yÞ¼ limjdxj,jdyj!0ENðdxÞNðdyÞ  =jdxjjdyj  :The conditional intensity function kcðxÞ¼kcxjy ðÞ ¼k2ðx,yÞ=kðyÞ(2) determines the intensity at a point xconditional on the information that there is an event in y (Diggle 2013), and characterizes uniquely the distribution of events in any spatial point process. In the particular case of a spatial Poisson point process kcðxjyÞ¼kðxÞ: Two spatial point patterns with the same spatial structure can be seen as the type iand type j patterns of a random labeled bivariate point process, or as independent realizations of a point process; in both cases their K-functions are equal, KiðrÞ¼KjðrÞ(Ripley 1977; Diggle 2013). This property motivated the use of Monte Carlo tests based on the K-function to check the similarity between two observed patterns (Hahn 2012). However, differences between the K-functions of two inhomogeneous spatial point patterns can reflect differences in the first-order intensities or in the dependence structure, and consequently these tests can lead to wrong conclusions. This knowledge gap has been recently addressed from different perspectives. Alba-Fern andez et al. (2016) and Andresen (2009) introduced area-based tests, which count the number of events within predefined spatial units (e.g., quadrants, space-filling curves) to measure local and global discrepancies between two observed point patterns. Zhang and Zhuang (2017) proposed a Kolmogorov-Smirnov test using the absolute difference between the point densities of the observed patterns over a p-system as a discrepancy measure. Fuentes-Santos, Gonz alez-Manteiga, and Mateu (2017) proposed a Cramer von Mises type statistic that measures the discrepancy between the densities of event locations of the observed patterns, taking into account that the intensities of two spatial Poisson point processes with the same spatial structure are proportional. A main issue in epidemiological studies is testing for spatial variation in the risk of a given disease, which involves the comparison between the spatial distribution of disease cases and the population at risk, referred as controls. In this line, Kelsall and Diggle (1995) proposed a kernel estimator of the relative risk function for independent and Poisson case and control patterns, defined as the ratio between the first-order intensities of disease cases and the control population (Bithell 1990). They also proposed a Monte Carlo algorithm to generate tolerance contour surfaces under the null hypothesis of equal spatial distribution of disease cases and controls, and a global Monte Carlo homogeneity test. Davies and Hazelton (2010) introduced an adaptive kernel COMMUNICATIONS IN STATISTICS - SIMULATION AND COMPUTATION V R 2211 estimator of the relative risk function, which is asymptotically normal allowing the generation of tolerance contours without the need of Monte Carlo simulations. Fuentes-Santos, Gonz alez- Manteiga, and Mateu (2018) developed a regression test based on the log-ratio between the intensity of a spatio-temporal point process and the intensity of its spatial component to test for separability. In the same line, we propose a regression test based on the relative risk function to test if two spatial point processes have the same spatial distribution. Motivated by the fact that there are not currently comparative analysis among these procedures, this work aims to compare the performance of the three tests outlined above in the analysis of Poisson and non-Poisson point processes. The plan of this work is the following. Sec. 2 introduces the Kolmogorov-Smirnov and Cramer von Mises tests, proposed in the literature, and we additionally consider a relative risk based procedure to compare the spatial distribution of inhomogeneous spatial point processes. The performance of these tests is tested through a simulation study in Sec. 3, and through the analysis of two important real data problems, such as wildfire patterns in Galicia (NW Spain) and gunfire violence in Rio de Janeiro (Brazil) in Sec. 4. The paper ends with a brief discussion in Sec. 5 and conclusions in Sec. 6. 2. Nonparametric tests for first-order comparison Let X¼fxigN i¼1be a realization of a bivariate inhomogeneous spatial point process observed in a bounded region WR2, and let X1¼fxigN1 i¼1¼fx1,igN1 i¼1,X2¼fxN1þjgN2 j¼1¼fx2,jgN2 j¼1, where N¼N1þN2, be the spatial patterns of type 1 and type 2 events in X. We denote by k1ðxÞand k2ðxÞthe first-order intensity functions of X1and X2, and by k01ðxÞ¼k1ðxÞ=m1,k02ðxÞ¼ k2ðxÞ=m2their densities of event locations (Cucala 2006), where mj¼ÐWkjðxÞ,j¼1, 2 is the mean intensity or expected number of events of each point process. If X1and X2have the same spatial distribution, their conditional intensity functions are proportional. Therefore, we can compare the distribution of two observed patterns testing the null hypothesis H0:kc,1ðxÞ¼xkc,2ðxÞ;8x2W(3) for some x>0:In case of Poisson point processes, whose conditional and first-order intensities are equal, the null hypothesis reduces to H0:k1ðxÞ¼xk2ðxÞ;8x2W(4) This hypothesis can be tested using nonparametric approaches, such as the Kolmogorov- Smirnov test by Zhang and Zhuang (2017), the Cramer von Mises test by Fuentes-Santos, Gonz alez-Manteiga, and Mateu (2017), or the regression test based on the relative risk function proposed in this work. The Kolmogorov-Smirnov test compares the spatial structure of two independent, but not necessarily, Poisson point processes, X1and X2:The test statistic maximizes the absolute difference between the empirical point densities over a p-system, avoiding the need of estimating the first-order intensity of each observed pattern. The Cramer von Mises and regression tests are based on kernel estimators of the density of event locations and of the relative risk function of inhomogeneous Poisson point processes. The Poisson assumption is required to guarantee the consistency of the kernel estimators, and to obtain the asymptotic null distribution of the test statistics. As argued by Zhang and Zhuang (2017), we can ignore the dependence between point patterns, but not the dependence structure of each spatial point process as both regular and clustered patterns are common in real data analysis. Thus, the Poisson assumption in the kernel-based tests may seem quite restrictive. It should be noted that these tests can also be applied to compare the spatial distribution of non-Poisson point processes, in which case these procedures measure the discrepancy between the conditional intensities, i.e., our null hypothesis is (3). Indeed, as we 2212 I. FUENTES-SANTOS ET AL. cannot distinguish between heterogeneity and interaction between events in an observed pattern without additional information (Diggle 2013), common practice is to assume that the spatial point process is Poisson, estimate its intensity function, and then estimate the second-order characteristics to test for independence between events. In this case, acceptation of the null hypothesis implies that the observed patterns have the same spatial distribution but not that they have been generated by the same point process. 2.1. Kolmogorov-Smirnov test Zhang and Zhuang (2017) developed a nonparametric procedure to test whether two independent but not necessarily Poisson point processes, X1and X2, have the same spatial distribution. The test is based on the fact that the null hypothesis, H0, implies that there exists an x>0 such that EN1ðAÞ½¼xEN2ðAÞ½for any Borel set A2BðWÞ:Considering this property, the authors define the discrepancy measure DxðAÞ¼N1ðAÞxN2ðAÞ(5) Then, under H0,EDx0ðAÞ ¼ 0 for any Borel set A2BðWÞand, consequently jDx0ðAÞj is close to 0. Zhang and Zhuang (2017) proved that a sufficient condition for H0to hold is that EDxðAÞ½¼0 for some x>0 and any A2PðWÞ, where Pis a psystem that generates BðWÞ: Replacing xby its empirical estimator, ^ x¼N1ðWÞ=N2ðWÞ, in expression (5) we obtain the following test statistic ^ D¼1 nsup A2P D^ xðAÞ ¼1 fffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi N1ðWÞN2ðWÞ N1ðWÞþN2ðWÞ ssup A2P  N1ðAÞ N1ðWÞN2ðAÞ N2ðWÞ (6) where fis a normalizing constant needed to guarantee the convergence of the null distribution of ^ Dto a Brownian bridge, and is estimated by ^ f2¼1 K1X K i¼1 N1Wi ðÞ ^ N1Wi ðÞ  2 ^ N1Wi ðÞ þN2Wi ðÞ ^ N2Wi ðÞ  2 ^ N2W2 ðÞ "# (7) where ^ N1ðWiÞ¼^ xðN1ðWiÞN2ðWiÞÞ=ð1þ^ xÞ, and ^ N2ðWiÞ¼^ N1ðWiÞ=ð1þ^ xÞfor a partition fWigK i¼1of the observation domain, W. The distribution of the Brownian bridge, WF,WðÞ, depends on Kand on F, the function used to define the psystem. Zhang and Zhuang (2017)introducedtwopsystems that may be useful in practice. For W¼ 0, w1 ½ 0, w2 ½ R2,wecanchooset¼FðxÞ¼ðx1=w1,x2=w2Þfor any x2W, which gives the psystem At¼0, x1=w1 ½ 0, x2=w2 ½ :In this case WF,WðtÞis a bidimensional standard pinned Brownian sheet, and the corresponding critical value at significance level a¼0:05 is D0,05 ¼1:6522: In the second case Wis an arbitrary region, and we choose t¼FðxÞsuch that At¼0, 1 ½ and F1ðAtÞ¼fx02W;Fðx0ÞFðxÞg:Here ^ Dconverges to the standard Brownian motion whose distribution can be estimated through a Taylor expansion. It should be noted that we reject H0if Dis larger than the critical value, but this procedure does not allow us to accept H0otherwise. 2.2. Cramer von Mises test Let Xbe a realization of a bivariate inhomogeneous spatial Poisson point process observed in a bounded region WR2, and X1,X2are the spatial point patterns of type 1 and type 2 events in X. Conditional to the number of events, N j ¼n j , the observed patterns can be seen as random COMMUNICATIONS IN STATISTICS - SIMULATION AND COMPUTATION V R 2213 samples of the bivariate random distributions with densities k0jðxÞ,j¼1, 2:Considering this property, Fuentes-Santos, Gonz alez-Manteiga, and Mateu (2017) extended the nonparametric test developed by Duong, Goud, and Schauer (2012) for multivariate data to the spatial point process framework, and proposed a test statistic based on an L 2 -distance measure ^ T¼ðW ^ k01ðxÞ^ k02ðxÞ  2 dx ¼^ w1þ^ w2^ w12 þ^ w21  (8) where ^ wij and ^ wiare estimators of wij ¼ÐWk0iðxÞk0jðxÞdx for i,j¼1, 2 and wi¼ÐWk0iðxÞ2dx, obtained by kernel smoothing with plug-in bandwidth (Chac on and Duong 2010). The null distribution of ^ Tis asymptotically normal under regularity conditions analogous to those assumed in the classical multivariate distribution framework. However, in view of the slow convergence rate to the normal distribution, Fuentes-Santos, Gonz alez-Manteiga, and Mateu (2017) developed a smooth bootstrap algorithm to calibrate the test. Finally, notice that this test can also be used to compare the spatial distribution of non- Poisson point processes, in which case we test the null hypothesis (3), i.e., we compare the conditional instead of the first-order intensity functions. 2.3. Nonparametric test based on the relative risk function Let Xbe a realization of a bivariate inhomogeneous spatial Poisson point process in a bounded region WR2, and X1,X2, the spatial patterns of type 1 and type 2 events in X. The null hypothesis (4) can be rewriten as H0:k1ðxÞ=k2ðxÞ¼x;8x2Wfor some x>0, i.e., the relative risk function (Bithell 1990), rðxÞ¼k1ðxÞ=k2ðxÞ, is spatially invariant. Considering this property, we shall follow the same strategy as in Fuentes-Santos, Gonz alez-Manteiga, and Mateu (2018) and use a no-effect test that checks the dependence of the log-relative risk function qðxÞ¼ log rðxÞon event locations to compare the spatial distribution of X1and X2: To implement this test, we first need to estimate the log-relative risk function. In this case, we estimate qðÞ as the log-ratio of the kernel densities of event locations, as proposed by Kelsall and Diggle (1995) ^ qðxÞ¼log ^ k01,h1ðxÞ ^ k02,h2ðxÞ ! (9) where the kernel estimators of the marginal densities of event locations, ^ k0j,hjðxÞ;j¼1, 2, are given by ^ k0j,hjðxÞ¼ phjðxÞN  1h2X N i¼1 kh 2xxi ðÞ  IN6¼ 0ðÞ (10) where phjðxÞis the edge-correction term, and hj,j¼1, 2 the bandwidth parameter for the case and control kernel estimators. We can use different bandwidths in the numerator and denominator of ^ qðÞ, but Kelsall and Diggle (1995) showed that the asymptotically optimal estimator with respect to the mean square error is achieved using the same bandwidth for cases and controls. This choice leads to a bias cancelation in regions where k01 ¼k02 and simplifies data-driven bandwidth selection. Kelsall and Diggle (1995) also proposed a least-squares cross-validation bandwidth selector that shall be used in this work. Once estimated the log-relative risk function, we have a regression problem where the log-relative risk function, Y¼fyi¼^ qðxiÞ,i¼1, :::,ng, is a response variable that may depend on the spatial covariate X¼fxi¼ðxi1,xi2Þ,i¼1, :::,ngcomprising the event locations, and we test for the effect of Xon Ydiscriminating between two competing models (Bowman and Azzalini 1997) 2214 I. FUENTES-SANTOS ET AL. H0:Ey ijxi  ¼l H1:Ey ijxi  ¼mðxiÞ The null model lcan be estimated by the empirical mean ^ y¼Pn i¼1yi:The alternative model, m(x) is an unknown smooth function, which can be estimated by kernel regression (Nadaraya 1964; Watson 1964) ^ mðxÞ¼^ mðx1,x2Þ¼Pn i¼1wg1ðxi1x1Þwg2ðxi2x2Þyi Pn i¼1wg1ðxi1x1Þwg2ðxi2x2Þ(11) where the kernel, wðÞ, is a univariate symmetric density function, and g¼ðg1,g2Þis the vector of smoothing parameters. Three alternative procedures have been commonly used to select this parameter: (i) bandwidth selector associated to the approximate degrees of freedom, df, of the regression errors, (ii) least-squares cross-validation, and (iii) an AICC-based method. Discrepancy between the null and alternative models is measured through the following generalized test statistic F¼RSS0RSS1 ðÞ=df1df0 ðÞ RSS1=df1 (12) where RSS 0 and RSS 1 are the residual sum of squares for nonparametric estimators of the null and alternative models, and df 0 ,df 1 denote their respective degrees of freedom. In the linear model framework, the residual sums of squares and the test statistic follow, respectively, a v2and an Fdistribution. However, these properties are not fulfilled in the context of nonparametric regression. Bowman and Azzalini (1997) proposed two procedures to estimate the distribution of Funder the null hypothesis: (i) if the errors in the regression model have normal distribution, the null distribution of Fis approximated by a shifted and scaled v2;(ii) a computationally intensive procedure based on permutation tests is applied otherwise. The permutation test relies on the fact that under H0the pairing of any particular xand yis completely random. This calibration procedure has shown a good performance for the separablity test developed by Fuentes-Santos, Gonz alez-Manteiga, and Mateu (2018). Here we propose a modified version of this permutation test taking into account that our null hypothesis implies that the data can be seen as a single realization of the unmarked point process X, followed by independent random allocation of events to X1and X2with probability proportional to their respective mean intensity. Therefore, following the Monte Carlo procedure introduced by Kelsall and Diggle (1995), we propose a calibration that estimates the null distribution of ^ Fusing a random labeling algorithm that computes the test statistic for Brealizations of the null hypothesis generated by random reallocation of case/control marks. The empirical p-value of the test is the proportion of simulated F-statistics larger than that obtained from the observed data. The test can also be calibrated through a smooth bootstrap algorithm analogous to that used for the Cramer von Misss test. The bootstrap calibration is implemented as follows: (1) Estimate the log-relative risk function and compute the test statistic ^ F1for the observed patterns, X1and X2: (2) Compute the kernel intensity estimator, ^ kHðxÞ, of the unmarked point process comprising the location of type 1 and type 2 events, X0¼X1[X2: (3) For b¼2, :::,B: (1) Generate a bivariate spatial point process Xb¼fX1,b,X2,bgwhere for j¼1, 2, Xj,b are realizations of spatial Poisson point processes with first-order intensity proportional to that of the unmarked pattern and the same number of events as Xj: (2) Obtain the bootstrap log-relative risk functions ^ q band compute the corresponding test statistic ^ Fb: COMMUNICATIONS IN STATISTICS - SIMULATION AND COMPUTATION V R 2215 (4) The probability of rejecting the null hypothesis is the proportion of bootstrap statistics f^ FbgB b¼2larger than ^ F1: 3. Simulation study We have conducted a simulation study to analyze the performance of the relative risk based test introduced in Sec. 2.3. We first compare the calibration of the null distribution provided by the random labeling and smooth bootstrap algorithms, and analyze the power of the test. In a second stage we compare the regression test with the Kolmogorov-Smirnov and Cramer von Mises tests. These analysis have been conducted through application of the three nonparametric tests to Poisson, clustered and regular inhomogeneous bivariate spatial point processes. The spatial point processes simulated in this work are based on the simulation studies conducted by Zhang and Zhuang (2017) and Fuentes-Santos, Gonz alez-Manteiga, and Mateu (2017) to check the performance of their respective tests. Following Zhang and Zhuang (2017) we simulate Poisson, clustered and regular inhomogeneous spatial point processes on the square region W¼10,10 ½ 2:We generate inhomogeneous Poisson point processes with first-order intensity kajðxÞ¼kajðx1,x2Þ¼jjfajðx1Þfajðx2Þ, where fajðtÞ¼ C2a ðÞ C2ðaÞ2v ðÞ 2a1v2t2 ðÞ a1 ðÞ ;jtj<v(13) is the density of the bðaj,ajÞdistribution on v,v ½ , in this case v¼10. j j determines the expected number of events of the simulated patterns, in this case jj¼500wj,j¼1, 2, with w¼ ð1=2, 1=2Þ,w¼ð2=3, 1=3Þand w¼ð9=10, 1=10Þfor balanced and unbalanced designs. Balanced and unbalanced designs were considered to check whether the asymmetry in the size of the point patterns affects the performance of the tests. We have used a1¼2, and a2¼2, 3, 4 to generate the null hypothesis and two alternatives with different degrees of deviation from H0: Clustered patterns were simulated using a Thomas cluster point process model. We generate an inhomogeneous spatial point pattern of parent points with intensity function kajðxÞ=c, and PoissonðcÞoffsprings randomly placed around each parent event according to a symmetric Gaussian distribution with standard deviation r, in this case c¼5 and r¼0:5: Regular patterns were generated through a simple inhibition point process model. We first generate inhomogeneous Poisson point processes with first-order intensities proportional to kajðxÞ,j¼1, 2 and we then apply an inhibition radius of r¼0.2. Figure 1 shows the first-order intensity of the inhomogeneous Poisson point processes and the conditional intensities of the Thomas cluster and simple inhibition point processes for the null and alternative hypothesis. Following Fuentes-Santos, Gonz alez-Manteiga, and Mateu (2017) we generated inhomogeneous spatial Poisson point processes with first-order intensity kjðxÞ¼ajexp ð3x2Þ,j¼1, 2, for any x¼ ðx1,x2Þ2R2on the unit square. Different values of aj,j¼1,2wereconsideredtoobtaindifferent proportions of type 1 and type 2 events. The alternative hypothesis was generated adding a random number of events uniformly distributed on a subregion of the type 2 point pattern, as follows k1ðxÞ¼a1exp ð3x2Þ k2ðxÞ¼a2exp ð3x2Þþ100 a2 1 4  2 Ix1,x2 ðÞ 20:5,0:75 ½ 2 ! 8 > > < > > : (14) As above a 1 and a 2 were fixed to generate realizations of a bivariate point process with m1¼ m2¼250 in the balanced design, m1¼1000=3, m2¼500=3 and m1¼450, m2¼50 in the unbalanced designs. ð1=4Þ2in expression (14) is the area of the subregion of the unit square where 100events are added to generate realizations of the alternative hypothesis in the balanced design, 2216 I. FUENTES-SANTOS ET AL. and ¼0:4, ¼0:8 determines the number of events added to the type 2 point process, that is the degree of departure from the null hypothesis. Clustered patterns were generated as Thomas cluster point processes with c¼5, r¼0:02 and intensity of the parent points equal to kjðxÞ=c,j¼1, 2:Regular patterns were generated through simple inhibition point processes with an inhibition radius of r¼0.02. Figure 2 shows the first-order intensity of the inhomogeneous Poisson point processes and the conditional intensities of the Thomas cluster and simple inhibition point processes for the null and alternative hypotheses. For the different scenarios defined throughout this section, we computed the test statistics and the corresponding empirical p-values for 1000 realizations of each bivariate spatial point process. The probability of rejecting the null hypothesis at a given significance level, a, was obtained as the proportion of p-values smaller than a. This simulation study was conducted with the help of the spatstat (Baddeley and Turner 2005), ks (Duong 2013), sparr (Davies, Marshall, and Hazelton 2018)andsm (Bowman and Azzalini 2014) packages of the R statistical software (R Core Team 2019). 3.1. Comparison of calibration methods in the regression test We have applied the regression test (Sec. 2.3) with B¼200 realizations of the random labeling and smooth bootstrap calibration procedures to compare the spatial distribution of the different Figure 1. MODEL I: First-order intensities (Poisson) and conditional intensities (clustered and regular) of the type 1 and type 2 events in the bivariate point process based on the intensity function (13). Null hypothesis in the first row. COMMUNICATIONS IN STATISTICS - SIMULATION AND COMPUTATION V R 2217 of arson and natural fires for the 5 years under study, whereas the Kolmogorov-Smirnov test did not reject the null hypothesis. The good performance of the kernel-based tests when dealing with unbalanced designs in the simulation study and visual inspection of the kernel intensity estimators in Figure 4 suggest that we should rely on the results provided by the kernel-based tests. In Table 8 we see that the kernel-based tests rejected the null hypothesis for the comparison of arson fires between years, whereas the Kolmogorov-Smirnov test accepted the null in some cases, (2004 2007, 2006 2007 and 2006 2008). As well as for comparison between arson and natural fires, the intensity estimators in Figure 4 (top) suggest that we should rely on the kernelbased tests. Notice that the Kolmogorov-Smirnov test also reported some difficulties to detect the alternative hypothesis in the simulation study (Sec. 3). Finally, although the intensity estimators in Figure 4 (bottom) suggest that the spatial distribution of natural fires varied over years, the Kolmogorov-Smirnov test did not reject the null hypothesis, whereas the Cramer von Mises and regression tests provided contradictory results (e.g., 2004 2005) or did not found clear evidences to accept or reject H0(pvalue 2ð0:01, 0:1Þ). These results illustrate the low power and limited performance of this type of procedures when dealing with small-size point patterns. Figure 3. Galicia (NW Spain). 2224 I. FUENTES-SANTOS ET AL. 4.2. Comparison of gunfire patterns in Rio De Janeiro metropolitan area As police departments have created centralized databases of crime reports comprising, among other information, the location and time of occurrence of each event, point process modeling has been widely used to predict the risk of future crime. In the particular case of the Rio de Janeiro Figure 4. Kernel intensity estimators of arson (top) and natural (bottom) wildfires registered in Galicia in the period 2004-2008 (Figures have different scale). Table 7. Number of arson and natural fires and p-values of the Kolmogorov-Smirnov test with the second psystesms introduced in Sec. 2.1 and K¼3. 2004 2005 2006 2007 2008 Arson 8754 9538 5020 2111 1782 Natural 101 72 119 48 44 KS 2 >0.05 >0.05 >0.05 >0.05 >0.05 CvM <0.005 <0.005 <0.005 <0.005 <0.005 F-test RL <0.005 <0.005 <0.005 <0.005 <0.005 F-test SB <0.005 <0.005 <0.005 <0.005 <0.005 Crameer von Mises test with smooth bootstrap calibration (B¼200), and regression test with random labeling (RL) and smooth bootstrap (SB) calibrations (B¼200). Table 8. Nonparametric comparison of the spatial distribution of arson and natural fires across years. See details in the caption of Table 7. Arson Natural 2004 2005 2006 2007 2004 2005 2006 2007 2005 KS 1 <0.05 >0.05 CvM <0.005 <0.005 F-test RL <0.005 0.29 F-test SB <0.005 0.355 2006 KS 1 <0.05 <0.05 >0.05 >0.05 CvM <0.005 <0.005 <0.005 <0.005 F-test RL <0.005 <0.005 0.06 0.01 F-test SB <0.005 <0.005 0.04 0.015 2007 KS 1 >0.05 <0.05 >0.05 >0.05 >0.05 >0.05 CvM <0.005 <0.005 <0.005 <0.005 0.015 0.015 F-test RL <0.005 <0.005 <0.005 0.015 0.2 0.04 F-test SB <0.005 <0.005 <0.005 <0.005 0.28 0.055 2008 KS 1 <0.05 <0.05 >0.05 <0.05 >0.05 >0.05 >0.05 >0.05 CvM <0.005 <0.005 <0.005 <0.005 0.195 0.015 0.065 0.08 F-test RL <0.005 <0.005 <0.005 <0.005 0.08 0.34 0.005 0.385 F-test SB <0.005 <0.005 <0.005 <0.005 0.06 0.34 0.02 0.225 COMMUNICATIONS IN STATISTICS - SIMULATION AND COMPUTATION V R 2225 metropolitan area (Brazil, Figure 5), which has been suffering a continuous increase of gun violence over the last decades (Arias and Barnes 2017), the ISP-RJ centralizes reports from the 190 crime report hotline, military, and civil police in a global crime database. In parallel with the official sources, the collaborative mobile app Fogo Cruzado, which collects real time gunfire reports and delivers instant alerts to help citizens avoid stray bullets, has generated a valuable data set of gunfire violence in Rio de Janeiro. Here we have applied the three nonparametric tests to compare the spatial distribution of the 1141 gunfire events with mortal victims and the 4804 events without victims collected by Fogo Cruzado in the Rio de Janeiro metropolitan area during 2017 (Fuentes-Santos, Gonz alez- Manteiga, and Zubelli 2020). We used the second psystem introduced in Sec. 2.1 for the Kolmogover-Smirnov test and K¼4 partitions in the normalizing constant to deal with data sparseness. As above, the bootstrap calibrations in the kernel-based tests were ran with B¼200 realizations of the null hypothesis. For the regression test we report the results obtained with the cross-validation bandwidth in ^ mas the three procedures provided similar results. The Kolmogorov-Smirnov test did not detect differences between gunfire patterns (p-value > 0.05), whereas the two kernel-based tests rejected the null hypothesis (p-value <0:005). Visual Figure 5. Rio de Janeiro metropolitan area (Brazil). Figure 6. Kernel intensity function for the spatial patterns of gunfire events with and without mortal victims (Figures have different scale). 2226 I. FUENTES-SANTOS ET AL. inspection of the kernel intensity estimators (Figure 6) suggests that we should trust on the Cramer von Mises and regression tests. This example confirms the limited capacity of the Kolmogorov-Smirnov test when dealing with highly inhomogeneous and sparse data. The small number of partitions, K, required to deal with data sparseness has an oversmoothing effect on the test statistic and reduces the power of the test. 5. Discussion The natural way to compare the spatial distribution of two spatial point pattterns is testing whether these patterns have the same first-order structure. Two works have recently proposed nonparametric tests for this purpose. Zhang and Zhuang (2017) proposed a Kolmogorov-Smirnov test using the absolute difference between the point densities of the observed patterns over a p system as discrepancy measure. Fuentes-Santos, Gonz alez-Manteiga, and Mateu (2017) use a nonparametric test based on an L 2 discrepancy between densities of event locations. Here, we propose a new nonparametric test based on the log-relative risk function, widely used in epidemiology to analyze the spatial distribution of a given disease Bithell (1990); Davies, Jones, and Hazelton (2016); Kelsall and Diggle (1995). Taking into account that the relative risk function of two spatial point processes with the same spatial distribution is constant, we introduce a no-effect test that checks whether the log-relative risk function depends on event locations. This proposal is in line with the log-ratio based separability test proposed by Fuentes-Santos, Gonz alez-Manteiga, and Mateu (2018) and based on the nonparametric regression test introduced by Bowman and Azzalini (1997). In this work we have compared the performance of the three tests through a simulation study and through application to the analysis of two relevant real data problems. Prior to analyze the performance of the tests, let us compare their formulation and implementations. Here we focus on three key aspects: (i) the implementation of the test, (ii) regularity assumptions and (iii) computational demand. The Kolmogorov-Smirnov test does not require the estimation of first-order properties, avoiding the bandwidth selection problem of nonparametric estimators. However, it should be noted that this test involves the selection of a psystem and a number of partitions that can be seen as a smoothing parameter. In contrast, to implement the Cramer von Mises and regression tests we need nonparametric estimators of some first-order properties. The first-order intensities and functionals involved in the L 2 test have been estimated through kernel smoothing with plug-in bandwidths (Chac on and Duong 2010; Fuentes-Santos, Gonz alez-Manteiga, and Mateu 2016). The log-relative risk function in the no-effect test has also been estimated by kernel smoothing with scalar cross-validation bandwidth (Kelsall and Diggle 1995). The consistency of the kernel estimators used in both tests has been proved for Poisson point processes, a restrictive and unrealistic condition that may be seen as a weakness in comparison with the Kolmogorov-Smirnov test, which allows dependence between events. However, these tests can also be applied to non-Poisson point processes, in which case we compare their spatial distribution measuring the discrepancy between their conditional intensities. Finally, the Kolmogorov-Smirnov test is calibrated through the asymptotic distribution of the null hypothesis and, consequently, computationally efficient, in contrast with the high computational demand of the resampling algorithms required to calibrate the kernel-based tests. The results of the simulation study indicate that the three nonparametric tests provide reasonable estimators of the nominal significance level under the null hypothesis, although with some deviations from the nominal significance level. Comparison between calibration procedures in the regression test suggest that the random labeling algorithm performs better for unbalanced designs, whereas the bootstrap calibration provides more accurate calibrations for balanced designs. The kernel-based tests perform better than the Kolmogorov-Smirnov procedure in terms of power. In fact, the later was not able to detect differences between patterns in some cases. We also observe a faster power increase for Poisson and clustered point processes, whereas COMMUNICATIONS IN STATISTICS - SIMULATION AND COMPUTATION V R 2227 probabilities of rejection for regular point processes are relatively small in both kernel-based tests. These differences between clustered and regular point processes are linked with the inhomogeneity of the conditional intensities. Kernel estimators of point processes with smooth spatial distribution have larger bandwidth parameters than those with highly inhomogeneous distributions; this higher smoothness in the kernel intensity or log-relative risk function estimators may hamper the detection of differences between the observed patterns. This problem may be solved using adaptive instead of fixed bandwidth parameters, as done by Davies, Jones, and Hazelton (2016). However, the use of adaptive bandwidths may add a considerable computational cost to these tests limiting their applicability to real data analysis. The application to the analysis of real data shows that the Kolmogorov-Smirnov test has some limitations when dealing with sparse data, as this procedure does not detect the observed differences between arson and natural wildfire patterns. The results provided by the Cramer von Mises and regression tests agree with the visual inspection of the kernel intensity estimators. However, these tests may have a poor performance when dealing with small datasets. In view of these results, we consider that the kernel-based tests could be more accurate than the Kolmogorov-Smirnov tests, particularly in the analysis of spatial point processes with sparse events. From a practical viewpoint, the differences found between arson and natural wildfires in Galicia indicate that we should use different covariates or models to predict the occurrence of each type of wildfire. Similar conclusions can be derived from the analysis of gunfire with and without fatalities in Rio de Janeiro. 6. Conclusions This work compares the performance of three nonparametric formal tests developed to check if two spatial point patterns have the same spatial distribution, a computationally efficient Kolmogorov- Smirnov test with asymptotic calibration and two computationally demanding kernel-based tests with bootstrap calibration. Kernel-based tests outperform the Kolmogorov-Smirnov test, which reported a poor performance when dealing with sparse data and highly inhomogeneous patterns. Comparison between the kernel-based tests suggests using the Cramer von Mises test to compare spatial point processes with similar number of events, whereas the regression test with random labeling calibration is more suitable for unbalanced designs. However, even the kernel-based tests have a poor performance when dealing with regular patterns and small sample sizes, in both cases derived from the large bandwidths used in the kernel estimators involved in these tests. Finally, when these tests find differences between two spatial point processes, gunfire with and without mortal victims, for instance, we may wonder where did those differences occur. The kernel log-relative risk functions with tolerance contour surfaces can be used as local test to answer this question, allowing us to detect areas with high mortality risk in the gunfire case study. Here, as we are interested in differences at local scale, we should use kernel estimators with adaptive bandwidth parameters, as proposed by Davies, Jones, and Hazelton (2016). However, acceptance of the null hypothesis does not imply that the observed patterns have been generated by the same point process. Notice that, although the conditional intensity determines the spatial distribution of events in a spatial point process, the same conditional intensity can be generated by different models, a Poisson and a cluster process for instance. Therefore, further information about the dependence structure of the observed patterns and procedures for the combined analysis of first and second-order properties are required to test whether two observed patterns are realizations of the same point process. Acknowledgements We would like to acknowledge the collaboration of Prof. Manuel Marey for involving us in the analysis of wildfire in Galicia, and Luis Franco for his support in the access and pre-processing of wildfire data. We are grateful to 2228 I. FUENTES-SANTOS ET AL. Prof. Jorge P. Zubelli for involving us in the analysis of gun violence in Rio de Janeiro, Cecilia Oliveira for providing the gunfire database and for a number of highly clarifying discussions, and Eng. Luiz Claudio Dantas (LAMCA) for technical support in the pre-procession of the gunfire data. We acknowledge the anonymous reviewers and the Associate Editor for their valuable comments that substantially improved this paper. Funding This work has been supported by Projects MTM2016-78917-R and MTM2016-76969-P (AEI/FEDER, UE), grant AICO/2019/198 from Generalitat Valenciana, and IAP network StUDyS grant 3E120297 from the Belgian Science Policy. ORCID I. Fuentes-Santos http://orcid.org/0000-0002-3298-9648 W. Gonz alez-Manteiga http://orcid.org/0000-0002-3555-4623 J. Mateu http://orcid.org/0000-0002-2868-7604 References Alba-Fern andez, M., F. Ariza-L opez, M. D. Jim enez-Gamero, and J. Rodr ıguez-Avi. 2016. On the similarity analysis of spatial patterns. Spatial Statistics 18:352–62. doi:10.1016/j.spasta.2016.07.004. Andresen, M. A. 2009. Testing for similarity in area-based spatial patterns: A nonparametric Monte Carlo approach. Applied Geography 29 (3):333–45. doi:10.1016/j.apgeog.2008.12.004. Arias, E. D., and N. Barnes. 2017. Crime and plural orders in Rio de Janeiro. Current Sociology 65 (3):448–65. doi: 10.1177/0011392116667165. Baddeley, A., and R. Turner. 2005. Spatstat: An R package for analyzing spatial point patterns. Journal of Statistical Software 12 (6):1–42. www.jstatsoft.org. doi:10.18637/jss.v012.i06. Bithell, J. 1990. An application of density estimation to geographical epidemiology. Statistics in Medicine 9 (6): 691–701. doi:10.1002/sim.4780090616. Boubeta, M., M. J. Lombard ıa, and D. Morales. 2016. Empirical best prediction under area-level poisson mixed models. Test 25 (3):548–69. doi:10.1007/s11749-015-0469-8. Bowman, A. W., and A. Azzalini. 1997. Applied smoothing techniques for data analysis: The kernel approach with S-plus illustrations. New York: Oxford Statistical Science Series 18. Bowman, A. W., and A. Azzalini. 2014. R package sm: Nonparametric smoothing methods (version 2.2-5.5). Glasgow: University of Glasgow. http://www.stats.gla.ac.uk/adrian/sm/. Chac on, J. E., and T. Duong. 2010. Multivariate plug-in bandwidth selection with unconstrained pilot bandwidth matrices. Test 19 (2):375–98. doi:10.1007/s11749-009-0168-4. Cucala, L. 2006. Espacements bidimensionnels et donn ees entach ees derreurs dans lanalyse des processus ponctuels spatiaux. Ph.D. thesis, Universit e des Sciences Sociales, Toulouse I. Davies, T. M., and M. L. Hazelton. 2010. Adaptive kernel estimation of spatial relative risk. Statistics in Medicine 29 (23):2423–37. doi:10.1002/sim.3995. Davies, T. M., K. Jones, and M. L. Hazelton. 2016. Symmetric adaptive smoothing regimens for estimation of the spatial relative risk function. Computational Statistics & Data Analysis 101:12–28. doi:10.1016/j.csda.2016.02.008. Davies, T. M., J. C. Marshall, and M. L. Hazelton. 2018. Tutorial on kernel estimation of continuous spatial and spatiotemporal relative risk. Statistics in Medicine 37 (7):1191–221. doi:10.1002/sim.7577. Diggle, P. J. 2013. Statistical analysis of spatial and spatio-temporal point patterns. 3rd ed. Boca Raton, FL: CRC Press. Duong, T., B. Goud, and K. Schauer. 2012. Closed-form density-based framework for automatic detection of cellular morphology changes. Proceedings of the National Academy of Sciences of the United States of America 109 (22):8382–87. doi:10.1073/pnas.1117796109. Duong, T. 2013. ks: Kernel smoothing. http://CRAN.R-project.org/package=ks. Fibich, P., J. Lep s, V. Novotn y, P. Klime s, J. T e sitel, K. Molem, K. Damas, and G. D. Weiblen. 2016. Spatial patterns of tree species distribution in new guinea primary and secondary lowland rain forest. Journal of Vegetation Science 27 (2):328–39. doi:10.1111/jvs.12363. Fuentes-Santos, I., W. Gonz alez-Manteiga, and J. Mateu. 2016. Consistent smooth bootstrap kernel intensity estimation for inhomogeneous spatial poisson point processes. Scandinavian Journal of Statistics 43 (2):416–35. doi: 10.1111/sjos.12183. COMMUNICATIONS IN STATISTICS - SIMULATION AND COMPUTATION V R 2229 Fuentes-Santos, I., W. Gonz alez-Manteiga, and J. Mateu. 2017. A nonparametric test for the comparison of firstorder structures of spatial point processes. Spatial Statistics 22:240–60. doi:10.1016/j.spasta.2017.02.007. Fuentes-Santos, I., W. Gonz alez-Manteiga, and J. Mateu. 2018. A first-order, ratio-based nonparametric separability test for spatiotemporal point processes. Environmetrics 29 (1):e2482. doi:10.1002/env.2482. Fuentes-Santos, I., W. Gonz alez-Manteiga, and J. Zubelli. 2020. Nonparametric spatiotemporal analysis of violent crime. A case study in the Rio de Janeiro metropolitan area. Spatial Statistics. Advance online publication. doi:10.1016/j.spasta.2020.100431. Fuentes-Santos, I., M. Marey-P erez, and W. Gonz alez-Manteiga. 2013. Forest fire spatial pattern analysis in Galicia (NW Spain). Journal of Environmental Management 128:30–42. doi:10.1016/j.jenvman.2013.04.020. Getzin, S., T. Wiegand, K. Wiegand, and F. He. 2008. Heterogeneity influences spatial patterns and demographics in forest stands. Journal of Ecology 96 (4):807–20. doi:10.1111/j.1365-2745.2008.01377.x. Hahn, U. 2012. A studentized permutation test for the comparison of spatial point patterns. Journal of the American Statistical Association 107 (498):754–64. doi:10.1080/01621459.2012.688463. Hering, A. S., C. L. Bell, and M. G. Genton. 2009. Modeling spatio-temporal wildfire ignition point patterns. Environmental and Ecological Statistics 16 (2):225–50. doi:10.1007/s10651-007-0080-6. Illian, D. J., P. A. Penttinen, D. H. Stoyan, and D. Stoyan. 2008. Statistical analysis and modelling of spatial point patterns. Chichester: John Wiley & Sons, April. Juan, P., J. Mateu, and M. Saez. 2012. Pinpointing spatio-temporal interactions in wildfire patterns. Stochastic Environmental Research and Risk Assessment 26 (8):1131–50. doi:10.1007/s00477-012-0568-y. Kelsall, J. E., and P. J. Diggle. 1995. Kernel estimation of relative risk. Bernoulli 1(1–2):3–16. doi:10.2307/3318678. Nadaraya, E. A. 1964. On estimating regression. Theory of Probability & Its Applications 9 (1):141–42. doi:10.1137/ 1109020. Perry, G. L., B. P. Miller, and N. J. Enright. 2006. A comparison of methods for the statistical analysis of spatial point patterns in plant ecology. Plant Ecology 187 (1):59–82. doi:10.1007/s11258-006-9133-4. R Core Team. 2019. R: A language and environment for statistical computing. Vienna, Austria: R Foundation for Statistical Computing. R ıos-Pena, L., C. Cadarso-Su arez, T. Kneib, and M. Marey-P erez. 2015. Applying Binary Structured Adiditive Regression (STAR) for predicting wildfire in Galicia. Spain. Procedia Environmental Sciences 27:123–26. Ripley, B. 1977. Modelling spatial patterns (with discussion). Journal of the Royal Statistical Society, Series B 39: 172–212. Ripley, B. 1981. Spatial statistics. New York: Wiley. Watson, G. S. 1964. Smooth regression analysis. Sankhya: The Indian Journal of Statistics, Series A 26 (4):359–72. Zhang, T., and R. Zhuang. 2017. Testing proportionality between the first-order intensity functions of spatial point processes. Journal of Multivariate Analysis 155:72–82. doi:10.1016/j.jmva.2016.11.013. 2230 I. FUENTES-SANTOS ET AL.