## Simulating a Poisson point process on a n-dimensional sphere

In the previous post I outlined how to simulate or sample a homogeneous Poisson point process on the surface of a sphere. Now I will consider a homogeneous Poisson point process on the $$(n-1)-$$ sphere, which is the surface of the Euclidean ball in $$n$$ dimensions.

This is a short post because it immediately builds off the previous post. For positioning the points uniformly, I will use Method 2 from that post, which uses normal random variables, as it immediately gives a fast method in $$n$$ dimensions.

I wrote this post and the code more for curiosity than any immediate application. But simulating a Poisson point process in this setting requires placing points uniformly on a sphere. And there are applications in that, such as Monte Carlo integration methods, as mentioned in this post, which nicely details different sampling methods.

## Steps

As is the case for other shapes, simulating a Poisson point process requires two steps.

##### Number of points

The number of points of a Poisson point process on the surface of a sphere of radius $$r>0$$ is a Poisson random variable. The mean of this random variable is $$\lambda S_{n-1}$$, where $$S_{n-1}$$ is the surface area of the sphere.  For a ball embedded in $$n$$ dimension, the area of the corresponding sphere is given by

$$S_{n-1} = \frac{2 \pi ^{n/2} }{\Gamma(n/2)} r^{n-1},$$

where $$\Gamma$$ is the gamma function, which is a natural generalization of the factorial. In MATLAB, we can simply use the function gamma.  In Python, we need to use the SciPy function scipy.special. gamma.

### Locations of points

For each point on the sphere, we generate $$n$$ standard normal or Gaussian random variables, say, $$W_1, \dots, W_n$$, which are independent of each other. These random variables are the Cartesian components of the random point. We rescale the components by the Euclidean norm, then multiply by the radius $$r$$.

For $$i=1,\dots, n$$, we obtain

$$X_i=\frac{rW_i}{(W_1^2+\cdots+W_n^2)^{1/2}}.$$

These are the Cartesian coordinates of a point uniformly scattered on a  sphere with radius $$r$$ and a centre at the origin.

###### How does it work?

In the post on the circle setting, I gave a more detailed outline of the proof, where I said the method is like the Box-Muller transform in reverse. The joint density of the normal random variables is from a multivariate normal distribution with zero correlation. This joint density a function of the Cartesian equation for a sphere. This means the density is constant on the sphere, implying that the angle of the point $$(W_1,\dots, W_n)$$ will be uniformly distributed.

The vector formed from the normal variables $$(W_1,\dots,W_n)$$ is a random variable with a chi distribution.  But the final vector, which stretches from the origin to the point $$(X_1,\dots,X_n)$$, has length one, because we rescaled it with the Euclidean norm.

## Code

The code for all my posts is located online here. For this post, the code in MATLAB and Python is here.

I recommend this blog post, which discusses different methods for randomly placing points on spheres and inside spheres (or, rather, balls) in a uniform manner.  (Embedded in two dimensions, a sphere is a circle and a ball is a disk.)

Our Method 2 for positioning points uniformly, which uses normal variables, comes from the paper:

• 1959, Muller, A note on a method for generating points uniformly on n-dimensional spheres.

Two recent works on this approach are the following:

• 2010, Harman and Lacko, On decompositional algorithms for uniform sampling from -spheres and -balls;
• 2017, Voelker, Gosman, Stewart, Efficiently sampling vectors and coordinates.

## Simulating a Poisson point process on a sphere

In this post I’ll describe how to simulate or sample a homogeneous Poisson point process on the surface of a sphere. I have already simulated this point process on a rectangle, triangle disk, and circle.

Of course, by sphere, I mean the everyday object that is the surface of a three-dimensional ball, where this two-dimensional object is often denoted by $$S^2$$.  Mathematically, this is a generalization from a Poisson point process on a circle, which is slightly simpler than randomly positioning points on a disk.  I recommend reading those two posts first, as a lot of the material presented here builds off them.

I have not needed such a simulation in my own work, but I imagine there are many reasons why you would want to simulate a Poisson point process on a sphere. As some motivation, we can imagine these points on a sphere representing, say, meteorites or lightning hitting the Earth.

The generating the number of points is not difficult. The trick is positioning the points on the sphere in a uniform way.  As is often the case, there are various ways to do this, and I recommend this post, which lists the main ones.  I will use two methods that I consider the most natural and intuitive ones, namely using spherical coordinates and normal random variables, which is what I did in the post on the circle.

Incidentally, a simple modification allows you to scatter the points uniformly inside the sphere, but you would typically say ball in mathematics, giving a Poisson point process inside a ball; see below for details.

## Steps

As always, simulating a Poisson point process requires two steps.

##### Number of points

The number of points of a Poisson point process on the surface of a sphere of radius $$r>0$$ is a Poisson random variable with mean $$\lambda S_2$$, where $$S_2=4\pi r^2$$ is the surface area of the sphere. (In this post I give some details for simulating or sampling Poisson random variables or, more accurately, variates.)

### Locations of points

For any homogeneous Poisson point process, we need to position the points uniformly on the underlying space, which is in this case is the sphere. I will outline two different methods for positioning the points randomly and uniformly on a sphere.

##### Method 1: Spherical coordinates

The first method is based on spherical coordinates $$(\rho, \theta,\phi)$$, where the radial coordinate $$\rho\geq 0$$, and the angular coordinates $$0 \leq \theta\leq 2\pi$$ and $$0\leq \phi \leq \pi$$. The change of coordinates gives $$x=\rho\sin(\theta)\cos(\phi)$$, $$y=\rho\sin(\theta)\sin(\phi)$$, and $$z=\rho\cos(\phi)$$.

Now we use Proposition 1.1 in this paper. For each point, we generate two uniform variables $$V$$ and $$\Theta$$ on the respective intervals $$(-1,1)$$ and $$(0,2\pi)$$. Then we place the point with the Cartesian coordinates

$$X = r \sqrt{1-V^2} \cos\Theta,$$

$$Y = r \sqrt{1-V^2}\sin\Theta,$$

$$Z=r V.$$

This method places a uniform point on a sphere with a radius $$r$$.

###### How does it work?

I’ll skip the precise details, but give some interpretation of this method. The random variable $$\Phi := \arccos V$$ is the $$\phi$$-coordinate of the uniform point, which implies $$\sin \Phi=\sqrt{1-V^2}$$, due to basic trigonometric identities.  The area element in polar coordinates is $$dA = \rho^2 \sin\phi d\phi d\theta$$, which is constant with respect to $$\theta$$. After integrating with respect to $$\phi$$,  we see that the random variable $$V=\cos\Phi$$ needs to be uniform (instead of $$\Phi$$) to ensure the point is uniformly located on the surface.

##### Method 2: Normal random variables

For each point, we generate three standard normal or Gaussian random variables, say, $$W_x$$, $$W_y$$, and $$W_z$$, which are independent of each other. (The term standard here means the normal random variables have mean $$\mu =0$$ and standard deviation $$\sigma=1$$.)  The three random variables are the Cartesian components of the random point. We rescale the components by the Euclidean norm, then multiply by the radius $$r$$, giving

