Testing for complete spatial randomness on three dimensional bounded convex shapes

There is currently a gap in theory for point patterns that lie on the surface of objects, with researchers focusing on patterns that lie in a Euclidean space, typically planar and spatial data. Methodology for planar and spatial data thus relies on Euclidean geometry and is therefore inappropriate for analysis of point patterns observed in non-Euclidean spaces. Recently, there has been extensions to the analysis of point patterns on a sphere, however, many other shapes are left unexplored. This is in part due to the challenge of defining the notion of stationarity for a point process existing on such a space due to the lack of rotational and translational isometries. Here, we construct functional summary statistics for Poisson processes defined on convex shapes in three dimensions. Using the Mapping Theorem, a Poisson process can be transformed from any convex shape to a Poisson process on the unit sphere which has rotational symmetries that allow for functional summary statistics to be constructed. We present the first and second order properties of such summary statistics and demonstrate how they can be used to test whether an observed pattern exhibits complete spatial randomness or spatial preference on the original convex space. A study of the Type I and II errors of our test statistics are explored through simulations on ellipsoids of varying dimensions.


a b s t r a c t
There is currently a gap in theory for point patterns that lie on the surface of objects, with researchers focusing on patterns that lie in a Euclidean space, typically planar and spatial data. Methodology for planar and spatial data thus relies on Euclidean geometry and is therefore inappropriate for analysis of point patterns observed in non-Euclidean spaces. Recently, there has been extensions to the analysis of point patterns on a sphere, however, many other shapes are left unexplored. This is in part due to the challenge of defining the notion of stationarity for a point process existing on such a space due to the lack of rotational and translational isometries. Here, we construct functional summary statistics for Poisson processes defined on convex shapes in three dimensions. Using the Mapping Theorem, a Poisson process can be transformed from any convex shape to a Poisson process on the unit sphere which has rotational symmetries that allow for functional summary statistics to be constructed. We present the first and second order properties of such summary statistics and demonstrate how they can be used to construct a test statistics to determine whether an observed pattern exhibits complete spatial randomness or spatial preference on the original convex space. We compare this test statistic with one constructed from an analogue L-function for inhomogeneous point processes on the sphere. A study of the ✩ This document is the results of the research project funded by Wellcome Trust under the grant 203799/Z/16/Z.

Introduction
Research in spatial statistics has predominantly concentrated on the development of theory and methodology for point processes on R d , with a significant focus on planar (R 2 ) and spatial (R 3 ) data. Point processes existing on non-Euclidean spaces, however, are still relatively under-explored. Recently, with the advent of spatial data on a global scale, and modelling Earth as a sphere, there have been important developments in the theory and analysis of point processes on the surface of d − 1 dimensional unit spheres, S d−1 ⊂ R d (Lawrence et al., 2016;Møller and Rubak, 2016;Robeson et al., 2014). Yet patterns can still arise for which these methodologies are inappropriate as they lie on other bounded metric spaces that deviate significantly from S d−1 . For example, microbiologists are concerned with the spatial arrangement of lipids and proteins on the cellular membranes of microorganisms that are not adequately modelled by spheres. In the case of bacteria, ellipsoids or capsules (a cylinder with two hemispherical caps placed at each end) are far more appropriate candidate surfaces. Recent advances in 3D super-resolution imaging techniques (e.g. Cabriel et al., 2019;Gustavsson et al., 2018) output point patterns of this type, and there is a demand for the correct statistical procedures to analyse them. Key to the statistical analysis of spatial data is the ability to form functional summary statistics from an observed pattern, primarily for performing exploratory data analysis and testing for complete spatial randomness (CSR). On R d and S d−1 , there exists an infinite number of isometries, allowing for the notions of stationarity and isotropy to be well defined, which in turn allows for well defined functional summary statistics. However, on the surface of an arbitrary convex shape D ⊂ R 3 , the set of available isometries is finite, and thus defining stationarity, isotropy, and summary statistics directly on D is non-trivial. Building on the current literature for spherical point patterns, in particular the discussion of inhomogeneous point processes on a sphere by both Lawrence et al. (2016) and Møller and Rubak (2016), we show that it is possible to construct functional summary statistics for point processes on the surface of arbitrary convex shapes in R 3 , with our primary interest being to test for CSR.
Our approach is to map the point pattern from an arbitrary convex shape D onto S 2 . For any Poisson process on D, the Mapping Theorem (Kingman, 1993) determines that the mapped process on S 2 remains Poisson with the intensity function dependent on the mapping. By working on S 2 , we operate on a space that is more amenable to constructing summary statistics. These then allow us to test for CSR on D. The functional summary statistics we develop are based on the inhomogeneous counterparts of typical functional summary statistics already established in the spatial statistics literature. In particular, we focus on the inhomogeneous K -function, first discussed by Baddeley et al. (2000) for R d and later extended to S d−1 by Lawrence et al. (2016) and Møller and Rubak (2016). Furthermore, we also construct the empty-space function, F , spherical contact distribution, H, and J-function (the ratio of the H-and F -functions) for point processes on arbitrary convex shapes by extending the inhomogeneous definitions of van Lieshout (2011) from R d to S 2 . Section 2 introduces the notation used throughout this work and formally states the hypothesis for testing CSR on an arbitrary convex shape. Section 3 discusses functional summary statistics on S 2 , key for the construction of summary statistics on more general bounded subsets of R 3 , and the impracticalities of attempting to define functional summary statistics directly on D. Section 4 extends the inhomogeneous F -, H-, and J-functions from R d (van Lieshout, 2011) to S 2 . Section 5 describes the construction of functional summary statistics on bounded subsets of R 3 for Poisson processes, discussing their first and second order properties in the event that the intensity function is known. Section 6 provides two worked examples constructing functional summary statistics for realisations of a Poisson process observed on a cube and an ellipsoid. Section 7 discusses how regular and cluster processes can be detected based on the deviations of the empirical functional summary statistics. Section 8 describes estimation procedures for the functional summary statistics when the intensity function is unknown and we propose two test statistics for CSR. Finally in Section 9 we conduct empirical power tests using Monte Carlo simulations to explore the properties of our proposed test statistics.

Preliminaries
In this section we outline the necessary spatial theory and notation used throughout this work. We start by introducing the notion of a bounded convex space in R 3 and then define what it means for a point process to lie on such a surface. We end with the statement of the problem that this work is primarily focused on.

