The Poisson process N(t) is a counting process used to describe the occurrence of events in a time interval of length t. It satisfies the following conditions:
- N(0) = 0
- Increments are independents
- The number of occurrences in any interval of length t follows a Poisson(λ.t) distribution with λ>0 a fixed parameter
The waiting time between two consecutive events occurring in a Poisson process is exponentially distributed with parameter λ.
The average waiting time between two consecutive events is 1 / λ.
The Python code is available below.
Presentation
To Go Further
The Merton Jump Diffusion Model (link)
Save 10% on All Quant Next Courses with the Coupon Code: QuantNextBlog10
For students and graduates: We offer a 50% discount on all courses, please contact us if you are interested: contact@quant-next.com
Python Code
import numpy as np
plt.style.use('ggplot')
import matplotlib.pyplot as plt
#Simulation of a Poisson process
def poisson_process(rate, time):
t = 0
event_count = 0
event_times = []
event_times.append(0)
while t < time:
t = t + np.random.exponential(1/rate)
if t < time:
event_count += 1
event_times.append(t)
return event_count, event_times
#Plot Poisson Process
def plot_poisson_process(rate, time):
event_count, event_times = poisson_process(rate, time)
plt.figure(figsize=(10, 5))
plt.step(event_times, range(0, event_count + 1), where='post')
plt.xlabel('Time')
plt.ylabel('Number of Occurrences')
plt.title('Poisson Process Simulation')
plt.grid(True)
plt.show()
# Example:
rate = 1 # Rate of the Poisson process
time = 25 # Time
plot_poisson_process(rate, time)