cora.foreground.poisson
Functions
|
Generate a realisation of a Possion process. |
|
Create a realisation of an inhomogenous (i.e. variable rate) Poisson process. |
|
Create a realisation of an inhomogenous (i.e. variable rate) Poisson process. |
|
Test the homogenous Poisson process. |
|
Test the inhomgeneous Poisson process. |
- cora.foreground.poisson.homogeneous_process(t, rate)
Generate a realisation of a Possion process.
- Parameters:
t (scalar) – The time length to realise. The events generated are between time 0 and t.
rate (scalar) – The average rate of events.
- Returns:
events – An array containing the times of the events.
- Return type:
ndarry
- cora.foreground.poisson.test_hpp()
Test the homogenous Poisson process.
Realise a poisson process, bin time intervals to count number of events in each bin, and then compare with a Poisson distribution. Test can not be reliably automated, results are returned to be checked by eye.
- Returns:
r1 (ndarray) – Number of events in an interval
h2 (ndarray) – Number of intervals containing a specific number of events (corresponding to r1)
p2 (ndarray) – Prediction for h2 from Poisson distribution
- cora.foreground.poisson.inhomogeneous_process(t, rate)
Create a realisation of an inhomogenous (i.e. variable rate) Poisson process.
- Parameters:
t (scalar) – The time length to realise. The events generated are between time 0 and t.
rate (function) – A function which returns the event rate at a given time.
- Returns:
events – An array containing the times of the events.
- Return type:
ndarry
- cora.foreground.poisson.test_ipp()
Test the inhomgeneous Poisson process.
Generate an inhomogenous process, divide the time into bins, and calculate the events in each, to compare against the original rate function. This test is difficult to automate, so the results must be checked by eye.
- Returns:
r1 (ndarray) – Time of each bin.
h1 (ndarray) – Average rate of events in each time bin.
p2 (ndarray) – Input rate of events at each time.
- cora.foreground.poisson.inhomogeneous_process_approx(t, rate)
Create a realisation of an inhomogenous (i.e. variable rate) Poisson process.
Uses an approximate method (but fast) based on generating a Cumulative Distribution Function from a set of samples, and the inverting this to generate the random deviates. The total number of events is calculated by drawing it from a Poisson distribution.
- Parameters:
t (scalar) – The time length to realise. The events generated are between time 0 and t.
rate (function) – A function which returns the event rate at a given time.
- Returns:
events – An array containing the times of the events.
- Return type:
ndarry