$$X=\frac{rW_x}{(W_x^2+W_y^2+W_z^2)^{1/2}},$$

$$Y=\frac{rW_y}{(W_x^2+W_y^2+W_z^2)^{1/2}},$$

$$Z=\frac{rW_z}{(W_x^2+W_y^2+W_z^2)^{1/2}}.$$

These are the Cartesian coordinates of a point uniformly scattered on a  sphere with radius $$r$$ and a centre at the origin.

###### How does it work?

The procedure is somewhat like the Box-Muller transform in reverse. In the post on the circle setting,  I gave an outline of the proof, which I recommend reading. The joint density of the normal random variables is from a multivariate normal distribution with zero correlation. This joint density is constant on the sphere, implying that the angle of the point $$(W_x, W_y, W_z)$$ will be uniformly distributed.

The vector formed from the normal variables $$(W_x, W_y,W_z)$$ is is a random variable with a chi distribution.  We can see that the vector from the origin to the point $$(X,Y,Z)$$ has length one, because we rescaled it with the Euclidean norm.

## Plotting

Depending on your plotting software, the points may more resemble points on an ellipsoid than a sphere due to the different scaling of the x, y and z axes. To fix this in MATLAB, run the command: axis square. In Python, it’s not straightforward to do this, as it seems to lack an automatic function, so I have skipped it.

## Results

I have presented some results produced by code written in MATLAB and Python. The blue points are the Poisson points on the sphere. I have used a surface plot (with clear faces) to illustrate the underling sphere in black.

##### Python

Note: The aspect ratio in 3-D Python plots tends to squash the sphere slightly, but it is a sphere.

## Code

The code for all my posts is located online here. For this post, the code in MATLAB and Python is here.  In Python I used the library mpl_toolkits for doing 3-D plots.

## Poisson point process inside the sphere

Perhaps you want to simulate a Poisson point process inside the ball.  There are different ways we can do this, but I will describe just one way, which builds off Method 1 for positioning the points uniformly. (In a later post, I will modify Method 2, giving a way to uniformly position points inside the ball.)

For this simulation method, you need to make two simple modifications to the simulation procedure.

##### Number of points

The number of points of a Poisson point process inside a sphere of radius $$r>0$$ is a Poisson random variable with mean $$\lambda V_3$$, where $$V_3=4\pi r^3$$ is the volume of the sphere.

### Locations of points

We will modify Method 1 as outlined above. To sample the points uniformly in the sphere, you need to generate uniform variables on the unit interval $$(0,1)$$, take their cubic roots, and then, multiply them by the radius $$r$$. (This is akin to the step of taking the square root in the disk setting.) The random variables for the angular coordinates are generated as before.

I recommend this blog post, which discusses different methods for randomly placing points on spheres and inside spheres (or, rather, balls) in a uniform manner.  (Embedded in two dimensions, a sphere is a circle and a ball is a disk.)

Our Method 2 for positioning points uniformly, which uses normal variables, comes from the paper:

• 1959, Muller, A note on a method for generating points uniformly on n-dimensional spheres.

This sampling method relies upon old observations that normal variables are connected to spheres and circles. I also found this post on a similar topic.

Here is some sample Python code for creating a 3-D scatter plot.

## Simulating a Poisson point process on a circle

In this post, I’ll take a break from the more theoretical posts. Instead I’ll describe how to simulate or sample a homogeneous Poisson point process on a circle.  I have already simulated this point process on a rectangle, triangle and disk. In some sense, I should have done this simulation method before the disk one, as it’s easier to simulate. I recommend reading that post first, as the material presented here builds off it.

Sampling a homogeneous Poisson point process on a circle is rather straightforward.  It just requires using a fixed radius and uniformly choose angles from interval $$(0, 2\pi)$$. But the circle setting gives an opportunity to employ a different method for positioning points uniformly on circles and, more generally, spheres. This approach uses Gaussian random variables, and it becomes much more efficient when the points are placed on high dimensional spheres.

## Steps

Simulating a Poisson point process requires two steps: simulating the random number of points and then randomly positioning each point.

##### Number of points

The number of points of a Poisson point process on circle of radius $$r>0$$ is a Poisson random variable with mean $$\lambda C$$, where $$C=2\pi r$$ is the circumference of the circle.  You just need to be able to need to produce (pseudo-)random numbers according to a Poisson distribution.

To generate Poisson variables in MATLAB,  use the poissrnd function with the argument $$\lambda C$$.  In Python, use either the scipy.stats.poisson or numpy.random.poisson function from the SciPy or NumPy libraries. (If you’re curious how Poisson simulation works, I suggest seeing this post for details on sampling Poisson random variables or, more accurately, variates.)

### Locations of points

For a homogeneous Poisson point process, we need to uniformly position points on the underlying space, which is this case is a circle. We will look at two different ways to position points uniformly on a circle. The first is arguably the most natural approach.

##### Method 1: Polar coordinates

We use polar coordinates due to the nature of the problem. To position all the points uniformly on a circle, we simple generate uniform numbers on the unit interval $$(0,1)$$. We then multiply these random numbers by $$2\pi$$.

We have generated polar coordinates for points uniformly located on the circle. To plot the points, we have to convert the coordinates back to Cartesian form by using the change of coordinates:  $$x=\rho\cos(\theta)$$ and $$y=\rho\sin(\theta)$$.

##### Method 2: Normal random variables

For each point, we generate two standard normal or Gaussian random variables, say, $$W_x$$ and $$W_y$$, which are independent of each other. (The term standard here means the normal random variables have mean $$\mu =0$$ and standard deviation $$\sigma=1$$.) These two random variables are the Cartesian components of a random point.  We then rescale the two values by the Euclidean norm, giving

$$X=\frac{W_x}{(W_x^2+W_y^2)^{1/2}},$$

$$Y=\frac{W_y}{(W_x^2+W_y^2)^{1/2}}.$$

These are the Cartesian coordinates of points uniformly scattered around a unit circle with centre at the origin. We multiply the two random values $$X$$ and $$Y$$ by the $$r>0$$  for a circle with radius $$r$$.

###### How does it work?

The procedure is somewhat like the Box-Muller transform in reverse. I’ll give an outline of the proof. The joint density of the random variables $$W_x$$ and $$W_y$$ is that of the bivariate normal distribution with zero correlation, meaning it has the joint density

$$f(x,y)=\frac{1}{2\pi}e^{[-(x^2+y^2)/2]}.$$

We see that the function $$f$$ is a constant when we trace around any line for which $$(x^2+y^2)$$ is a constant, which is simply the Cartesian equation for a circle (where the radius is the square root of the aforementioned constant). This means that the angle of the point $$(W_x, W_y)$$ will be uniformly distributed.

Now we just need to look at the distance of the random point. The vector formed from the pair of normal variables $$(W_x, W_y)$$ is a Rayleigh random variable.  We can see that the vector from the origin to the point $$(X,Y)$$ has length one, because we rescaled it with the Euclidean norm.

## Results

I have presented some results produced by code written in MATLAB and Python. The blue points are the Poisson points on the sphere. I have used a surface plot (with clear faces) in black to illustrate the underling sphere.

