Description Usage Arguments Details Value Author(s) References See Also Examples
Randomly simulate the num.events consecutive event times of a non-homogeneous poisson process. Events are simulated using an underlying homogeneous process with given rate. An event at time t is admitted with probability prob.func(t). Note: The rate parameter of an homogeneous process is often called lambda.
1 | nhpp.event.times(rate, num.events, prob.func, num.sims = 1, t0 = 0)
|
rate |
the rate at which events occur in the equivalent homogeneous Poisson process, aka lambda |
num.events |
number of event times to simulate in each process |
prob.func |
aka intensity function, function that takes time as sole argument and returns value between 0 and 1 |
num.sims |
number of simulated paths to create |
t0 |
the reference start time of all events |
This method is called 'thinning' by Lewis & Shedler (1978).
A numeric vector of length num.events if num.sims=1, else, a num.events by num.sims matrix
Kristian Brock - Author, Daniel Slade - Contributor
Lewis & Shedler, Simulation of Non-Homogeneous Poisson Processes by Thinning, 1978
nhpp.mean.event.times
, nhpp.scenario
, hpp.event.times
1 2 3 4 | rate <- 10
target <- 50
intensity <- function(t) pmin(t/3, 1)
nhpp.event.times(rate, target, intensity)
|
[1] 0.07972108 0.37636808 0.97791008 1.11452393 1.28288212 1.75583620
[7] 2.16342749 2.20724433 2.78387663 2.86323336 2.97579737 3.06191513
[13] 3.12257232 3.15074410 3.15374020 3.37729644 3.77963382 3.83141969
[19] 3.83271290 3.85487655 3.91342114 4.07563373 4.43187254 4.48243799
[25] 4.69789610 4.74441813 4.79495256 4.83557321 4.97675936 5.17697243
[31] 5.21005513 5.29457137 5.37054011 5.38871078 5.39194027 5.60436582
[37] 5.77781596 5.86282604 6.03142816 6.09966187 6.15298582 6.19127745
[43] 6.22859454 6.27631170 6.29563862 6.41943225 6.49170616 6.51283818
[49] 6.60750991 6.66352607
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.