# What's so Poisson about a Poisson Point Process? (or, can I generate one using random ordered pairs?)

I know there is an R spatstat function to generate a ppp (Poisson Point Process), but I'm working in python, and I am not clear what spatstat.ppp is doing behind the scenes.

If I generate a an array of ordered pairs of random x's and random y's (within the spatial extent), will that be (or how will it differ from) a ppp? Should the x's and y's be chosen based on a Poisson distribution (np.random.poisson)?

I've read the spatstat documentation on ppp and the wikipedia pages on Poisson point process and Poisson distribution, but I just have no knack for statistics. Is it the number of events that is random? Or where they fall in space?

(ps -- this problem is entirely spatial, there is no time dimension.)

• I don't see a spatstat function in R. There's a package called "spatstat". It seems to have a function called ppp (spatstat::ppp), though (and a class called ppp). What other functions are you calling? Have you checked the spatstat vignettes or the code? – Glen_b Feb 5 '14 at 0:19
• Sorry, my bad grammar, using spatstat as an adjective. I meant it in the way one would say an R function. I guess I have read the vignette; how can one see the code? – J Kelly Feb 5 '14 at 3:12
• stackoverflow.com/search?q=[r]+see+source+code -- several different ways for different things (it's a bit different for S3 and S4 classes for example); plus anything on CRAN should have the actual source code it was built from. Actually, here you go, I just went and found the tarball – Glen_b Feb 5 '14 at 4:19
• Wow, thanks, that is going to be interesting reading. I looked at ppp.R and it seems to have no random component at all. It seems to take any set of x,y you want to give it, even a perfectly regular grid. So why "Poisson"? <shrug> Maybe it doesn't matter how my random points are distributed. – J Kelly Feb 5 '14 at 18:58
• I gather the point is that it's not simulation or any other form of creating data at all. It doesn't ever consider whether the data is Poisson. Its purpose is simply to take point-pattern data (however obtained) and turn it into a ppp-object (on which other functions in spatstat can then operate). It's no more responsible for what data you give it than data.frame is, and its purpose is analogous to a call to data.frame or any other function to turn data into an object of a particular class. – Glen_b Feb 5 '14 at 23:23

The number of points in any given region is Poisson distributed, with mean equal to the integral of the rate function over that region. For example, if you have a homogeneous PP on the unit square, with rate function $\lambda(x,y)=\lambda$ (i.e. constant because it's homogeneous) then you could sample points as
1. Sample $N \sim Poisson(\lambda)$
2. Sample $N$ points uniformly on the unit square, i.e. $x,y \sim^{iid} U[0,1]$