## Code

The code for all my posts is located online here. For this post, the code in MATLAB and Python is here.

I recommend this blog post, which discusses different methods for randomly placing points on spheres and inside spheres (or, rather, balls) in a uniform manner.  (Embedded in two dimensions, a sphere is a circle and a ball is a disk.) A key paper on using normal variables is the following:

• 1959, Muller, A note on a method for generating points uniformly on n-dimensional spheres.

As I mentioned in the post on the disk, the third edition of the classic book Stochastic Geometry and its Applications by Chiu, Stoyan, Kendall and Mecke details on page 54 how to uniformly place points on a disk.  It just requires a small modification for the circle.

## Cox point process

In previous posts I have often stressed the importance of the Poisson point process as a mathematical model. But it can be unsuitable for certain mathematical models.  We can generalize it by first considering a non-negative random measure, called a driving or directing measure. Then a Poisson point process, which is independent of the random driving measure, is generated by using the random measure as its intensity or mean measure. This doubly stochastic construction gives what is called a Cox point process.

In practice we don’t typically observe the driving measure. This means that it’s impossible to distinguish a Cox point process from a Poisson point process if there’s only one realization available. By conditioning on the random driving measure, we can use the properties of the Poisson point process to derive those of the resulting Cox point process.

By the way, Cox point processes are also known as doubly stochastic Poisson point processes. Guttorp and Thorarinsdottir argue that we should call them the Quenouille point processes, as Maurice Quenouille introduced an example of it before Sir David Cox. But I opt for the more common name.

In this post I’ll cover a couple examples of Cox point processes. But first I will need to give a more precise mathematical definition.

## Definition

We consider a point process defined on some underlying mathematical space $$\mathbb{S}$$, which is sometimes called the carrier space or state space.  The underlying space is often the real line $$\mathbb{R}$$, the plane $$\mathbb{R}^2$$, or some other familiar mathematical space like a square lattice.

For the first definition, we use the concept of a random measure.

Let $$M$$ be a non-negative random measure on $$\mathbb{S}$$. Then a point process $$\Phi$$ defined on some underlying space $$\mathbb{S}$$ is a Cox point process driven by the intensity measure $$M$$ if the conditional distribution of $$\Phi$$ is a Poisson point process with intensity function $$M$$.

We can give a slightly less general definition of a Cox  point process by using a random intensity function.

Let $$Z=\{Z(x):x\in\mathbb{S} \}$$ be a non-negative random field such that with probability one, $$x\rightarrow Z(x)$$ is a locally integrable function. Then a point process $$\Phi$$ defined on some underlying space $$\mathbb{S}$$ is a Cox point process driven by $$Z$$ if the conditional distribution of $$\Phi$$ is a Poisson point process with intensity function $$Z$$.

The random driving measure $$M$$ is then simply the integral
$$M(B)=\int_B Z(x)\, dx , \quad B\subseteq S.$$

## Over-dispersion

The random driving measures take different forms, giving different Cox point processes. But there is a general observation that can be made for all Cox point processes. For any region $$B \subseteq S$$, it can be shown that the number of points $$\Phi (B)$$ adheres to the inequality
$$\mathbb{Var} [\Phi (B)] \geq \mathbb{E} [\Phi (B)],$$

where $$\mathbb{Var} [\Phi (B)]$$ is the variance of the random variable $$\Phi (B)$$.  As a comparison, for a Poisson point process $$\Phi’$$, the variance of $$\Phi’ (B)$$ is simply $$\mathbb{Var} [\Phi’ (B)] =\mathbb{E} [\Phi’ (B)]$$.  Due to its greater variance, the Cox point process is said to be over-dispersed compared to the Poisson point process.

## Special cases

There is an virtually unlimited number of ways to define a random driving measure, where each one yields a different a Cox point process. But in general we are restricted by examining only tractable and interesting Cox point processes. I will give some common examples, but I stress that the Cox point process family is very large.

### Mixed Poisson point process

For the random driving measure $$M$$, an obvious example is the product form $$M= Y \mu$$, where $$Y$$ is some independent non-negative random variable and $$\mu$$ is the Lebesgue measure on $$\mathbb{S}$$. This driving measure gives the mixed Poisson point process. The random variable $$Y$$ is the only source of randomness.

### Log-Gaussian Cox point process

Instead of a random variable, we can use a non-negative random field to define a random driving measure.  We then have the product $$M= Y \mu$$, where $$Y$$ is now some independent non-negative random field. (A random field is a collection of random variables indexed by some set, which in this case is the underlying space $$\mathbb{S}$$.)

Arguably the most tractable and used random field is the Gaussian random field. This random field, like Gaussian or normal random variables, takes both negative and positive values. But if we define the random field such that its logarithm is a Gaussian field $$Z$$, then we obtain the non-negative random driving measure $$M=\mu e^Z$$, giving the log-Gaussian Cox point process.

This point process has found applications in spatial statistics.

### Cox-Poisson line-point process

To construct this Cox point process, we first consider a Poisson line process, which I discussed previously.  Given a Poisson line process, we then place an independent one-dimensional Poisson point process on each line. We then obtain an example of a Cox point process, which we could call a Cox line-point process orCox-Poisson line-point process. (But I am not sure of the best name.)

Researchers have recently used this point process to study wireless communication networks in cities, where the streets correspond to Poisson lines. For example, see these two preprints:

### Shot-noise Cox point process

We construct the next Cox point process by first considering a Poisson point process on the space $$\mathbb{S}$$ to create a shot noise term. (Shot noise is just the sum of some function over all the points of a point process.) We then use it as the driving measure of the Cox point process.

More specifically, we first introduce a kernel function $$k(\cdot,\cdot)$$ on $$\mathbb{S}$$, where $$k(x,\cdot)$$ is a probability density function for all points $$x\in \mathbb{S}$$. We then consider a Poisson point process $$\Phi’$$ on $$\mathbb{S}\times (0,\infty)$$. We assume the Poisson point process $$\Phi’$$ has a locally integrable intensity function $$\mu$$.

(We can interpret the point process $$\Phi’$$ as a spatially-dependent marked Poisson point process, where the unmarked Poisson point process is defined on $$\mathbb{S}$$. We then assume each point $$X$$ of this unmarked point process has a mark $$T \in (0,\infty)$$ with probability density $$\mu(X,t)$$.)

The resulting shot noise

$$Z(x)= \sum_{(Y,T)\in \Phi’} T \, k(Y,x)\,,$$

gives the random field. We then use it as the random intensity function to drive the shot-noise Cox point process.

In previous posts, I have detailed how to simulate non-Poisson point processes such as the Matérn and Thomas cluster point processes. These are examples of a Neyman-Scott point process, which is a special case of a shot noise Cox point process. All these point processes find applications in spatial statistics.

## Simulation

Unfortunately, there is no universal way to simulate all Cox point processes. (And even if there were one, it would not be the most optimal way for every Cox point process.) The simulation method depends on how the Cox point process is constructed, which usually means how its directing or driving measure is defined.

In previous posts I have presented ways (with code) to simulate the following Cox point processes:

In addition to the Matérn and Thomas point processes, there are ways to simulate more general shot noise Cox point processes. I will cover that in another post.

For general Cox point processes, I suggest the following: Chapter 6 in the monograph Poisson Processes by Kingman; Chapter 5 in Statistical Inference and Simulation for Spatial Point Processes by Møller and Waagepetersen; and Section 5.2 in Stochastic Geometry and its Applications by Chiu, Stoyan, Kendall and Mecke. For a much more mathematical treatment, see Chapter 13 in Lectures on the Poisson Process by Last and Penrose. Grandell wrote two detailed monographs titled Mixed Poisson Process and Doubly Stochastic Poisson Processes.

Motivated by applications in spatial statistics, Jesper Møller has (co)-written papers on specific Cox point processes. For example:

• 2001, Møller, Syversveen, and Waagepetersen, Log Gaussian Cox Processes;
• 2003, Møller, Shot noise Cox Processes;
• 2005, Møller and Torrisi,Generalised shot noise Cox processes.

I also suggest the survey article:

• 2003, Møller and Waagepetersen, Modern statistics for spatial point processes.

## Signal strengths of a wireless network

In two previous posts, here and here, I discussed the importance of the quantity called the signal-to-interference ratio, which is usually abbreviated as SIR, for studying communication in wireless networks. In everyday terms, for a listener to hear a certain speaker in a room full of people speaking, the ratio of the speaker’s volume to the sum of the volumes of everyone else heard by the listener. The SIR is the communication bottleneck for any receiver and transmitter pair in a wireless network.

But the strengths (or power values) of the signals are of course also important. In this post I will detail how we can model them using a a simple network model with a single observer.

### Propagation model

For a transmitter located at $$X_i\in \mathbb{R}^2$$, researchers usually attempt to represent the received power of the signal $$P_i$$ with a propagation model. Assuming the power is received at $$x\in \mathbb{R}^2$$, this mathematical model consists of a random and a deterministic component taking the general form
$$P_i(x)=F_i\,\ell(|X_i-x|) ,$$
where $$\ell(r)$$ is a non-negative function in $$r>0$$ and $$F_i$$ is a non-negative random variable.

The function $$\ell(r)$$ is called the pathloss function, and common choices include $$\ell(r)=(\kappa r)^{-\beta}$$ and $$\ell(r)=\kappa e^{-\beta r}$$, where $$\beta>0$$ and $$\kappa>0$$ are model constants.

The random variables $$F_i$$ represent signal phenomena such as multi-path fading and shadowing (also called shadow fading), caused by the signal interacting with the physical environment such as buildings. It is often called fading or shadowing variables.

We assume the transmitters locations $$X_1,\dots,X_n$$ are on the plane $$\mathbb{R}^2$$. Researchers typically assume they form a random point process or, more precisely, the realization of a random point process.

## From two dimensions to one dimension

For studying wireless networks, a popular technique is to consider a wireless network from the perspective of a single observer or user. Researchers then consider the incoming or received signals from the entire network at the location of this observer or user. They do this by considering the inverses of the signal strengths, namely

$$L_i(x): = \frac{1}{P_i}=\frac{1}{F_i \,\ell(|X_i-x|) }.$$

Mathematically, this random function is simply a mapping from the two-dimensional plane $$\mathbb{R}^2$$ to the one-dimensional non-negative real line $$\mathbb{R}_0^+=[0,\infty)$$.

If the transmitters are located according to a non-random point pattern or a random point process, this random mapping generates a random point process on the non-negative real line. The resulting one-dimensional point process of the values $$L_1,L_2,\dots,$$ has been called (independently) propagation (loss) process or path loss (with fading) process. More recently, my co-authors and I decided to call it a projection process, but of course the precise name doesn’t mattter

## Intensity measure of signal strengths

Assuming a continuous monotonic path loss function $$\ell$$ and the fading variables $$F_1, F_2\dots$$ are iid, if the transmitters form a stationary random point process with intensity $$\lambda$$, then the inverse signal strengths $$L_1,L_2,\dots$$ form a random point process on the non-negative real line with the intensity measure $$M$$.

$$M(t) =\lambda \pi \mathbb{E}( [\ell(t F)^{-1} ]^2)\,,$$

where $$\ell^{-1}$$ is the generalized inverse of the function $$\ell$$. This expression can be generalized for a non-stationary point process with general intensity measure $$\Lambda$$.

The inverses $$1/L_1,1/L_2,\dots$$, which are the signal strengths, forprocess with intensity measure

$$\bar{M}(s) =\lambda \pi \mathbb{E}( [\ell( F/s)^{-1} ]^2).$$

## Poisson transmitters gives Poisson signal strengths

Assuming a continuous monotonic path loss function $$\ell$$ and the fading variables $$F_1, F_2\dots$$ are iid, if the transmitters form a Poisson point process with intensity $$\lambda$$, then the inverse signal strengths $$L_1,L_2,\dots$$ form a Poisson point process on the non-negative real line with the intensity measure $$M$$.

If $$L_1,L_2,\dots$$ form a homogeneous Poisson point process, then the inverses $$1/L_1,1/L_2,\dots$$ will also form a Poisson point process with intensity measure $$\bar{M}(s) =\lambda \pi \mathbb{E}( [\ell( F/s)^{-1} ]^2).$$

## Propagation invariance

For $$\ell(r)=(\kappa r)^{-\beta}$$ , the expression for the intensity measure $$M$$ reduces to
$$M(t) = \lambda \pi t^{-2/\beta} \mathbb{E}( F^{-2/\beta})/\kappa^2.$$

What’s striking here is that information of the fading variable $$F$$ is captured simply by one moment $$\mathbb{E}( F^{-2/\beta})$$. This means that two different distributions will give the same results as long as this moment is matching. My co-authors and I have been called this observation propagation invariance.

## Some history

To study just the (inverse) signal strengths as a point process on the non-negative real line was a very useful insight. It was made independently in these two papers:

• 2008, Haenggi, A geometric interpretation of fading in wireless
networks: Theory and applications;
• 2010, Błaszczyszyn, Karray, and Klepper, Impact of the geometry, path-loss exponent and random shadowing on the mean interference factor in wireless cellular networks.

My co-authors and I presented a general expression for the intensity measure $$M$$ in the paper:

• 2018, Keeler, Ross and Xia, When do wireless network signals appear Poisson?.

This paper is also contains examples of various network models.

A good starting point on this topic is the Wikipedia article Stochastic geometry models of wireless networks. The paper that my co-authors and I wrote has details on the projection process.

With Bartek Błaszczyszyn, Sayan Mukherjee, and Martin Haenggi, I co-wrote a short monograph on SINR models called Stochastic Geometry Analysis of Cellular Networks, which is written at a slightly more advanced level. The book puts an emphasis on studying the point process formed from inverse signal strengths, we call the projection process.

## The Standard Model of wireless networks

In the previous post I discussed the signal-to-interference-plus ratio or SIR in wireless networks. If noise is included, then then signal-to-interference-plus-noise ratio or just SINR. But I will just write about SIR, as most results that hold for SIR, will also hold for SINR without any great mathematical difficulty.

