time_dependent.NSPPThinning

Non Stationary Poisson Process via Thinning.

Usage

Source

time_dependent.NSPPThinning()

Thinning is an acceptance-rejection approach to sampling inter-arrival times (IAT) from a time-dependent distribution where each time period follows its own exponential distribution.

This implementation takes mean inter-arrival times as inputs, making it consistent with NumPy’s exponential distribution parameterization.

Methods

Name Description
__init__() Non Stationary Poisson Process via Thinning.
__repr__() Return a string representation of the NSPPThinning instance.
sample() Run a single iteration of acceptance-rejection

__init__()

Non Stationary Poisson Process via Thinning.

Usage

Source

__init__(data, interval_width=None, random_seed1=None, random_seed2=None)

Time dependency is handled for a single table consisting of equally spaced intervals.

Parameters
data: pd.DataFrame

DataFrame with time points and mean inter-arrival times. Columns should be “t” and “mean_iat” respectively.

interval_width: Optional[float] = None

The width of each time interval. If None, it will be calculated from consecutive time points in the data. Required if data has only one row.

random_seed1: Optional[int | SeedSequence] = None

Random seed for the exponential distribution

random_seed2: Optional[int | SeedSequence] = None
Random seed for the uniform distribution used for acceptance/rejection sampling.

__repr__()

Return a string representation of the NSPPThinning instance.

Usage

Source

__repr__()

sample()

Run a single iteration of acceptance-rejection

Usage

Source

sample(simulation_time)

thinning alg to sample the next inter-arrival time

Parameters
simulation_time: float
The current simulation time.
Returns
float
The inter-arrival time