Comparison of spatial point patterns is of practical importance in a number of scientific fields including ecology, epidemiology, and criminology. For example, such comparisons may reveal differential effects of the environment on plant species spread, uncover spatial variation in disease risk, or detect seasonal differences in crime locations. While exploratory analyses are vital for obtaining deep insights about pattern differences, such analyses can be subjective unless supplemented with formal hypothesis tests.
In this paper we are interested in comparing the first-order structures [FirstOrderPatComp] of point patterns. To be more precise, consider two point processes and over the region with the first-order intensities given by ) and . Given realizations from these processes, we would like to detect whether there are statistically significant differences in the first-order intensities. However, testing for equality,
, is not flexible enough. For example, when studying the spatial variation in disease risk, the diseased population is only a small fraction compared to the control population; naturally, the corresponding observed patterns will differ significantly in the overall counts of points—yet this is irrelevant to the substantive question. The more appropriate null hypothesis posits that there exists a constantsuch that . Equality within a constant factor means that the intensities have the same functional form of spatial variation. To avoid dealing with the nuisance parameter
, one can normalize the intensities to integrate to 1, giving rise to probability distributionsand over the region ; in [FirstOrderPatComp] these are called the densities of event locations. Now, our null hypothesis is equivalent to the equality , which is an instance of the two-sample hypothesis testing problem (see, e.g. [ANDERSON199441]).
In practice it is desirable to have nonparametric hypothesis testing approaches to pattern comparison that: a) capture a particular aspect of difference; b) can be applied to both single and replicated patterns; and c) do not depend on resampling methods for (re-)calibration. Early nonparametric tests for pattern comparison [DigglePatComp1, UteHahnJASA] probe for differences in the -functions [RipleyKFunction] of point patterns. Being based on a second-order property, the detected differences conflate the spatial variation in intensities with the interaction properties. Concentrating on the first-order properties, [rel_risk1, rel_risk2, rel_risk3]estimate the logarithm of the ratio between the intensities using kernel density estimation. Other approaches rely on counting events within pre-specified areas [ANDRESEN2009333, ALBAFERNANDEZ2016352]. The recent work [FirstOrderPatComp] detects differences in the first-order structure by looking at the -distance between kernel density estimates of the probability distributions above (i.e. and ). All of these first-order comparison approaches are limited to single patterns, and in practical situations most of them are calibrated with resampling methods.
In this paper, we introduce an approach that leverages the kernel mean embedding (KME) [mmd, MMD_review] to test for the equality , which allows us to detect differences in the first-order structure of point patterns. Our approach is based on introducing an approximate version of the kernel mean embedding, aKME. While the original KME is infinite-dimensional and implicit, our approximate kernel mean embedding is finite-dimensional and comes with explicit closed-form formulas. With the help of aKME, we reduce the pattern comparison problem to the comparison of means in the Euclidean space. We carry out the latter by applying -tests on each coordinate of the embedding, and obtain an overall -value using the harmonic mean -value combination technique [HarmonicP1958, HarmonicP], leading to well-calibrated and powerful tests as confirmed by the simulations. The main advantages of the proposed approach are that it can be applied to both single and replicated pattern comparisons, and that neither bootstrap nor permutation procedures are needed to obtain or calibrate the -values.
The ideas developed in this paper are in line with the recent surge of interest in applying reproducing kernel Hilbert space techniques to the comparison of probability distributions. For example, the Maximum Mean Discrepancy (MMD) is a measure of divergence between distributions [mmd]
which has already found numerous applications in statistics and machine learning. This has led to the general approach of kernel mean embeddings, see for example the the recent review[MMD_review] and citations therein. Our approximate embedding has its roots in the Random Fourier Features [Rahimi:2007:RFL:2981562.2981710] and its application to the MMD [Fastmmd], although the scheme proposed here is tailored to the two-dimensional setting, and has the ability to provide high-order approximations. There has already been some interest in applying the reproducing kernel methodology to spatial point processes, the roots going back to the 1980s [bartoszynski1981, silverman1982] and more recently in [flaxman2017, jitkrittum_linear-time_2017, SteinPapangelou]. We discuss some of the connections between reproducing kernel machinery and kernel density estimation based methods commonly used with spatial point patterns in Section 2.
The main contributions of this paper are the proposed approximate kernel mean embedding (Section 3) and the hypothesis testing framework for comparison of point patterns (Section 4). After investigating the empirical properties of the resulting tests on simulated data (Section 5.1), we present applications of the methodology to two real world datasets (Section 5.2).
Kernel Mean Embedding
Mathematically rigorous development of the kernel mean embedding requires the machinery of the reproducing kernel Hilbert spaces, and the interested reader is referred to [MMD_review]. For our purposes, it will be sufficient to concentrate on the dual version of the definition where the kernel mean embedding is expressed in terms of the feature maps.
Given a data instance (in our context will be a point in some region of ), a nonlinear transformation can be used to lift this point into a feature space that is usually high/infinite dimensional. When the entire dataset is lifted like this, the hope is that a good feature map would reveal structures in the dataset that were not apparent in the original space . For example, in the context of classification in machine learning, two classes that are hard to separate in the original space may turn out linearly separable in the feature space. This is the foundation of kernel based approaches in machine learning (see e.g. [ElementsStatisticalLearning]), with the idea going back to [cover_theorem].
Assuming that an inner product is available on , with each feature map one can associate the kernel function defined by . It turns out that the converse is true as well: for each positive semi-definite (psd) kernel function there exist a corresponding inner-product space together with a feature map satisfying .
For a given psd kernel , the kernel mean embedding (KME) of a probability distribution over is defined as the expectation
An important property of this embedding is that when is a characteristic kernel, the embedding is injective [MMD_review]. In other words, for two distributions and over , the equality is satisfied if and only if . This means that in the context of two-sample hypothesis testing, intuitively, the problem of testing whether can be reduced to testing , albeit in the infinite-dimensional space .
Two-Sample Tests with KME
To avoid the infinite-dimensionality and absent an explicit formula for , one can use the kernel trick to devise an actual hypothesis testing procedure. Consider the distance (as induced by the inner-product in ) between KMEs of and , which is known as the Maximum Mean Discrepancy (MMD) [mmd]:
The kernel trick, namely the application of the equality , allows to express the MMD in terms of without requiring an explicit formula for the feature map , namely,
In practice this statistic is estimated from the samples by replacing the expectations with the sample means, with a nuance that the first and third terms can either include the diagonal terms or exclude them; the former gives a biased and the latter gives an unbiased estimator. Large enough values ofprovide evidence against the null hypothesis of .
This has been an extremely fruitful approach to two-sample testing as witnessed by the vast amount of the follow-up work, see the references in [mmd, MMD_review]. The distribution of MMD under the null hypothesis is not asymptotically normal nor has a practically useful explicit form except in big data settings where one can compute an incomplete estimator of MMD that is asymptotically normal; these cases are described in generality in [MMDyamada2018post]. As a result, in typical scenarios some kind of approximation or resampling procedure is required to perform the test, see [mmd] and pointers therein.
Connections to Kernel Density Estimation
The above described machinery has a close connection to kernel density estimation commonly used with spatial point patterns. For example, let us consider the two-sample test statistic proposed in[ANDERSON199441], which was used by [Duong8382] in a three-dimensional setting and later adapted to the spatial point pattern comparison problem in [FirstOrderPatComp]. This statistic is constructed by first obtaining kernel density estimates of the two distributions and then computing the squared -distance between the density estimates. Its connection to MMD is described in [mmd, Section 3.3.1] and can be exemplified as follows: if, say, the kernel density estimate is based on the Gaussian RBF kernel of width , then this statistic is equivalent to the MMD computed with the same kernel but of width . Overall, MMD statistic is strictly more general than the statistic of [ANDERSON199441] because it allows using a larger variety of kernels; another benefit is the stronger consistency guarantees that stem from the kernel mean embedding interpretation. Similarly to the MMD, the statistic of [ANDERSON199441] is not asymptotically normal under the null; nevertheless, a normal approximation was suggested in [Duong8382]. However, this approximation leads to calibration problems: [FirstOrderPatComp] reported conservativeness of the resulting test, which led them to rely on bootstrap for calibration.
Of course, instead of the -distance, other distances can be computed between the kernel density estimates to obtain statistics that capture complementary aspects of the differences between distributions. Similarly, one can realize that the MMD captures only one aspect of the discrepancy between the kernel mean embeddings. For example, the kernel Fisher discriminant analysis (KFDA) test statistic [KernelFisherDA1] is another statistic that can be computed via the kernel trick and used to test the equality . Similarly to the relationship between MMD and the squared -distance, the KFDA is connected to the -distance between kernel density estimates. An insightful review of this type of connections can be found in [KernelFisherDA2].
3 Approximate Kernel Mean Embedding
Instead of relying on the kernel trick, in this section we take an orthogonal path to avoiding the infinite-dimensionality of the kernel mean embedding. Namely, specializing to the case , we construct a finite-dimensional approximate feature map such that . As a result, testing can be reduced to testing in the -dimensional Euclidean space.
For the rest of the paper we will concentrate on the Gaussian RBF kernel , where . To avoid clutter in the derivations the kernel width is assumed to be ; the case of general is mentioned below. Our goal is to construct an approximate feature map for the Gaussian RBF kernel tailored to the two-dimensional case. As a starting point, we will use the following representation for the Gaussian kernel (see, e.g. [SkolkovoKernelApprox]),
where . To compress the notation, let where the dependence on and is suppressed from the notation. We change to the radial coordinates, and notice that is an even function to obtain:
is a unit vector inmaking an angle of with the -axis. We approximate the integration with respect to by the simple mean over a set of equidistant , . Let to get
Now we use a radial version of Gauss-Hermite quadrature to compute the integral over [jackel-2005a]. For a given integer , denoting the quadrature roots by and the corresponding weights by , we obtain111The values of the roots and weights can be retrieved from the following URL: http://www.jaeckel.org/RootsAndWeightsForRadialGaussHermiteQuadrature.cpp
The crucial point is that the terms containing and are untangled, which allows us to write approximately as a dot product in the embedding space: , where , is explicitly given by
Figure 1 (adapted from [Rahimi:2007:RFL:2981562.2981710]) gives an intuitive depiction of this construction. An R implementation of the embedding step can be found in Appendix A. The circular ensemble interpretation of [Fastmmd] applies to our construction as well, giving further insights and clarifying the relationship to the MMD.
While there is a clear connection to the Random Fourier Features [Rahimi:2007:RFL:2981562.2981710], yet our construction is tailored to the two-dimensional setting and is based on a deterministic quadrature rule that quickly provides a high-order approximation. In contrast, the construction in [Rahimi:2007:RFL:2981562.2981710] and its improvements [KernelApprox1, KernelApprox2, SkolkovoKernelApprox]4 do generalize to such embeddings and, consequently, can be applied in high-dimensional settings.
We note that the case of the Gaussian kernel with the width can be accommodated by replacing with . To avoid committing to a single , in practice, we construct multiple feature maps corresponding to different values of the kernel width, and concatenate them together.
Finally, having introduced the approximate feature map, we can define the approximate kernel mean embedding (aKME) of a probability distribution over the region as From a theoretical point of view, this approximate construction loses the injectivity of the kernel mean embedding, and, consequently, the consistency of the test. However, as we will see in the experimental section, this does not lead to any apparent issues with the testing power in practical situations. We believe that this is related to the approximation quality of the proposed embedding whereby one is able to capture most of the information about the distribution in a small number of dimensions.
3.1 Spatial Point Pattern aKME
Let be a point process on the region with the first-order intensity function given by ). The intensity function of can be normalized to give the probability distribution on :
In [FirstOrderPatComp] this is called the density of event locations. The aKME of the point process is defined via the embedding of , namely, In practice, we only have access to a point process via its realizations, and so, we must be able to estimate the aKME in an unbiased manner from a point pattern; this is the focus of the current subsection.
Consider a realization of the point process . The estimator that we will be interested in is the one that replaces the expectation appearing in the aKME formula by the sample mean:
We require this estimate to be unbiased, , where the expectation is taken over the realizations of the process . Unbiasedness is essential as it ensures that the estimate captures information about the functional form of the intensity function rather than some other properties of the point process.
For Poisson processes it is easy to see that unbiasedness holds, yet writing out an explicit proof will make clear what properties of the point process are relevant to unbiasedness. To this end, let be a Poisson process with intensity , where the constant is the integral in the denominator of Eq. (3.1). We will condition on the number of the points in the realization, . As well-known, this can be seen as a Binomial process on , which we denote by ; the intensity of is given by . We can write,
Using Campbell’s formula we have
Substituting this back, we get
which proves unbiasedness.
The crucial ingredient in the derivation is the following: conditioning on the number of points in the pattern does not have an effect on the functional form of the intensity. For example, above it went from to , which is a change by a constant factor. While theoretically it is possible to construct point processes where this does not hold, the simplicity of this requirement makes it possible to use domain knowledge to assess how likely is the condition to hold in practice. For example, in plant biology applications the functional form of the intensity is determined by the environmental factors such as light conditions, level of water underground, and quality of soil, which makes it plausible to assume that the condition holds.
The non-Poisson case is relevant to the proposed hypothesis test for replicated pattern comparison. Different replications commonly have differing numbers of points. If the condition above is not satisfied—the point pattern properties depend profoundly on the number of points—then the replicated pattern comparison cannot be performed by any test, unless all of the involved patterns have exactly the same number of points. In this latter case our test can be used too because for a fixed number of points unbiasedness holds directly by Campbell’s formula.
4 Comparing Spatial Point Patterns with aKME
Consider two point processes and in with the first-order intensity functions given by ) and . We would like to test the null hypothesis of whether there exists a constant such that . Equality within a constant factor means that the intensities of the two processes have the same functional form. This is different from testing because our null hypothesis can hold true even if the realizations from and have vastly differing numbers of points. We can compute the probability distributions and from the intensities ) and using the formula Eq. (3.1). Clearly, the null hypothesis above can be written as , allowing us to use the aKME machinery and reducing the problem to testing whether holds in the -dimensional Euclidean space.
Single Pattern Comparison
Assume that we observe two point patterns and from two Poisson processes and on the region with the true intensity functions given by ) and . We would like to test the null hypothesis of whether there exists a constant such that .
Applying the aKME machinery, we reduce the test to checking whether in the -dimensional Euclidean space. While the classic Hotelling’s test seems like a natural choice, yet in practice even the computation of the precision matrix turns out to be unstable due to the nonlinear relationships between the coordinates of the approximate feature map. This is why we perform the test by applying -tests independently to each coordinate and combining the resulting -values as explained below.
More precisely, for each coordinate , by Poisson assumption we can consider and to be two independent samples of sizes and respectively; here is the -th coordinate of the approximate feature map. Our goal is to compare the sample means and
. Note that since the approximate feature maps are expressed in terms of sines and cosines, their range is bounded, and so the classical Central Limit Theorem can be applied to deduce the approximate normality of the sample meansand when the sample sizes are big enough. As a result, we can apply the Behrens-Fisher-Welch
-test (without assuming equality of variances) to obtain the corresponding-value .
All together we end up with a set of -values one per coordinate of the aKME. In principle, one can resort to multiple testing procedures to reject or retain the global null. However, it is useful to compute an overall -value for the the global null hypothesis so that it can be used in downstream multiple testing procedures. To obtain such an overall -value we use the recently popularized harmonic mean -value combination approach [HarmonicP1958, HarmonicP]. Namely, one defines
where is a function whose precise form is described in [HarmonicP]. While at the theoretical level this approach assumes independence between -values, yet as shown in [HarmonicP] it is very robust when there are dependencies. We observed this to be true with our -values as well: despite the dependencies, we found that obtained in this manner resulted in well-calibrated tests with better power than simple alternatives such as the Bonferroni adjustment for multiple testing. Other -value combination approaches such as Fisher’s and Stouffer’s methods (see, e.g. [pvalue_combo1, pvalue_combo2]) failed to give well-calibrated -values likely due to their strong reliance on the independence assumption.
Replicated Pattern Comparison
While the above test was based on the Poisson assumption, we consider another setting where the only assumption on the point processes is that the sample mean gives an unbiased estimate of aKME. Here, for two such general processes and on the region with true intensity functions given by ) and , we observe a set of patterns and independently drawn from and respectively. Our goal is to test whether , which is reduced to testing exactly as before.
In this setting, we can consider and as independent samples of sizes and . This allows us to test for the equality of -th coordinates using the -test. Here, the validity of the -test stems from independence of replications and holds for general processes; this should be contrasted to the above test which derives its validity from the independence of samples in the Poisson process. The set of -values obtained from the -tests are combined once again using Eq. (4.1) to obtain an overall -value .
We finish with an important remark about the nature of this test. The point processes and do not have to be of the same type for the null hypothesis to hold. The test is concerned only with the functional form of the intensity, and not the type of the process. For example, if is a homogeneous inhibition process and is a homogeneous cluster process, then the null hypothesis still holds due to the first-order intensity functions being the same or differing by a constant factor.
Our goal in this section is to investigate the size and the power of the proposed tests. We also demonstrate two applications to real world data. The aKME embedding is constructed using four radial projections and four roots for the polar Gauss-Hermite formula (i.e. , , and in the notation of Section 3) resulting in . To avoid the selection of the kernel width parameter, we concatenate together aKMEs corresponding to and , when the point pattern domain is the unit square; the dimensionality of the concatenated aKME is .
Single Pattern Comparison
Our simulation setting for single pattern comparison closely follows the design of [YongtaoGuan2008]. We generate a homogeneous Poisson process (CSR) and inhomogeneous Poisson processes (Linear and Sine) on the unit square . For the inhomogeneous processes the intensity functions are given by and , where is the abscissa and takes the values of . All of the intensity functions are normalized so that the expected number of points per realization is roughly and . Each type of model is simulated 2000 times.
|Model||Mean Point Count||Guan,|
Table 1 lists rejection rates at the nominal levels and . The top part of the table corresponds to the case where the patterns being compared come from the same intensity model. The resulting rejection rates give the size of the test; note that all of them are close to the nominal sizes, which confirms that our test is well-calibrated. In the bottom half of the table the patterns being compared come from different intensity models; the corresponding rejection rates give the power of the test. For comparison, in the last column we include the rejection rates at level taken from [YongtaoGuan2008] (specifically, Table 1 with the choice of ; the values for CSR were not available). Note that while our test compares two point patterns, Guan’s test is a goodness-of-fit test, whereby it compares a pattern against a model, and so it has access to the theoretical quantities, which, in principle, gives it a competitive advantage. Nevertheless, it can be seen from the table that our test compares very favorably to Guan’s test in terms of power.
Next we investigate what happens when the Poisson assumption is violated. To this end we run comparisons between patterns from homogeneous Poisson process and patterns from homogeneous non-Poisson processes. This is the null case, because the functional form of intensity is the same (constant) for all of these cases. The non-Poisson processes we consider are generated using the spatstat package [spatstat] and are as follows. We use Matern’s Model II inhibition process with the inhibition distance parameter setting of ; these are referred to as Hardcore-1,2,3. We also generate realizations from Matern’s cluster process with the radius parameter value of 0.1, and with the mean number of points parameter ; these are called Cluster-1,2,3 respectively. The underlying intensity for all of the processes is set to yield an average of 100 points per pattern.
Table 2 lists the resulting null rejection rates which correspond to the size of the test. We see that the inhibition process results in the test becoming more conservative; we conjecture that this is true in general, and so, when inhibition can be argued based on the domain knowledge, the rejections obtained via our test are still valid. In contrast, clustering quickly leads to an anti-conservative test. The latter is not surprising, as the clustered points cannot be seen as independently drawn. One way of looking at this is that the effective sample size [EffectiveSampleSize0, EffectiveSampleSize1, EffectiveSampleSize2] in a clustered process is lower than the number of points in the pattern. Next, we investigate whether correcting the -tests for the sample size can bring the test size to the nominal level. We made a back-of-the-envelope computation of the effective sample size by the formula: ; note that this is different from the naive due to clusters with zero points being deleted. The resulting sizes are shown in Table 3, and match the nominal rates more closely. Of course, in practice, one pattern is not enough to deduce whether the clustering is due to the heterogeneity of the intensity or due to clustering; thus, some modeling assumptions on the point process would be required in order to carry out such a correction.
Replicated Pattern Comparison
Since in the replicated pattern test does not require the Poisson assumption, we generate seven classes of point patterns first homogeneous and second non-homogeneous, yielding fourteen types of patterns in total. For homogeneous versions, we generate CSR, Hardcore-1,2,3, and Cluster-1,2,3. To obtain the non-homogeneous versions of these, we start with a homogeneous version and independently thin it with spatially varying retention probability of ; this is based on [10.2307/4541321]. As a result, we obtain inhomogeneous point patterns where the intensity has the functional form . All generation processes were manipulated so that the expected number of points per realization is roughly . The first row in the Table 4 lists the rejection rates corresponding to the cases when the patterns compared have the same (in-)homogeneity type without regard for the class of the pattern. This corresponds to the null case, and we can see that the sizes are close to the nominal levels. The second row lists the rejection rates when the the (in-)homogeneity types differ, and so correspond to the power of the test.
5.2 Real-World Data
Single Pattern: Cancer Data
We apply the single pattern comparison test to a dataset from an epidemiological study relating to the locations of larynx and lung cancer occurrences in Chorley-Ribble area of Lancashire, England during the years of 1974-1983; the source of the data is [DiggleIncinerator]. Figure 2 plots the 58 cases of larynx cancer and 978 cases of lung cancer together with the location of an industrial incinerator in this area. Following [DiggleIncinerator], we assume that the inhomogeneous Poisson process model applies, and that the distribution of the lung cancer cases can be used as a surrogate for the susceptible population.
Let the corresponding true intensity functions be ) and . If there is an effect of the relative location of the incinerator on larynx cancer (and not on lung cancer), then the functional forms of these intensities would be different, i.e. there would be some non-constant function such that . If, furthermore, depends on the distance to the incinerator, this would be an evidence of a differential effect of the incinerator on the two types of cancer.
Considering the larynx cancer locations as the point pattern and the lung cancer locations as the pattern , we would like to test whether the functional form of the intensity is the same for these patterns. Note that the null hypothesis states that there is a constant such that the intensities of the two point processes satisfy . Applying our methodology, we find the -value of , which leads us to retain the null hypothesis; this is in agreement with the re-analyses of this data such as [DigglePatComp1].
Replicated Patterns: Chicago Crime
In this experiment we use the dataset provided by Chicago Data Portal222data.cityofchicago.org that reflects reported incidents of crime that occurred in the City of Chicago. We consider all of the crimes during the year of 2018 within a geospatial window (shown in Figure 3), and the goal is to compare the spatial patterns of each crime type between weekdays and weekends. We wanted to pick days that are maximally spaced out and avoid ambiguity (e.g. Friday nights), so we decided to compare the following days of the week: Tuesday, Thursday, and Saturday. The comparison between Tuesday and Thursday serves as a sanity check, as we do not expect to see any differences between them.
For each day and type of crime we generate the crime patterns, and filter by the count of points keeping the patterns that have more than 20 points. Next we count how many distinct patterns are available for each day and type of crime; we kept the crime types that had at least 20 patterns for each of Tuesday, Thursday, and Saturday. The types of crimes remaining after this filtering are shown in Table 5 together with the number of days and the average count of points per pattern.
The results of comparisons are shown in the last two columns of Table 5. We run the Benjamini-Hochberg [FDR] procedure on the 18 resulting -values at the false discovery rate of , and the rejected hypotheses are indicated by the -values in bold. As expected, no differences were detected between Tuesday and Thursday patterns. On the other hand, we see that there are statistically significant differences between Tuesday and Saturday patterns in the following categories of crime: theft, criminal damage, deceptive practice, and battery.
|Crime Type||Tuesday||Thursday||Saturday||Tue vs Thu||Tue vs Sat|
|Motor Veh. Theft||40||25.9||40||25.4||40||22.8||0.475||0.657|
We have introduced an approach to detect differences in the first-order structure of spatial point patterns. The proposed approach leverages the kernel mean embedding in a novel way, by introducing its approximate version. Hypothesis testing is based on conducting -tests on each dimension of the approximate embedding and combining them using the harmonic mean approach. Our experiments confirm that the resulting tests are powerful and the -values are well-calibrated. Two applications to real world data have been presented.
An interesting avenue for future research would be to leverage the directionality of the projections that correspond to the subsets of dimensions of the aKME (c.f. Figure 1). One can envision a technique where anisotropy in the first-order structure difference would be detected by appropriately combining the -values. Another aspect would be to investigate the scales at which the differences happen, this time combining the -values for each scale. The harmonic mean approach is suitable for such multi-facet and multi-level analyses as shown in [HarmonicP]. Another direction is studying the proposed approach in the context of goodness-of-fit testing of the first-order structure. Since our approach allows for vastly differing numbers of points in the patterns, one can compute a low-variance approximation to the theoretical aKME of the model distribution by constructing a pattern via drawing a large number of points from that distribution. Finally, it would be desirable to extend the proposed technique to the high-dimensional setting, where the curse of the dimensionality would be an important factor that can affect the testing power.
Appendix A R Implementation of Single Pattern Comparison
Here we provide an R implementation of the single pattern comparison test for the example demonstrated in Section 5.2, namely comparison of the larynx and lung cancer location patterns.