The SIR is an important quantity due to reasons coming from information theory.  If you’re unfamiliar  with it, I suggest reading the previous post.

In this post, I will describe a very popular mathematical model of the SIR, which I like to call the standard model. (This is not a term used in the literature as I have borrowed it from physics.)

## Definition of SIR

To define the SIR, we consider a wireless network of $$n$$ transmitters with positions located at $$X_1,\dots,X_n$$ in some region of space. At some location $$x$$, we write $$P_i(x)$$ to denote the power value of a signal received at $$x$$ from transmitter  $$X_i$$. Then at location $$x$$, the SIR with respect to transmitter $$X_i$$ is
$$\text{SIR}(x,X_i) := \frac{P_i(x)}{\sum\limits_{j\neq i} P_j(x)} .$$

Researchers usually attempt to represent the received power of the signal $$P_i(x)$$ with a propagation model. This mathematical model  consists of a random and a deterministic component given by
$$P_i(x)=F_i\ell(|X_i-x|) ,$$
where $$\ell(r)$$ is a non-negative function in $$r\geq 0$$ and $$F_i$$ is a non-negative random variable. The function $$\ell(r)$$  is often called the path loss function. The random variables represent random fading or shadowing.

## Standard model

Based on the three model components of fading, path loss, and transmitter locations, there are many combinations possible. That said, researchers generally (I would guess, say, 90 percent or more) use a single combination, which I call the standard model.

The three standard model assumptions are:

1. Singular power law path loss $$\ell(r)=(\kappa r)^{-\beta}$$.
2. Exponential distribution for fading variables, which are independent and identically distributed (iid).
3. Poisson point process for transmitter locations.

Why these three? Well, in short, because they work very well together. Incredibly, it’s sometimes possible to get relatively a simple  mathematical expression for, say, the coverage probability $$\mathbb{P}[\text{SIR}(x,X_i)>\tau ]$$, where $$\tau>0$$.

I’ll now detail the reasons more specifically.

### Path loss

The $$\ell(r)=(\kappa r)^{-\beta}$$ is very simple, despite having a singularity at $$r=0$$. This allows simple algebraic manipulation of equations.

Some, such as myself, are initially skeptical of this function as it gives an infinitely strong signal at the transmitter due to the singularity in the function $$\ell(r)=(\kappa r)^{-\beta}$$. More specifically, the path loss of the signal from transmitter $$X_i$$ approaches infinity as $$x$$ approaches $$X_i$$ .

But apparently, overall, the singularity does not have a significant impact on most mathematical results, at least qualitatively. That said, one still observe consequences of this somewhat physically unrealistic model assumption. And I strongly doubt enough care is taken by researchers to observe and note this.

Interestingly, the original reason why exponential variables were used is because it allowed the SIR problem to be reformulated into a problem of a Laplace transform of a random variable, which for a random variable $$Y$$ is defined as

$$\mathcal{L}_Y(t)=\mathbb{E}(e^{- Y t}) \, .$$

where $$t\geq 0$$. (This is essentially the moment-generating function with $$-t$$ instead of $$t$$.)

The reason for this connection is that the tail distribution of an exponential variable $$F$$ with mean $$\mu$$  is simply $$\mathbb{P}(F>t)= e^{-t/\mu}$$.  In short, with the exponential assumption, various conditioning arguments eventually lead to Laplace transforms of random variables.

### Transmitters locations

No prizes for guessing that researcher overwhelmingly use a (homogeneous) Poisson point process for the transmitter (or receiver) locations. When developing mathematical models with point processes, if you can’t get any results with the Poisson point process, then abandon all hope.

It’s the easier to work with this point process due to its independence property, which leads to another useful property. For Poisson point process, the Palm distribution is known, which is the distribution of a point process conditioned on a point (or collection of points) existing in a specific location of the underlying space on which the point process is defined.  In general, the Palm distribution is not known for many point processes.

## Random propagation effects can lead to Poisson

A lesser known reason why researchers would use the Poisson point process is that, from the perspective of a single observer in the network, it can be used to capture the randomness in the signal strengths.  Poisson approximation results in probability imply that randomly perturbing the signal strengths can make signals appear more Poisson, by which I mean  the signal strengths behave stochastically or statistically as though they were created by a Poisson network of transmitters.

The end result is that a non-Poisson network can appear more Poisson, even if the transmitters do not resemble (the realization of) a Poisson point process. The source of randomness that makes a non-Poisson network appear more Poisson is the random propagation effects of fading, shadowing, randomly varying antenna gains, and so on, or some combination of these.

A good starting point on this topic is the Wikipedia article Stochastic geometry models of wireless networks. This paper is also good:

• 2009, Haenggi, Andrews, Baccelli, Dousse, Franceschetti, Stochastic Geometry and Random Graphs for the Analysis and Design of Wireless Networks.

This paper by my co-authors and I has some details on standard model and why a general network model behaving Poisson in terms of the signal strengths:

• 2018, Keeler, Ross and Xia, When do wireless network signals appear Poisson?.

Early books on the subject include the two-volume textbooks Stochastic Geometry and Wireless Networks by François Baccelli and Bartek Błaszczyszyn, where the first volume is on theory and the second volume is on applications.  Martin Haenggi wrote a very readable introductory book called Stochastic Geometry for Wireless networks.

Finally, I co-wrote with Bartek Błaszczyszyn, Sayan Mukherjee, and Martin Haenggi a short monograph on SINR models called Stochastic Geometry Analysis of Cellular Networks, which is written at a slightly more advanced level. This book has a section on why signal strengths appear Poisson.

## Signal-to-interference ratio in wireless networks

The fundamentals of information theory say that to successfully communicate across any potential communication link the signal strength of the communication must be stronger than that of the back ground noise, which leads to the fundamental quantity known as signal-to-noise ratio. Information theory holds in very general (or, in mathematical speak, abstract) settings. The communication could be, for example, a phone call on an old wired landline, two people talking in a bar, or a hand-written letter, for which the respective signals in these examples are the electrical current, speaker’s voice, and the writing. (Respective examples of noise could be, for example, thermal noise in the wires, loud music, or coffee stains on the letter.)

In wireless networks, it’s possible for a receiver to simultaneously detect signals from multiple transmitters, but the receiver typically only wants to receive one signal. The other unwanted or interfering signals form a type of noise, which is usually called interference, and the other (interfering) transmitters are called interferers. Consequently, researchers working on wireless networks study the signal-to-interference ratio, which is usually abbreviated as SIR. Another name for the SIR is carrier-to-interference ratio.

If we also include background noise, which is coming not from the interferers, then the quantity becomes the signal-to-interference-plus-noise ratio or just SINR. But I will just write about SIR, though jumping from SIR to SINR is usually not difficult mathematically.

The concept of SIR makes successful communication more difficult to model and predict, as it just doesn’t depend on the distance of the communication link. Putting the concept in everyday terms, for a listener to hear a certain speaker in a room full of people all speaking to the listener, it is not simply the distance to the speaker, but rather the ratio of the speaker’s volume to the sum of the volumes of everyone else heard by the listener. The SIR is the communication bottleneck for any receiver and transmitter pair in a wireless network.