Notation
We also suppose that D is compact (i.e. closed and bounded) and call g the level-set function of D. Define the set D int = {x ∈ R 3 : g(x) < 0}, i.e. the boundary of D int is D and we refer to D int as the interior of D. The set D int is said to be convex if and only if for all We thus define D to be convex if its interior, D int , is convex. Examples of bounded convex sets of R 3 are spheres, ellipsoids, and cubes. Further for any bounded convex set D with level-set function g, we will also defineg which rearranges g(x) = 0, such that x 3 =g(x 1 , x 2 ), i.e. we write x 3 as a function of x 1 and x 2 . It may not always be possible to findg explicitly since, as defined previously, it may be the case that the resultantg is not a proper function. This issue can be rectified by partitioning D appropriately. For example take the case of a sphere with radius 1, then g(x) = x 2 1 +x 2 2 +x 2 3 −1, hencẽ g(x 1 , x 2 ) = ±(1 − x 2 1 − x 2 2 ) 1/2 , which is not a proper function. In this case we partition the region D into the regions x 3 ≥ 0 and x 3 < 0. Then for x 3 ≥ 0, we defineg(x 1 , x 2 ) = +(1 − x 2 1 − x 2 2 ) 1/2 and x 3 < 0,g(x 1 , x 2 ) = −(1 − x 2 1 − x 2 2 ) 1/2 . For any bounded convex sets, D, we also define its geodesic as the shortest path between two points x, y ∈ D such that every point in the path is also an element of D and denote the geodesic distance by d : D × D ↦ → R + , where R + is the positive real line including 0, thus (D, d(·, ·)) is a metric space. Additionally, we will frequently need to evaluate integrals over D, which can be done using its infinitesimal area element defined as, We assume that these convex subsets of R 3 are defined such that the origin is inside D, that is 0 ∈ D int , we then say the space D is centred. Our methodology can easily be adapted for non-centred spaces by making the appropriate translations to bring the origin inside D.
Following the notation of Møller and Waagepetersen (2004), we define λ D (x) as the Lebesgue measure restricted to the surface of the convex shape D. Consider point processes which lie on some bounded convex metric space (D, d(·, ·)). We define the notation This nomenclature is often used when the set A has finite cardinality and K is any subset of D. The cardinality of a set is denoted by |·|. Further define B D (x, r) = {y ∈ D, d(x, y) ≤ r} and the set N lf = {A ⊂ D : |A K | < ∞, K ⊆ D} where K is any subset of D. In other words, N lf is the set of subsets of D that have finite cardinality. To distinguish between points in a point process X and any point in the space D, we shall refer to elements of our point process x ∈ X as events whilst retaining the term point for any point in D. We consider point processes which are locally finite and simple. A point process, X , lying on D is said to be locally finite, if for any bounded set K ⊆ D, the number of events of X in K is finite almost surely, i.e. X ∈ N lf almost surely. A simple point process is one in which no coincident events exist almost surely, in other words if x i , x j ∈ X such that i ̸ = j then x i ̸ = x j . We also define the counting measure of X as N X (K ) = |X ∩ K | = |X K |. We denote the reduced Palm distribution of the point process X by P X ! x and define X ! x to be the point process following this density, referring to this as the reduced Palm process (Møller and Waagepetersen, 2004). For a point process X on D we define the intensity measure as the expected number of events of X for any K ⊆ D, i.e. µ(K ) = E[N X (K )], whilst the intensity function ρ(x) for all x ∈ D, if it exists, is given by, where ρ(x)λ D (dx) can be interpreted heuristically as the probability of an event of X being in the infinitesimal area λ D (dx).
We also define, for n ∈ N, α (n) (K 1 , . . . , . , x n ∈ K n ] as the nth-order factorial moment measures where the summation is taken over pairwise distinct sets of {x 1 , . . . , x n }. Further we shall assume there exists ρ (n) (x 1 , . . . , x n ) such that, where K 1 , . . . , K n ⊆ D. We can interpret ρ(x 1 , . . . , x n ) (n) λ D (dx 1 ) · · · λ D (dx n ) as the probability that events of X lie jointly in the infinitesimal areas λ D (dx i ), i = 1, . . . , n and call ρ (n) the nth-order factorial moment density. Notice that α (1) = µ, and ρ (1) = ρ. The pair correlation function is defined as, where it is taken that division by 0 results in the pair correlation function equalling 0. A useful alternative to the nth order product intensities are the nth order correlation functions (van Lieshout, 2011). They are recursively defined for n ∈ N, based on product densities, with ξ 1 = 1 and ρ (n) (x 1 , . . . , where the final sum ranges over all partitions {D 1 , . . . , D k } of {1, . . . , n} in k non-empty, disjoint sets, x D j = {x i : i ∈ D j }, j = 1, . . . , k, and x i ∈ S 2 (van Lieshout, 2011). Further, we define the generating functional (Møller and Waagepetersen, 2004) of a point process X as for a function u : D ↦ → [0, 1], which are also useful when discussing the F -, H-, and J-functions in Section 4. We define a Poisson process on D identically to one on R 2 . Let X be a point process on D such where µ(D) < ∞. Then given N X (D) = n, x i ∈ X , i = 1, . . . , n are independent and identically distributed across D with density proportional to ρ(x). We say that X is a Poisson process on D with intensity function ρ : D ↦ → R + . When ρ ∈ R + is constant we say the process is homogeneous Poisson or CSR.

Statement of the problem
We are now in a position to formally state the hypothesis of CSR we are interested in and for which this work provides an approach to testing. Let X be a spatial point process, such that g(X ) = 0 where g(X ) is a notational convenience for g(x) = 0, for all x ∈ X and g is the level set for the convex shape D. From a realisation of X we wish to conduct the following hypothesis test, 3. Summary statistics on S 2 and the impracticalities of defining functional summary statistics on general convex shapes To analyse point patterns on a convex shape D, we will be required to map the point pattern onto the unit sphere S 2 ; we use the term spheroidal point process to denote a point process that resides on S 2 . Hence it is necessary to discuss functional summary statistics in this space. We also explain why it is non trivial to construct analogous functional summary statistics directly on D, motivating a need for new methodology in order to test patterns which arise on such surfaces.

Summary statistics on S 2
Mentioned in passing by Ripley (1977), spherical point patterns only garnered interest over the past five years (Lawrence et al., 2016;Møller and Rubak, 2016;Robeson et al., 2014). Robeson et al. (2014) show that, on a sphere of radius R, the spherical K -function for a homogeneous Poisson process is K (r) = 2π R 2 (1−cos (r/R)), where r is the geodesic distance from an arbitrary event of the process. Building on this, both Lawrence et al. (2016) and Møller and Rubak (2016) define a range of typical functional summary statistics for isotropic (rotationally invariant) point processes, including the empty-space and nearest-neighbour distributions. They also extend the K -function to the class of inhomogeneous point processes that have rotationally invariant pair correlation functions. This is analogous to the inhomogeneous extension given by Baddeley et al. (2000) for point processes on R d .
The geodesic on S 2 is commonly referred to as the great circle distance and for two points x, y ∈ S 2 has analytic form d(x, y) = cos −1 (x · y), where x · y is the dot product between vectors x, y ∈ S 2 . We define a point process X on S 2 to be isotropic if its distribution is invariant under is the set of orthogonal 3 × 3 matrices (Møller and Rubak, 2016). Here we use d = to denote equal in distribution. Such an isotropic process has constant intensity function ρ ∈ R + . Functional summary statistics are frequently employed for both exploratory data analysis and model fitting, playing a pivotal role in the early stages of any in depth investigation of an observed point pattern. In the homogeneous case, let X be an isotropic spheroidal point process with constant intensity function ρ ∈ R + then the F -, H-, J-, and K -functions are defined as, where r ∈ [0, π] and o = (0, 0, 1) T is defined as the origin of S 2 . Estimators of these functional summary statistics can be used to determine whether the underlying process of an observed point pattern follows a specific distribution. In particular, they can be used to test whether a pattern arises from a CSR process or whether the underlying process exhibits regularity or clustering. A treatment of the standard isotropic functional summary statistics on S 2 is given in Lawrence et al. (2016) and Møller and Rubak (2016). It will be necessary for us to consider the inhomogeneous extensions of these functional summary statistics as they will form the foundation for our functional summary statistics for point process on convex bounded shapes in R 3 . We begin by reviewing the inhomogeneous K -function, originally attributed to Baddeley et al. (2000) for a class of inhomogeneous point processes in R d , and then extended to non-isotropic point processes on S 2 by Lawrence et al. (2016) and Møller and Rubak (2016). In Section 4, we will construct the inhomogeneous F -, H-, and J-functions for non-isotropic point processes on S 2 . This builds on the formulation of van Lieshout (2011) for non-stationary point processes in R d .

Inhomogeneous K -function
For the extension of the K -function to inhomogeneous processes on R 2,3 , Baddeley et al. (2000) introduce the notion of a point process being second order intensity reweighted stationary (SOIRWS). Here we focus on the extension for S 2 where Lawrence et al. (2016) and Møller and Rubak (2016) define the notion of second order intensity reweighted isotropic (SOIRWI). A point process X on S 2 is said to be SOIRWI if its pair correlation function, h, is rotationally invariant, that is h(x, y) = h(d(x, y)), where d is the great circle distance on S 2 . Lawrence et al. (2016) and Møller and Rubak (2016) define the inhomogeneous K -function for a SOIRWI process as, where O x : S 2 ↦ → S 2 is a rotation that takes x to o. Here, K inhom is independent of the choice of A ⊆ S 2 with λ S 2 (A) > 0, and by convention a/0 = 0, for a ≥ 0. For a Poisson process it is easy to show that K inhom (r) = 2π (1 − cos(r)). Therefore the K -function is the same for all Poisson processes regardless of whether the intensity function is constant or not (Møller and Rubak, 2016).
Both Lawrence et al. (2016) and Møller and Rubak (2016) propose the following estimator for K inhom for a fully observed point pattern on S 2 , which is unbiased if ρ is known. In the more likely event that ρ is unknown, Lawrence et al. (2016) and Møller and Rubak (2016) suggest using a plugin estimator for ρ(x)ρ(y).

Impracticalities of defining functional summary statistics directly on D
We now explain the subtle reasoning as to why constructing functional summary statistics directly on D is not a trivial extension from S 2 . The definitions given by Eqs.
(2)-(5) are well defined when considering stationary or isotropic point processes on R d or S 2 respectively. This is because the symmetries of the space admit well defined notions of stationarity/isotropy based on translations and rotations. Since an arbitrary convex space D does not, in general, have isometries these notions of stationarity/isotropy cannot be well defined. Therefore, defining functional summary statistics analogous to (2)-(5) is not possible.
Further, we also argue that we cannot define a point process to be SOIRWI on D. On S 2 being SOIRWI is equivalent to having a rotationally invariant pair correlation function. We may be tempted to equivalently define a point process to be SOIRWI on D if it has an invariant form for its pair correlation function. In particular this would make sense for a Poisson process on D as it would have pair correlation function, h(x) = 1 for all x ∈ D. Closer inspection though leads us to conclude that this is not an appropriate definition for SOIRWI on D. Based on Møller and Waagepetersen (2004, Definition 4.5, p. 32) we can take a point process X with intensity function ρ : S 2 ↦ → R + as being SOIRWI on S 2 if the measure, does not depend on the choice of A ⊆ S 2 for 0 < |A| < ∞, where we take a/0 = 0. K is then called the second order reduced moment measure. If the pair correlation function exists and is invariant under rotations, then by the Campbell-Mecke Theorem (Møller and Waagepetersen, 2004) it follows that Thus on S 2 a point process is SOIRWI if h is invariant under rotations. Eq. (7) implicitly depends on rotations O x (y). If we now consider a point process on D, we cannot construct the second order reduced moment measure as, in general, we do not have an analogous isometry. This in turn means that we cannot define SOIRWI directly on D based on an invariance of the pair correlation function.
Moreover, for a point process on S 2 , consider the more specific case when B = B S 2 (o, r), r > 0 in (7). This is identically the inhomogeneous K -function. The indicator function of (7) is still welldefined in the case of S 2 such that we are counting the events of X \ {x} that are at most a distance r from x ∈ X . This same intuition could not equivalently be applied to point processes on a convex shape as the ball of radius r from a point x on D also depends on Thus it is not possible to directly define an inhomogeneous K -function on D.

Extending the inhomogeneous F -, H -, and J -functions to S 2
On R d , in the stationary case, it can be shown that the F -, and H-functions have infinite series representations (White, 1979), and further work by van Lieshout (2006) also gives an infinite series representation for the J-function based on the nth-order correlation functions. Theorem 1 gives an infinite series representation when the nth-order reduced factorial moment measure of all n exists, similar to (White, 1979) but where the underlying space is S 2 .

Theorem 1. Let X be an isotropic spheroidal point process with constant intensity function ρ. Further
we assume the existence of all nth-order factorial moment measures for both X and its reduced Palm process, X !
x . Then the F -and H-functions have the following series representation, where α (n) and α !(n) x are the factorial moment measure for X and X ! x and B S 2 (o, r) is the spherical cap of radius r at the origin o ∈ S 2 . These representations hold provided the series is absolutely convergent, that is if lim n→∞ |a n+1 /a n | < 1 or lim sup n→∞ (|a n |) 1/n < 1, where a n = ( Proof. See Theorem 1, Section S1 of the Supplementary Material. □ The following corollary reduces the representations for the F -, and H-function for when the nth-order product density exist. These representations are those used by van Lieshout (2011).
Corollary 1 (White, 1979). Under the same assumptions as Theorem 1, let X be an isotropic spheroidal point process with constant intensity function ρ. Further we assume the existence of all nth-order product intensities for both X and its reduced Palm process, X !
x . Then the F -and H-functions have the following series representation, provided the series is absolutely convergent, where B S 2 (o, r) is the spherical cap of radius r at the origin Proof. See Corollary 1, Section S1 of the Supplementary Material. □ Adapting the work of van Lieshout (2011), the J-function for an isotropic spheroidal point process, based on the series for the F -, and H-function given by Theorem 1, has the following infinite series representation In order to define the inhomogeneous F -, H-, and J-function we first define the notion of iterative reweighted moment isotropic (IRWMI) for a class of non-isotropic spheroidal point processes, similar to the notion of iterative reweighted moment stationary in R 2,3 (van Lieshout, 2011).

Definition 1.
A spheroidal point process X is said to be IRWMI if, for all n ∈ N, the nth-order correlation functions are rotationally invariant. That is ξ n (x 1 , . . . , Identically to the inhomogeneous J-function in R 2,3 (van Lieshout, 2011), we define the inhomogeneous J-function on S 2 .
Notice that since the point process is IRWMI then the J-function does not depend on the origin o, and furthermore when the point process is isotropic J inhom collapses down to J since the intensity function is constant. In the context of R d , van Lieshout (2011) shows that the inhomogeneous Jfunction can be written as the ratio of generating functionals of the point process. Here we easily adapt the theorem for IRWMI point processes on S 2 .
Theorem. For all r ∈ [0, π] and y ∈ S 2 , u y ρ(x 1 )···ρ(xn) λ S 2 (dx 1 ) · · · λ S 2 (dx n ) is absolutely convergent. Then under the further assumptions associated with the inhomogeneous J-function and the existence of all nth-order intensity function ρ !(n) y for the reduced Palm distribution X ! y , ∀y ∈ S 2 , for when G(1 − u y r ) > 0, where G ! y and G are the generating functionals for X ! y and X respectively.

Proof. See Theorem 1 of van Lieshout (2011). □
From the proof given by van Lieshout (2011), it can be shown that the numerator and denominator do not depend on the arbitrary event or point y respectively. Further, in the case of an isotropic point process the numerator can be shown to be G !
, and so the F -, and H-functions can be extended to the inhomogeneous case, , where the functions do not depend on the arbitrary event y of the point process.
Similar to van Lieshout (2011) in R 2,3 , we propose the following estimators for the inhomogeneous F -, and H-functions for spheroidal IRWMI point processes as, where P ⊆ S 2 is a finite grid of points. The properties of theF inhom -function are independent of the choice of P (van Lieshout, 2011). In this work we choose P such that the points on S 2 are equidistant. van Lieshout (2011) shows thatF inhom (r) is unbiased whilstĤ inhom (r) is ratio-unbiased. Then sinceF inhom is unbiased andĤ inhom is ratio-unbiased, constructingĴ inhom aŝ gives a ratio-unbiased estimator for J inhom (r).

Summary statistics for Poisson processes on convex shapes
Here, we construct summary statistics for Poisson processes on general convex shapes. We show that a Poisson process on a general convex shape, D, can be mapped to a Poisson process on a sphere, and then define functional summary statistics for such processes. We discuss properties of these functional summary statistics in the more general setting of inhomogeneous Poisson processes on S 2 .

Mapping from D to S 2
To circumvent the geometrical restrictions of D we show, in this section, that we can map Poisson processes from D to S 2 and construct functional summary statistics in this space. Theorem 2 shows that a Poisson process on D can be transformed to a Poisson process on a sphere where we can take advantage of the rotational symmetries. The invariance of Poisson processes between metric spaces is known as the Mapping Theorem (Kingman, 1993). We use the function f (x) = x/∥x∥ to map point patterns from D to S 2 . Lemma 1 shows that this function is bijective and hence measurable.
Proof. See Lemma 1, Section S2 of the Supplementary Material. □ Rather than using the Mapping Theorem (Kingman, 1993), we utilise Proposition 3.1 of Møller and Waagepetersen (2004) to show that mapping a Poisson process from D to S 2 results in a new Poisson process on S 2 and also derive the intensity function of the mapped process on S 2 .

Theorem 2. Let X be a Poisson process on an arbitrary bounded convex shape
function and is defined as, where, , where f −1 is the inverse of f , det(·) is the determinant operator, and f * : R 2 ↦ → R 2 is the function which maps x 1 ↦ → x 1 /∥x∥ and x 2 ↦ → x 2 /∥x∥.
Proof. See Theorem 2, Section S2 of the Supplementary Material. □ To solidify the notation used to describe the space D in Theorem 1, we demonstrate it with a clear example. Let us suppose that D is an ellipsoid with semi-major axis lengths a, b, and c along the x, y and z -axes. Then we define D 1 to be the D ∩ {x ∈ R 3 : x 3 ) T and x 3 < 0}. Then using the notation outlined in Section 2.1 we takẽ Remark 1. A notion of bijectivity arises from this theorem. Consider the set of all Poisson processes on D such that their intensity functions exist, label this set T D . Also define T S 2 as all the Poisson processes on S 2 such that their intensity functions exist. Then for any X ∈ T D implies that f (X ) ∈ T S 2 .
Similarly by considering the inverse operation f −1 , which exists by Lemma 1, for all Y ∈ T S 2 implies that f (Y ) ∈ T D . Hence the mapping f : T D ↦ → T S 2 is surjective. By Theorem 2 if X , Y are Poisson processes on D with intensity function ρ X and ρ Y respectively then f (X ) and f (Y ) are the same Poisson process if and only if ρ X = ρ Y and so the mapping is also injective, and hence bijective.
This means that analysis of a Poisson process, X , on D is equivalent to the analysis of f (X ) on S 2 .
Remark 2. Further, another useful result which follows directly from Theorem 2 is the construction of approximate Poisson processes on S 2 . More precisely consider a convex surface D for which instead of having a level-set function, g, we have an approximation to the space, for example consider we have a finite piecewise planar approximation to D. Then D can be approximated by ∪ n i=1 D i , where each D i is a planar piece and there are n ∈ N pieces to the approximation. For each D i the level-set function is g i (x) = a i x 1 +b i x 2 +c i x 3 +d i = 0, and we can then use this approximation of D to map a Poisson process on D to S 2 .

Construction of functional summary statistics
We are now in a position to construct functional summary statistics for a Poisson process which lies on some bounded convex space D. Since all Poisson processes on S 2 are SOIRWI (Møller and Rubak, 2016) and IRWMI (van Lieshout, 2011), the estimators for F inhom , H inhom , J inhom , and K inhom (see Eqs. (8)-(10) and (6) respectively) (van Lieshout, 2011;Møller and Rubak, 2016) can be combined with the mapped intensity function from Theorem 2 to construct estimators as follows, where X is a Poisson process on D with intensity function ρ, Y = f (X ) is the mapped Poisson process onto S 2 , ρ * is given by (11) andρ * = inf x∈S 2 ρ * (x). In the event that ρ : D ↦ → R + is unknown and therefore ρ * is unknown, nonparametric plug-in estimates of ρ * can be constructed on S 2 (Lawrence et al., 2016;Møller and Rubak, 2016).

Properties of functional summary statistics
Consider the general case of all Poisson processes on S 2 . Theorem 3 gives the expectations of F inhom (r),Ĥ inhom (r), andK inhom (r). We restate the mean ofK inhom (Lawrence et al., 2016;Møller and Rubak, 2016) and adapt the proof to Proposition 1 in van Lieshout (2011) for R d , to show that F inhom is unbiased andĤ inhom is ratio unbiased for S 2 . In addition we also provide the expectation ofĤ inhom (r).

Proof. See
Corollary 2. With the same assumptions as Theorem 3, let X be a spherical Poisson process on S 2 with intensity function ρ : S 2 ↦ → R + . Definingρ = inf x∈S 2 ρ(x), the bias of the estimatorĤ inhom (r) is bounded by for all r ∈ [0, π].
Proof. See Corollary 2, Section S3 of the Supplementary Material. □ Corollary 2 shows that, depending on the intensity function and henceρ = inf x∈S 2 ρ(x) , the bias can be considered negligible.
In the examples to come we set the expected number of events in the process to be large enough for the bias to be considered negligible. Next we provide the variance of the estimators of the functional summary statistics.
Proof. See Theorem 4, Section S4 of the Supplementary Material. □ Due to the complexity of the estimator for theĴ inhom -function, its mean and variance are extremely complex and although can be derived in terms of integrals over S 2 , we instead give an approximation based on the Taylor series expansion of the function f (x, y) = x/y around the means of the numerator and denominator. We first provide conditions for which the first two moments of J inhom (r) exist and then proceed to show how it can be approximated.
Proof. See Theorem 5, Section S5 of the Supplementary Material. □ Proposition 1. Let X be a spheroidal Poisson process with known intensity function ρ : S 2 ↦ → R + . Then the covariance between 1 −Ĥ inhom (r) and 1 −F inhom (r) for r ∈ [0, π] is, where P is a finite grid of points on S 2 and,

Proof. See Proposition 1, Section S5 of the Supplementary Material. □
Using a Taylor series expansion (see Section S5.2 of the Supplementary Material), we can approximate the expectation and variance ofĴ inhom (r) as where X = 1 −Ĥ inhom (r) and Y = 1 −F inhom (r). The terms in Eqs. (16) and (17)

Examples
We now look at two examples where we simulate homogeneous Poisson processes on their surfaces and construct the previously described functional summary statistics.

Cube
We define a centred cube over each of the six faces with a side length 2l, where l = 1. The level-set function for a cube is, Using Theorem 2 we can derive the intensity function for the point process that is mapped to the sphere. By symmetry we need only consider one of the faces of the cube and by rotation we will be able to derive the intensity function on the sphere. Consider the bottom face, i.e. x 3 = −l, and in the notation of Theorem 2 label this D 1 . Then, and so the intensity function over f (D 1 ) is,  where D 1 , D 2 , D 3 , D 4 , D 5 , and D 6 are the faces such that z = −1, z = 1, y = −1, y = 1, x = −1, and x = 1 respectively. Fig. 1 demonstrates mapping from a cube with l = 1 and ρ = 50 to the unit sphere where the shading over the sphere indicates areas of low (dark) and high (light) intensity. The figure also shows an example of a CSR pattern over the cube and how this pattern changes under the mapping. In order to be able to construct the inhomogeneous F -, and H-function we need to determine inf x∈S 2 ρ * (x). By the nature of the function f (x) = x/∥x∥ and assuming that l ≥ 1, then mapping events from the cube to the sphere causes events to be more concentrated on the sphere compared to the cube, thus increasing the corresponding intensity on the sphere. Therefore, the lowest achievable intensity occurs at the centre of each face of the cube, i.e. for the bottom face it occurs when x 1 = x 2 = 0, giving inf x∈S 2 ρ * (x) = ρ. Fig. 2 gives examples of the inhomogeneous K -, F -, H-, and J-functions where l = 1 and ρ = 5 and are typical when the observed process is CSR.

Ellipsoid
An ellipsoid is defined by its semi-major axis lengths a, b, c ∈ R along x-, y-, and z-axis respectively. Again we also assume that the ellipsoid is centred at the origin. The level-set function for ellipsoids is given by g(x) = x 2 1 /a 2 + x 2 2 /b 2 + x 2 3 /c 2 − 1, in this current formg is not well defined in which case we shall use the following equivalent representation This representation then allows forg to be well defined for each partition of the ellipsoid.
We now demonstrate our methodology on an ellipsoid with semi-major axis lengths a = 1, b = 1, and c = 3 along the x-, y-, and z-axis respectively. Instead of using the function f (x) = x/∥x∥ to map from the ellipsoid to the sphere, we can use a simpler mapping function which makes calculation of the determinant J (i,f * ) (x) in Theorem 2 significantly easier. We can simply scale along the axis directions, i.e. use the mapping f (x) = (x 1 /a, x 2 /b, x 3 /c) T . Using this mapping function, as opposed to dividing each vector by the norm of itself, and focusing on the bottom hemiellipsoid (indicated by the minus superscript), then and so on the lower hemisphere the intensity function takes the form By symmetry the mapped intensity function over the whole sphere is then Again we need to calculate inf x∈S 2 ρ * (x). Noting that c ≥ a = b, thus − ( 1 − c 2 /a 2 ) ≥ 0 and − ( 1 − c 2 /b 2 ) ≥ 0, then the square root term is minimised when x 1 and x 2 are 0, hence inf x∈S 2 ρ * (x) = ρab. An example of this mapping is given in Fig. 3. Using this we can construct the estimators of the inhomogeneous functional summary statistics given by Eqs. (12)-(15). Examples are given in Fig. 4. These figures are typical for CSR with the estimated functional summary statistics lying well within the simulation envelopes.

Regular & cluster processes on D
We examine some regular and cluster processes on D. In particular, we examine how functional summary statistics constructed under the Poisson hypothesis deviate when the underlying process is in fact not Poisson. We shall be using the Matérn I and II inhibition processes (Chiu et al., 2013) as examples of regular processes, and Thomas processes as a cluster example. Definitions for the Matérn I, II and Thomas processes on convex shapes will also be presented, whilst properties of such processes are given in Section S6 of the Supplementary Material.

Examples of regular and cluster processes on convex shapes
A common way of defining a regular process is using a minimum distance R, known as the hardcore distance, for which no events in the process has a nearest neighbour closer than R. In typical applications R is usually the Euclidean distance (in R d ) or the great circle distance (in S 2 ), but on an arbitrary three dimensional convex shape, D, this distance is taken as the geodesic distance defined by the surface. The following definitions extend the Matérn I and II processes to a convex shape with geodesic distance d(x, y), x, y ∈ D.
Definition 3. Let X be a homogeneous Poisson process on D with intensity ρ ∈ R + . Fix R > 0, and thin X according to the following rule: delete events x ∈ X if there exists y ∈ X \ {x} such that d(x, y) < R, otherwise retain x. The resulting thinned process is then defined as a Matérn I inhibition process on D.
Definition 4. Let X be a homogeneous Poisson process on D with intensity ρ ∈ R + . Fix R > 0, and let each x ∈ X have an associated mark, M x drawn from some mark density P M independently of all other marks and events in X . Thin X according to the following rule: delete the event x ∈ X if there exists y ∈ X \ {x} such that d(x, y) < R and M y < M x , otherwise retain x. The resulting thinned process is then defined as a Matérn II inhibition process on D.
We also extend the Neyman-Scott process, a class of cluster processes, to arbitrary convex shapes.
Definition 5. Let X P be a homogeneous Poisson process on D with intensity ρ ∈ R + . Then for each c ∈ X P define X c to the point process with intensity function ρ c (x) = αk(x, c), where α > 0 and k : D × D ↦ → R is a density function and N Xc (D) can be any random counting measure associated to X c . The point process X = ∪ c∈Xp X c is a Neyman-Scott process.
A Thomas process is a specific Neyman-Scott process where the density function k(·, ·) has a specific form. In R 2 , k is taken to be an isotropic bivariate Gaussian distribution (Møller and Waagepetersen, 2004), whilst on S 2 it is taken as the Von-Mises Fisher distribution (Lawrence et al., 2016). We define a Thomas process on D to be a Neyman-Scott process with density function k of the form, where κ is a bandwidth parameter and . This is known as the Riemannian Gaussian distribution (Said et al., 2017), where on the plane this would reduce to an isotropic bivariate Gaussian.

Functional summary statistics assuming a homogeneous Poisson process
We simulate Matérn II, and Thomas processes and construct estimates of their functional summary statistics under the assumption that they are CSR. The inhomogeneous functional summary statistics are displayed in Fig. 5. Comparing Fig. 5 to typical functional summary statistics for regular and cluster processes in R 2 , we see the same types of deviations away from CSR. In particular, we see for regular processes with small r that there are negative deviations, whilst the cluster process has large positive deviations for theK inhom -function. Furthermore, theĴ inhom -function shows significant positive deviations for regular processes whilst negative ones are observed for cluster processes. Fig. 5 highlights the importance of considering many different functional summary statistics when attempting to draw conclusions from the data (Diggle, 2003). More precisely consider the top If we were to only consult the K inhom simulation envelope (top left figure) then we may be hesitant to reject CSR, but when we examine the H inhom and J inhom simulation envelope plots there is strong evidence to suggest that this process is not CSR and is in fact regular. Thus, for this specific setting, the simulation envelope plots of the J inhom function provide greater power compared to those produced with the K inhom function, especially for smaller r (Baddeley et al., 2015, p. 235). This effect is also seen in Figure 1 of van Lieshout (2011) for Log Gaussian Cox processes on R 2 , where for small values of r the K inhom is unable to provide evidence against the process being inhomogeneous Poisson but examining both the F inhom and H inhom provides greater evidence against this hypothesis.
This phenomena was first discussed by Baddeley and Silverman (1984), where they show that it is possible to construct planar processes which are not homogeneous Poisson but have the same K -function. This is also discussed by Baddeley et al. (2000) in Section 2.4 in the inhomogeneous setting. Similar arguments to those in Baddeley et al. (2000) and Baddeley and Silverman (1984) can be used to construct spheroidal processes that are not Poisson but exhibit the same K -function as any given Poisson process with the same intensity. This discussion serves as a precautionary warning to consulting only one individual functional summary statistic and it is therefore important to consider many to avoid drawing improper conclusions from data.

Testing for CSR on convex shapes in R 3
Exploratory data analysis for spatial point patterns in R 2 typically begins with testing whether the observed point pattern exhibits CSR where test statistics are frequently based on the L-function, L(r) = √ K (r)/π . On R 2 and under CSR the L-function is linear in r and variance stabilised (Besag, 1977) whilst Lawrence (2018) discusses the analogue L-function in S 2 where again it is variance stabilised when the underlying process is CSR. As we are working with inhomogeneous Poisson processes on S 2 an equivalent transformation for the L function has not been discussed previously. We propose two test statistics: 1. an extension of the analogue L -function proposed by Lawrence (2018) to the inhomogeneous setting, and 2. a standardisation of the inhomogeneous K -function inspired by Lagache et al. (2013).
In order to construct the latter we must derive first and second order properties of the estimated functional summary statistics. Section 7 discusses derivations for any spherical Poisson process when ρ is known. In this section we consider the scenario when we have a homogeneous Poisson process on D with unknown intensity ρ ∈ R + . Furthermore we shall only focus on the inhomogeneous K -function as standardisation of the remaining functional summary statistics follow identically.

Test statistic for CSR
Given a homogeneous Poisson process on D with intensity ρ ∈ R + , we map this to S 2 giving a new Poisson process on the sphere with inhomogeneous intensity function given by Theorem 2 as Using Theorems 3 and 4 we can calculate the mean and variances of the inhomogeneous K -function when ρ is known. When ρ is unknown we use estimators of ρ when constructing functional summary statistics. In particular we usê , which are both unbiased for ρ and ρ 2 respectively by application of the Campbell-Mecke Theorem (Møller and Waagepetersen, 2004). Thus our estimator for K inhom (r) when ρ is unknown takes the following form, where Y = f (X ), f is our mapping from the ellipsoid to the sphere, andρ(x) is given by, Note that N Y (S 2 ) = N X (D 2 ).
An analogue L -function for isotropic spherical point processes was introduced by Lawrence (2018) in which the square root of Ripley's spherical K -function is taken. This transformation benefits from approximate variance stabilisation in the same sense as the L -function does in R d (Besag, 1977) but is not linearised. In the planar setting a multiplicative factor of 1/ √ π can be used such that L(r) = r but due to the more complex form of K on S 2 a simple linearising transformation is not intuitive. Therefore Lawrence (2018) suggests subtracting the theoretical value in order for the summary statistic to be zero in the event a process is Poisson. Following this line of thought we then propose, in the inhomogeneous setting, the following functional summary statistic (1 − cos(r)), where we use P inhom rather than L inhom to avoid confusion with the Euclidean L -function as P inhom takes a very different form to its Euclidean counterpart. In the event of a homogeneous Poisson process over D (and hence a inhomogeneous Poisson process over S 2 ) we can estimate P inhom as, Diggle (2003) proposes using the maximum absolute value between the theoretical and the estimated functional summary statistics to test for CSR. Based on this we propose the following two test statistics, the first based on the work of Lawrence (2018) and the second on the work of Lagache et al. (2013). In order to be able to construct the test statistic T 2 , an estimate of the variance of the empirical functional summary statistics are required. Further, we need show that the bias ofK inhom (r) is negligible and hence E[K inhom (r)] ≈ 2π (1 − cos(r)) for Poisson processes, validating its use in (21). By using estimators for ρ and ρ 2 we alter the first and second order properties given by Theorems 3 and 4. In the following we consider the first and second order moments ofK inhom .
Proof. See Theorem 6, Section S7 of the Supplementary Material. □ The form of the variance derived in Theorem 6 is near identical to that derived by Lang and Marcon (2013) except that our derivations consider inhomogeneous Poisson processes, does not require corrections for edge effects, and the space is S 2 instead of R 2 . Further we can bound the absolute value of the bias as follows |Bias(K inhom (r))| = P(N Y (S 2 ) ≤ 1)2π (1 − cos r) = exp(−µ Y (S 2 ))(1 + µ Y (S 2 ))2π (1 − cos r) ) , where µ Y is the intensity measure of Y = f (X ), the inequality in (23) is attained by setting r = π, and (24) follows from e x ≥ x e . Thus, for shapes considered in this work, the bias will be negligible. From Theorem 6 it is possible to construct a ratio-unbiased estimator for the variance. In particular by the Campbell-Mecke Theorem, and defining the estimatorρ , then E[ρ k ] = ρ k and soρ k is unbiased for ρ k . We can substitute the expectations in (22) with their corresponding observed values, for example we substitute . Additionally, the following lemma helps derive a ratio unbiased estimator for P(N Y (S 2 ) < 1).

Lemma 2.
Let N ∼ Poisson(λ), k ∈ N and p ∈ R + . Define the following random variable, Then R is ratio-unbiased for λ k e −pλ .
Proof. See Lemma 2, Section S7 of the Supplementary Material. □ Using Lemma 2 we can construct a ratio-unbiased estimator for (1 − P(N Y (S 2 ) < 1))P(N Y (S 2 ) < 1). Defining λ = ρλ D (L), and so a ratio-unbiased estimator for (1 − P(N Y (S 2 ) < 1))P(N Y (S 2 ) < 1) is Plugging the given estimators for (1 − P(N Y (S 2 ) < 1))P(N Y (S 2 ) < 1), ρ 2 , ρ 3 , (22) gives a ratio unbiased estimator for Var(K inhom (r)), which in turn allows for the construction of the test statistic T 2 in (21). Fig. 6 highlights how the empirical K -function estimates deviate when the underlying process is not CSR. For the regular processes we notice considerable negative deviations for small r whilst for cluster processes positive deviations are observed, highlighted in the right column of Fig. 6.

Standardised inhomogeneous K -function plots
Intuitively, this is to be expected, with a near identical reasoning to what is observed for the K -function in R 2,3 . Since the regular process has a hard-core distance between events, we observe estimates for K inhom (r) that are close to zero for small r, thus resulting in the large negative deviation observed in Fig. 6. On the other hand, for the Thomas cluster process, we observe events in closer proximity than would be expected for a CSR process, thus the estimated K inhom (r) function has large positive deviations away from CSR.
Further to this, the second row of Fig. 6 corresponding to a Poisson process highlights the importance of applying a variance stabilising transform. If we based a test statistic on K inhom (r) − 2π (1 − cos(r)) (or even K inhom (r)) then these plots suggest worst power compared to the P inhomand the standardised K inhom -functions.  6. Example of (from left to right) K inhom -, K inhom − 2π (1 − cos(r))-, P inhom -, and the standardised K inhom -functions for a Matérn II with R = 0.2, an exponential mark distribution with rate λ = 1 and expectation 100 (top row), Poisson process with expectation 40π (middle row), and Thomas process with parameters κ = 0.5, expectation of 150 and offspring mean of 20 (bottom row) on a prolate spheroid with a = b = 0.8000, c = 1.43983 (dimensions chosen so that the area of the ellipsoid is 4π ). Solid line is the estimated functional summary statistics for our observed data, dashed line is the theoretical functional summary statistic for a Poisson process, and the grey shaded area is the simulation envelopes from 999 Monte Carlo simulations of Poisson processes fitted to the observed data.

Simulation study
We conduct empirical Type I and II error studies to evaluate the effectiveness of the proposed test statistic in determining whether or not a point process on a convex shape exhibits CSR. We consider different prolate ellipsoids such that the area of the ellipsoid is the same across differing semi-major axis lengths. This will allow us to determine how the power of our test changes as the space under consideration deforms further away from the unit sphere.

Design of simulations
In order to best understand the properties of our testing procedure we will consider CSR, Matérn II and Thomas processes on different prolate spheroids. We design the experiments such that the expected number of events is similar across all experiments. For both the CSR and Thomas process simulations this is easily controlled. For a Poisson process, the expected number on D is ρλ D (D) whilst for a Thomas process it is given by Proposition S3, Section S6 in the Supplementary Materials.
On the other hand, the Matérn II process requires a little more attention since Corollary S4 (Section S6 of the Supplementary Materials) limits the maximum expected number of possible Table 1 Results when the observed data is CSR. The semi-major axis length along the x-axis, a, and y-axis, b, are equivalent and the semi-major axis length along the z-axis is determined such that the area of the ellipsoid is 4π .
A full outline of all the experiments and the parameters chosen are given in Tables 1, 2, and 3 for CSR, regular, and cluster process simulations respectively. Note that when R = 0 for the Matérn II process and when κ = ∞ for the Thomas process both processes are CSR.

Test statistics
Calculating |P inhom (r)| and |(K inhom (r) − 2π (1 − cos r))/(Var(K inhom (r))) 1/2 | over all r ∈ [0, π] is computationally infeasible and so we instead calculate it for r ∈ R = {r 1 , . . . , r m }, m ∈ N, where R is a finite set of distinct, evenly spaced points such that r i ∈ [0, π], i = 1, . . . , m, for the purposes of our simulation studies. We then take our test statistic as where for these simulation studies we set R = {0, 0.02, 0.04, . . . , π }. These simulations are tested at a 5% significance level. Each experiment is repeated 1000 times, and for each experiment we simulate 999 Poisson processes to approximate the critical values of the hypothesis test.

Results
Tables 1-3 outline the parameter selection and results of our simulations. By the nature of Monte Carlo simulations the CSR results given in Table 1 are as to be expected with an empirical rejection rate close to 0.05. Expectedly, we see that for the same ellipsoid i.e. a kept constant, that when the Matérn II parameter R increases and the Thomas process parameter κ decreases (each representing an increased departure from CSR), the power of our test improves. In the Section S6.3 of the Supplementary Material we discuss a potential reason for the power of our test decreasing as a decreases (hence c increases), for both regular and cluster processes, for the same R and κ respectively. Additionally, Fig. 5 suggests we may gain power by considering a two sided test.
We see that T 1 achieves greater empirical power compared to T 2 over the majority of experiments considered in our simulation study. This is clearly the case when a = 1 or 0.8 for the Matérn II process whilst when a = 0.6 or 0.4 the distinction is not as clear. In particular, T 2 achieves considerably greater empirical power for Experiment (2civ). For the Thomas process we see that T 1 out performs T 2 in nearly all experiments for all values of a. These result suggest the following considerations in practice: (1) consider T 1 before T 2 since computing T 1 is simpler, (2) if T 1 does not provide sufficient evidence against the null then T 2 may provide additional information or even considering another functional summary statistic that has been developed in this work.
Although a formal hypothesis test may be sought, these results emphasise that this should not be without a detailed examination of simulation envelope plots which can potentially provide further information. In particular, simulation envelope plots can give indications as to whether the point pattern exhibits more regular or clustered behaviour (Diggle, 2003).

Table 2
Results when the observed data is a Matérn II process, with independent mark being exponential with rate 1. The semimajor axis length along the x-axis, a, and y-axis, b, are equivalent and the semi-major axis length along the z-axis is determined such that the area of the ellipsoid is 4π . Fixing the expectation, µ, and hard-core distance, R, we use Eq. (26) to calculate ρ for the underlying constant Poisson process intensity function. When R = 0 a Matérn II process collapses to a CSR process.  Table 3 Results when the observed data is an ellipsoidal Thomas process. The expected number of offspring per parent is λ = 20 and the underlying Poisson parent process has constant intensity function ρ = µ/(4πλ), where µ is the expectation. The semi-major axis length along the x-axis, a, and y-axis, b, are equivalent and the semi-major axis length along the z-axis is determined such that the area of the ellipsoid is 4π . When κ = ∞ an ellipsoidal Thomas process collapses to a CSR

Discussion & conclusion
In this work we have discussed point patterns observed on arbitrary, bounded convex shapes in R 3 , motivated by the need for such exploratory analyses in the area of microbiology. We have highlighted the challenge of handling such spaces due to the lack of isometries for such objects. Using the invariance of Poisson processes (Kingman, 1993), we can circumvent this lack of isometries in the original space by mapping to the sphere which has rotational symmetries. By doing so we propose a set of functional summary statistics for the class of Poisson processes. Further to this we have also proposed functional summary statistics for CSR processes on the convex space and explored their properties. Using this we have, in turn, been able to construct test statistics which can be used to reject the hypothesis of CSR for observed point patterns. We have also conducted simulation studies to investigate the effectiveness off the proposed test statistics in rejecting the null hypothesis when the observed data is either regular or clustered.
Interesting extensions to this work would include relaxing the need for convexity of the shape of interest. This presents a significant challenge as how one constructs the required mapping is not obvious. Another consideration is how to construct an estimator of the intensity function on D. One approach might be to construct it on S 2 and inverse map to D. There is, of course, the open question of how one forms summary statistics for multivariate point processes on convex shapes. Answering this would have immediate impact in bioimaging applications where experimentalists are regularly interested in spatial dependencies that exist between two or more different types of molecules.