# Simulating NHPP in R

Homogeneous Poisson process (HPP) is easy to simulate in ** R** as there are standard functions built in to the language. Simulating Non-Homogeneous Poisson process(NHPP) take a little bit of effort. There are many algorithms out there and I guess the best amongst them is based on “thinning”. The math behind thinning is explained in the paper,”Simulation of NonHomogeneous Poisson Process by Thinning”. The paper, while explaining the method, also gives a laundry list of methods that can be used to simulate NHPP.

The following document contains some basic math and ** R** code to simulate one dimensional and two dimensional NHPP based on the methods described in the paper by Lewis & Shedler. I have used some simple rate functions, i.e linear rate and seasonal rate functions, in the simulation exercise.