In wireless network research, much work has been done to examine and understand communication success in terms of interference and SIR, which has led to a popular mathematical model that incorporates how signals propagate and the locations of transmitters and receivers.

## Definition

To define the SIR, we consider a wireless network of transmitters with positions located at $$X_1,\dots,X_n$$ in some region of space. At some location $$x$$, we write $$P_i(x)$$ to denote the power value of a signal received at $$x$$ from transmitter $$X_i$$. Then at location $$x$$, the SIR with respect to transmitter $$X_i$$ is
$$\text{SIR}(x,X_i) :=\frac{P_i(x)}{\sum\limits_{j\neq i} P_j(x)} =\frac{P_i(x)}{\sum\limits_{j=1}^{n} P_j(x)-P_i(x)} .$$

The numerator is the signal and the denominator is the interference.  This ratio tells us that increasing the number of transmitters $$n$$ decreases the original SIR values. But then, in exchange, there is a greater number of transmitters for the receiver to connect to, some of which may have larger $$P_i(x)$$ values and, subsequently, SIR values. This delicate trade-off makes it challenging and interesting to mathematically analyze and design networks that deliver high SIR values.

Researchers usually assume that the SIR is random. A quantity of interest is the tail distribution of the SIR, namely

$$\mathbb{P}[\text{SIR}(x,X_i)>\tau ] := \frac{P_i(x)}{\sum\limits_{j\neq i} P_j(x)} \,,$$

where $$\tau>0$$ is some parameter, sometimes called the SIR threshold. For a given value of $$\tau$$, the probability $$\mathbb{P}[\text{SIR}(x,X_i)>\tau]$$ is sometimes called the coverage probability, which is simply the probability that a signal coming from $$X_i$$ can be received successfully at location $$x$$.

## Mathematical models

### Propagation

Researchers usually attempt to represent the received power of the signal $$P_i(x)$$ with a propagation model. This mathematical model consists of a random and a deterministic component taking the general form
$$P_i(x)=F_i\ell(|X_i-x|) ,$$
where $$F_i$$ is a non-negative random variable and $$\ell(r)$$ is a non-negative function in $$r \geq 0$$.

##### Path loss

The function $$\ell(r)$$ is called the path loss function, and common choices include $$\ell(r)=(\kappa r)^{-\beta}$$ and $$\ell(r)=\kappa e^{-\beta r}$$, where $$\beta>0$$ and $$\kappa>0$$ are model constants, which need to be fitted to (or estimated with) real world data.

Researchers generally assume that the so-called path loss function $$\ell(r)$$ is decreasing in $$r$$, but actual path loss (that is, the change in signal strength over a path travelled) typically increases with distance $$r$$. Researchers originally assumed path loss functions to be increasing, not decreasing, giving the alternative (but equivalent) propagation model
$$P_i(x)= F_i/\ell(|X_i-x|).$$

But nowadays researchers assume that the function $$\ell(r)$$ is decreasing in $$r$$. (Although, based on personal experience, there is still some disagreement on the convention.)

With the random variable $$F_i$$, researchers seek to represent signal phenomena such as multi-path fading and shadowing (also called shadow fading), caused by the signal interacting with the physical environment such as buildings. These variables are often called fading or shadowing variables, depending on what physical phenomena they are representing.

Typical distributions for fading variables include the exponential and gamma distributions, while the log-normal distribution is usually used for shadowing. The entire collection of fading or shadowing variables is nearly always assumed to be independent and identically distributed (iid), but very occasionally random fields are used to include a degree of statistical dependence between variables.

### Transmitters locations

In general, we assume the transmitters locations $$X_1,\dots,X_n$$ are on the plane $$\mathbb{R}^2$$. To model interference, researchers initially proposed non-random models, but they were considered inaccurate and intractable. Now researchers typically use random point processes or, more precisely, the realizations of random point processes for the transmitter locations.

Not surprisingly, the first natural choice is the Poisson point process. Other point processes have been used such as Matérn and Thomas cluster point processes, and Matérn hard-core point processes, as well as determinantal point processes, which I’ll discuss in another post.

## Some history

Early random models of wireless networks go back to the 60s and 70s, but these were based simply on geometry: meaning a transmitter could communicate successfully to a receiver if they were closer than some fixed distance. Edgar Gilbert created the field of continuum percolation with this significant paper:

• 1961, Gilbert, Random plane networks.

Interest in random geometrical models of wireless networks continued into the 70s and 80s. But there was no SIR in these models.

Motivated by understanding SIR, researchers in the late 1990s and early 2000s started tackling SIR problems by using a random model based on techniques from stochastic geometry and point processes. Early papers include:

• 1997, Baccelli, Klein, Lebourges ,and Zuyev, Stochastic geometry and architecture of communication networks;
• 2003, Baccelli and Błaszczyszyn , On a coverage process ranging from the Boolean model to the Poisson Voronoi tessellation, with applications to wireless communications;
• 2006, Baccelli, Mühlethaler, and Błaszczyszyn, An Aloha protocol for multihop mobile wireless networks.

But they didn’t know that some of their results had already been discovered independently by researchers working on wireless networks in the early 1990s. These papers include:

• 1994, Pupolin and Zorzi, Outage probability in multiple access packet radio networks in the presence of fading;
• 1990, Sousa and Silvester, Optimum transmission ranges in a direct-sequence spread-spectrum multihop packet radio network.

The early work focused more on small-scale networks like wireless ad hoc networks. Then the focus shifted dramatically to mobile or cellular phone networks with the publication of the paper:

• 2011, Andrews, Baccelli, Ganti, A tractable approach to coverage and rate in cellular networks.

It’s can be said with confidence that this paper inspired much of the interest in using point processes to develop models of wireless networks. The work generally considers the SINR in the downlink channel for which the incoming signals originate from the phone base stations.

A good starting point on this topic is the Wikipedia article Stochastic geometry models of wireless networks. This paper is also good:

• 2009, Haenggi, Andrews, Baccelli, Dousse, Franceschetti, Stochastic Geometry and Random Graphs for the Analysis and Design of Wireless Networks.

Early books on the subject include the two-volume textbooks Stochastic Geometry and Wireless Networks by François Baccelli and Bartek Błaszczyszyn, where the first volume is on theory and the second volume is on applications.  Martin Haenggi wrote a very readable introductory book called Stochastic Geometry for Wireless networks.

Finally, Bartek Błaszczyszyn, Sayan Mukherjee, Martin Haenggi, and I wrote a short book on SINR models called Stochastic Geometry Analysis of Cellular Networks, which is written at a slightly more advanced level. The book put an emphasis on studying the point process formed from inverse signal strengths, we call the projection process.

## Simulating Matérn hard-core point processes

If you wanted to create a point process with repulsion, a reasonable first attempt would be to build off a Poisson point process by removing points according to some rule to ensure that no two points were within a certain distance of each other. Using this natural idea, Bertril Matérn proposed a family of repulsive point processes called Matérn hard-core point processes.

More specifically, Matérn proposed several points processes, including two types of hard-core point processes now called Type I and Type II. (Matérn proposed a third type, called Type III, but it’s considerably harder to simulate on a computer, as detailed in this article.) These types of hard-core point processes are completely different to the Matérn cluster point process.

