Point processes are mathematical objects that can represent a collection of randomly located points on some underlying space. There is a rich range of these random objects, and, depending on the type of points process, there are various steps and methods used to *sample*, *simulate* or *generate* them on computers. (I use these three terms somewhat interchangeably.) This is the first of a series of posts in which I will describe how to simulate some of the more tractable point processes defined on bounded regions of two-dimensional Euclidean space.

## Finite point processes

A general family of tractable point processes are the *finite point processes*, which are, as the name suggests, simply point processes with the property that the total number of points is finite with probability one. Usually it is assumed that both the number of points and the positions of these points are random. These two properties give a natural way to describe and to study point processes mathematically, while also giving an intuitive way to simulate them on computers.

If the number and locations of points can be simulated sequentially, such that the number of points is naturally generated first followed by the placing of the points, then the simulation process is usually easier. Such a point process is a good place to start for an example.

## Simple example — Binomial point process

The binomial point process is arguably the simplest point process. The number of points is non-random number , so we do not need to generate it as it is given. For a Binomial point process, the points are uniformly and independently located in some bounded region. This means that all the points can be positioned in parallel.

For example, to simulate points of a Binomial point process on the unit square , we just need to independently sample the and coordinates of the points from a uniform distribution on the unit interval . In other words, we randomly generate or sample two sets of uniform random variables corresponding to the and of the points.

To sample on a general rectangle, we just need need to multiple the random and values by the respective dimensions of the rectangle and . Of course the rectangle can also be shifted up or down by adding or subtracting and values appropriately.

Essentially every language has a function for generating uniform random numbers because it is the default random number generator, which all the other random number generators build off, by employing various techniques like applying transformations. In MATLAB, R and Python, it is respectively rand, runif and scipy.stats.uniform, which all generate uniform points on the open interval .

## Code

Here are samples of code that illustrates how to simulate a binomial point process on the unit square.

**MATLAB**

n=10; %number of points %Simulate binomial point process xx=rand(n,1);%x coordinates of binomial points yy=rand(n,1);%y coordinates of binomial points %Plotting scatter(xx,yy); xlabel('x');ylabel('y');

**R**

n=10; #number of points #Simulate Binomial point process xx=runif(n);#x coordinates of binomial points yy=runif(n);#y coordinates of binomial points #Plotting plot(xx,yy,'p',xlab='x',ylab='y',col='blue');

**Python**

import numpy as np import scipy import matplotlib.pyplot as plt n=10; #number of points #Simulate binomial point process xx = scipy.stats.uniform.rvs(0,1,((n,1)))#x coordinates of binomial points yy = scipy.stats.uniform.rvs(0,1,((n,1)))#y coordinates of binomial points #Plotting plt.scatter(xx,yy, edgecolor='b', facecolor='none', alpha=0.5 ) plt.xlabel("x");plt.ylabel("y")

## More complicated point processes

The binomial point process is very simple. One way to have a more complicated point process is to have a random number of points. The binomial point process is obtained from conditioning on the number of points of a homogeneous Poisson point process, implying its simulation builds directly off the binomial point process. The homogeneous Poisson point process is arguably the most used point process, and it is then in turned used to construct even more complicated points processes. This suggests that the homogeneous Poisson point process is the next point process we should try to simulate.

## Further reading

For simulation of point processes, see, for example, the books *Statistical Inference and Simulation for Spatial Point Processes* by Møller and Waagepetersen, or *Stochastic Geometry and its Applications* by Chiu, Stoyan, Kendall and Mecke. There are books written by spatial statistics experts such as *Stochastic Simulation* by Ripley and *Spatial Point Patterns: Methodology and Applications with R* by Baddeley, Rubak and Turner, where the second book covers the spatial statistics R-package spatstat. Kroese and Botev also have a good introduction in the edited collection *Stochastic Geometry, Spatial Statistics and Random **Fields : Models and Algorithms* by Schmidt, where the relevant chapter (number 12) is also freely available online. More general stochastic simulation books that cover relevant material include *Uniform Random Variate Generation *by Devroye and *Stochastic Simulation: Algorithms and Analysis* by Asmussen and Glynn.

For a mathematical introduction to finite point processes, see the standard reference *An Introduction to the Theory of Point Processes Volume* by Daley and Vere-Jones (Chapter 5 in either the first edition or the first volume of the second two-volume edition). Finite point processes are also covered in a recent tutorial on Palm calculus and Gibbs point processes.