Module HawkesPyLib.core.simulation

Functions

def homogenous_poisson_simulator(T: float, mu: float, seed: int = 0) ‑> numpy.ndarray

Simulates a homogenous Poisson process with constant intensity mu.

Args

T : float
Time until which the Poisson process will be simulated. T > 0
mu : float
Constant intensity of the homogenous Poisson process. mu > 0
seed : int, optional
Seed for numba's random number generator. Defaults to 0 (no seed).

Returns

np.ndarray
Array of simulated timestamps
def uvhp_approx_powl_cutoff_simulator(T: float, mu: float, eta: float, alpha: float, tau: float, m: float, M: int, seed: int = 0) ‑> numpy.ndarray

Simulates a Hawkes process with approximate power-law memory kernel. Implements Ogata's modified thinning algorithm as described in algorithm 2 in (Ogata 1981) .

References:
  • Ogata, Y. (1981). On lewis simulation method for point processes. IEEE transactions on information theory, 27(1):2331.

Args

T : float
Time until which the Hawkes process will be simulated. T > 0
mu : float
Background intensity of the Hawkes process. mu > 0
eta : float
Branching ratio of the Hawkes process. 0 < eta < 1
alpha : float
Power-law coefficient of the memory kernel. alpha > 0
tau : float
Memory kernel parameter. tau > 0
m : float
Memory kernel variable. m > 0
M : int
Memory kernel variable. M > 0
seed : int, optional
Seed for numba's random number generator. Defaults to 0 (no seed).

Returns

np.ndarray
Array of simulated timestamps
def uvhp_expo_simulator(T: float, mu: float, eta: float, theta: float, seed: int = 0) ‑> numpy.ndarray

Simulates a Hawkes process with single exponential memory kernel. Implements Ogata's modified thinning algorithm as described in algorithm 2 in (Ogata 1981).

References:
  • Ogata, Y. (1981). On lewis simulation method for point processes. IEEE transactions on information theory, 27(1):2331.

Args

T : float
Time until which the Hawkes process will be simulated. T > 0
mu : float
Background intensity of the Hawkes process. mu > 0
eta : float
Branching ratio of the Hawkes process. 0 < eta < 1
theta : float
Decay speed of kernel. theta > 0
seed : _type_, optional
Seed numbda's random number generator. Defaults to 0 (no seed).

Returns

np.ndarray
Array of simulated timestamps
def uvhp_approx_powl_simulator(T: float, mu: float, eta: float, alpha: float, tau: float, m: float, M: int, seed: int = 0) ‑> numpy.ndarray

Simulates a Hawkes process with approximate power-law memory kernel. Implements Ogata's modified thinning algorithmas described in algorithm 2 in (Ogata 1981).

References:
  • Ogata, Y. (1981). On lewis simulation method for point processes. IEEE transactions on information theory, 27(1):2331.

Args

T : float
Time until which the Hawkes process will be simulated. T > 0
mu : float
Background intensity of the Hawkes process. mu > 0
eta : float
Branching ratio of the Hawkes process. 0 < eta < 1
alpha : float
Power-law coefficient of the memory kernel. alpha > 0
tau : float
Memory kernel parameter. tau > 0
m : float
Memory kernel variable. m > 0
M : int
Memory kernel variable. M > 0
seed : int, optional
Seed for numba's random number generator. Defaults to 0 (no seed).

Returns

np.ndarray
Array of simulated timestamps
def uvhp_sum_expo_simulator(T: float, mu: float, eta: float, theta_vec: numpy.ndarray, seed: int = 0) ‑> numpy.ndarray

Simulates a Hawkes process with P-sum expoential memory kernel. Implements Ogata's modified thinning algorithmas described in algorithm 2 in (Ogata 1981).

References:
  • Ogata, Y. (1981). On lewis simulation method for point processes. IEEE transactions on information theory, 27(1):2331.

Args

T : float
Time until which the Hawkes process will be simulated. T > 0
mu : float
Background intensity of the Hawkes process. mu > 0
eta : float
Branching ratio of the Hawkes process. 0 < eta < 1
theta_vec : np.ndarray
Array of P exponential decay speeds. theta_vec > 0
seed : int, optional
Seed for numba's random number generator. Defaults to 0 (no seed).

Returns

np.ndarray
Array of simulated timestamps