As I discussed in a previous post, the Poisson point process may not be adequate for representing point phenomena whose points exhibit large degrees of repulsion or clustering. I already covered the Matérn and Thomas cluster point processes, which show distinct clustering in their configurations. In this post, I’ll cover Matérn hard-core point processes. The Type I point processes is the easier of the two, so I’ll start with that one.

## Overview

Simulating Matérn hard-core point processes requires first simulating a homogeneous Poisson point process with an intensity $$\lambda>0$$ on some simulation window, such as a rectangle, which is the simulation window I will use here. I have already written about simulating the homogeneous Poisson point processes on a rectangle and a disk, so those posts are good starting points.

Given the Poisson point process, the points then need to be thinned in such a manner to ensure that for each point, there is no other point within some fixed $$r>0$$ of the point. This distance $$r>0$$ is the radius of the hard core of each point.

I have already covered the point process operation of thinning. But it’s important to note here that in this construction a dependent thinning is being applied. (If I just applied an independent thinning, then the resulting point process will be another Poisson point process with no repulsion between points.)

## Edge effects

The main trick behind sampling this point process is that it’s possible for points inside the simulation window to be thinned due to their closeness to points that are located outside the simulation window. In other words, points outside the simulation window can cause points inside the window to be thinned. (I discussed a very similar issue in the posts on the Matérn and Thomas cluster point processes.)

To remove these edge effects, the underlying Poisson point process must be simulated on an extended version of the simulation window. The points are then thinned according to a dependent thinning, which is covered in the next section. Then only the retained points inside the simulation window are kept and the remaining points are ignored. Consequently, the underling Poisson points are simulated on an extended window, but we only see the final points inside the simulation window.

To create the extended simulation window, we add a strip of width $$r$$ all around the simulation window. Why? Well, the distance $$r$$ is the maximum distance from the simulation window that another point (outside the simulation window) can exist, while still causing points inside the simulation window to be thinned. This means it is impossible for a hypothetical point beyond this distance (outside the extended window) to cause a point inside the simulation window to be thinned.

## Dependent thinning rules

##### Type I

For each point inside the simulation window, check if there are any other points (including those in the extended window) within distance $$r$$ of the point. If no, then keep the point. If yes, then remove the point and the points that are within distance $$r$$ of the point. The remaining points inside the simulation window form a Matérn Type I point process.

This is a relatively simple thinning rule, which only requires calculating all the inter-point distances. But it is also a very strong thinning rule, meaning that it removes many points. Depending on the Poisson point process intensity $$\lambda$$ and core radius $$r$$, it is quite possible that all the points are removed, resulting in an empty configuration.

Now we examine the case when the thinning rule is not as strong.

##### Type II

To create Matérn Type II point process, we assign an independent uniform random variable to each point of the underlying Poisson point process defined on the extended window. In point process terminology, these random variables are called marks, resulting in a marked point process. In the the context of the Matérn Type II point process, these random random marks are usually called ages.

Then for each point in the simulation window, we consider all the points within distance $$r$$ of the point. If this point is the youngest (or, equivalently, the oldest) point, then the point is kept. In other words, the point is only kept if its random mark is smaller (or larger) than the random marks of all the other points within distance $$r$$ of the point. The remaining points inside the simulation window form a Matérn Type II point process.

## Intensity expressions

Using point process and probability theory, one can derive mathematical expressions for the intensities (that is, the average density of points per unit area). These closed-form expressions can then be used to check that the correct number of points are being generated on average over many simulations.

##### Type I

The intensity of the Type I point process is given by

$\mu_1=\lambda e^{-\lambda \pi r^2},$

where $$\lambda \pi r^2$$ is simply the area of the core.

##### Type II

The intensity of the Type II point process is given by

$\mu_2=\frac{1}{\pi r^2}(1-e^{-\lambda \pi r^2}),$

which can be written with the intensity of the the Type I point process as

$\mu_2=\frac{1}{\pi r^2}(1-\frac{\mu_1}{\lambda}).$

## Code

I wrote the sampling code in MATLAB and Python, which are, as usual, very similar to each other. The code, which is is located here, simulates both Type I and II Matérn points processes. It also compares the empirical intensity to the the values given by the mathematical expressions in the previous section.

##### MATLAB

The MATLAB code is here.

##### Python

The Python code is here.

## Results

I have plotted single realizations of the Matern Type I and II point processes, as well as the underlying Poisson point process in the same window.

##### Python

Matérn hard-core point processes are covered in standard books on the related fields of spatial statistics, point processes and stochastic geometry, such as the following: Spatial Point Patterns: Methodology and Applications with R by Baddeley, Rubak and Turner, on page 140; Statistical Analysis and Modelling of Spatial Point Patterns Statistics by Illian, Penttinen, Stoyan, amd Stoyan, Section 6.5.2, starting on page 388; and; Stochastic Geometry and its Applications by Chiu, Stoyan, Kendall and Mecke, Section 5.4, starting on page 176. The first two books are particularly good for beginners.

The aforementioned book Spatial Point Patterns: Methodology and Applications with R is written by spatial statistics experts Baddeley, Rubak and Turner. It covers the spatial statistics (and point process simulation) R-package spatstat., which has the functions rMaternI and rMaternII for simulating the two point processes respectively.

## Simulating Poisson point processes faster

As an experiment, I tried to write code for simulating many realizations of a homogeneous Poisson point process in a very fast fashion. My idea was to simulate all the realizations in two short steps.

In reality, the findings of this experiment and the contents of this post have little practical value, as computers are so fast at generating Poisson point processes. Still, it was an interesting task, which taught me a couple of things. And I did produce faster code.

### MATLAB

I first tried this experiment in MATLAB.

##### Vectorization

In languages like MATLAB, the trick for speed is to use vectorization, which means applying a single operation to an entire vector or matrix (or array) without using an explicit for-loop. Over the years, the people behind MATLAB has advised to use vectorization instead of for-loops, as for-loops considerably slowed down MATLAB code. (But, as as time goes by, it seems using for-loops in MATLAB doesn’t slow the code down as much as it used to.)

Simulating Poisson point processes is particularly amenable to vectorization, due to the independent nature of the point process. One can simulate the number of points in each realization for all realizations in one step. Then all the points across all realizations can also be positioned in one step. In the two-dimensional case, this results in two one-dimensional arrays (or vectors, in MATLAB parlance) for the $$x$$ and $$y$$ coordinates.  (Of course, in my code, I could have used just one two-dimensional array/vector  for the coordinates of the points, but I didn’t.)

After generating the points, the coordinates of the points need to be grouped into the different realizations and stored in appropriate data structures.

##### Data structures

The problem with storing point processes is that usually each realization has a different number of points, so more sophisticated data structures than regular arrays are needed. For MATLAB, each point process realization can be stored in a data object called a cell array.  For a structure array, it’s possible for each element (that is, structure) to be a different size, making them ideal for storing objects like point processes with randomly varying sizes.

In the case of two-dimensional point processes, two cell arrays  can be used to store the $$x$$ and $$y$$ coordinates of all the point process realizations. After randomly positioning all the points, they can be grouped into a cell array, where each cell array element represents a realization of the Poisson point process, by using the inbuilt function MATLAB mat2cell, which converts a matrix (or array) into a cell array.

Alternatively, we could use another MATLAB data object called a structure array. In MATLAB structures have fields, which can be, for example for a point process can be the locations of the points. Given cell arrays of equal size, we can convert them into a single structure array by using the inbuilt MATLAB function struct.

### Python

After successfully simulating Poisson point processes in MATLAB, I tried it in Python with the NumPy library.

##### Vectorization

I basically replicated what I did in MATLB using Python by positioning all the points in a single step. This gives two one-dimensional NumPy arrays for the $$x$$ and $$y$$ coordinates of all the point process realizations. (Again, I could have instead stored the coordinates as a single two-dimensional array, but I didn’t.)

Perhaps surprisingly, the vectorization step doesn’t speed things up much in Python with the NumPy library. This may be due to the fact that the underlying code is actually written in the C language.  That motivated me to see what methods have been implemented for simulating Poisson variables, which is the topic of the next couple posts.

##### Data structures

In Python, the data structure  known as a list is the natural choice. Similarly to cell arrays in MATLAB, two lists can be used for the $$x$$ and $$y$$ coordinates of all the points. Instead of MATLAB’s function mat2cell, I used the NumPy function numpy.split to create two lists from the two NumPy arrays containing the point coordinates.

Python does not seem to have an immediate equivalent to structure arrays in MATLAB. But in Python one can define a new data structure or class with fields, like a structure. Then one can create a list of those data structures with fields, which are called attribute references in Python.

### Code

The code in MATLAB and Python can be found here. For a comparison, I also generated the same number of point process realizations (without using vectorization) by using a trusty for-loop. The code compares the times of taken for implemented the two different approaches, labelled internally as Method A and Method B. There is a some time difference in the MATLAB code, but not much of a difference in the Python case.

I have commented out the sections that create data structures (with fields or attribute references) for storing all the point process realizations, but those sections should also work when uncommented.

## Simulating a Cox point process based on a Poisson line process

In the previous post, I described how to simulate a Poisson line process, which in turn was done by using insight from an earlier post on the Bertrand paradox.

Now, given a Poisson line process, for each line, if we generate an independent one-dimensional Poisson point point process on each line, then we obtain an example of a Cox point process. Cox point processes are also known as doubly stochastic Poisson point processes. On the topic of names, Guttorp and Thorarinsdottir argue that it should be called the Quenouille point process, as Maurice Quenouille introduced an example of it before Sir David Cox, but I opt for the more common name.

## Cox point proceesses

A Cox point process is a generalization of a Poisson point process. It is created by first considering a non-negative random measure, sometimes called a driving measure. Then a Poisson point process, which is independent of the random driving measure, is generated by using the random measure as its intensity or mean measure.

The driving measure of a Cox point process can be, for example, a non-negative random variable or field multiplied by a Lebesgue measure. In our case, the random measure is the underlying Poisson line process coupled with the Lebesgue measure on the line (that is, length).

Cox processes form a very large and general family of point processes, which exhibit clustering. In previous posts, I have covered two special cases of Cox point processes: the Matérn and Thomas cluster point processes. These are, more specifically, examples of a Neyman-Scott point process, which is a special case of a shot noise Cox point process. These two point processes are fairly easy to simulate, but that’s not the case for Cox point processes in general. Some are considerably easier than others.

## Motivation

I will focus on simulating the Cox point process formed from a Poisson line process with homogeneous Poisson point processes. I do this for two reasons. First, it’s easy to simulate, given we can simulate a Poisson line process. Second, it has been used and studied recently in the mathematics and engineering literature for investigating wireless communication networks in cities, where the streets correspond to Poisson lines; for example, see these two preprints:

Incidentally, I don’t know what to call this particular Cox point process. A Cox line-point process? A Cox-Poisson line-point process? But it doesn’t matter for simulation purposes.

## Method

We will simulate the Cox (-Poisson line-) point process on a disk. Why a disk? I suggest reading the previous posts on the Poisson line process the Bertrand paradox for why the disk is a natural simulation window for line processes.

Provided we can simulate a Poisson line process, the simulation method is quite straightforward, as I have essentially already described it.

##### Line process

First simulate a Poisson line process on a disk. We recall that for each line of the line process, we need to generate two independent random variables $$\Theta$$ and $$P$$ describing the position of the line. The first random variable $$\Theta$$ gives the line orientation, and it is a uniform random variable on the interval $$(0,2\pi)$$.

The second random variables $$P$$ gives the distance from the origin to the disk edge, and it is a uniform random variable on the interval $$(0,r)$$, where $$r$$ is the radius of the disk. The distance from the point $$(\Theta, P)$$ to the disk edge (that is, the circle) along the chord is:

$$Q=\sqrt{r^2-P^2}.$$

The endpoints of the chord (that is, the points on the disk edge) are then:

Point 1: $$X_1=P \cos \Theta+ Q\sin \Theta$$, $$Y_1= P \sin \Theta- Q\cos \Theta$$,

Point 2: $$X_2=P \cos \Theta- Q\sin \Theta$$, $$Y_2= P \sin \Theta+Q \cos \Theta$$.

The length of the line segment is $$2 Q$$. We can say this random line is described by the point $$(\Theta,P)$$.

##### One-dimensional Poisson point process

For each line (segment) in the line process, simulate a one-dimensional Poisson point process on it. Although I have never discussed how to simulate a one-dimensional (homogeneous) Poisson point process, it’s essentially one dimension less than simulating a homogeneous Poisson point process on a rectangle.

More specifically, given a line segment $$(\Theta,P)=(\theta,p)$$, you simulate a homogeneous Poisson point process with intensity $$\mu$$ on a line segment with length $$2 q$$, where $$q=\sqrt{r^2-p^2}$$. (I am now using lowercase letters to stress that the line is no longer random.) To simulate the homogeneous Poisson point process, you generate a Poisson random variable with parameter $$2 \mu q$$.

Now you need to place the points uniformly on the line segment. To do this, consider a single point on a single line. For this point, generate a single uniform variable $$U$$ on the interval $$(-1,1)$$. The tricky part is now getting the Cartesian coordinates right. But the above expressions for the endpoints suggest that the single random point has the Cartesian coordinates:

$$x=p \cos \theta+ U q\sin \theta$$, $$y=p \sin \theta- U q\cos \theta$$.

The two extreme cases of the uniform random variable $$U$$ (that is, $$U=-1$$ and $$U=1$$) correspond to the two endpoints of the line segment. We recall that $$Q$$ is the distance from the midpoint of the line segment to the disk edge along the line segment, so it makes sense that we want to vary this distance uniformly in order to uniformly place a point on the line segment. This uniform placement step is done for all the points of the homogeneous Point process on that line segment.

You repeat this procedure for every line segment. And that’s it: a Cox point process built upon a Poisson line process.

## Code

As always, the code from all my posts is online. For this post, I have written the code in MATLAB, R and Python.