inhpois | R Documentation |
Simulates an inhomogeneous Poisson process via Ogata's modified thinning algorithm on [0,\mathrm{end}]
.
An homogeneous Poisson process with intensity M
is first generated on [0,\mathrm{end}]
, then thinned using the specified intensity function fun
.
inhpois(end, fun, M = NULL)
end |
A non-negative numeric value - right bound of the interval |
fun |
A non-negative function or numeric value - intensity (function) of the Poisson process. |
M |
(default = NULL) A non-negative numeric value - upper bound on |
A S3 object of class inhpois
containing a vector ($p) of simulated values,
and all other objects used for the simulation.
# Simulate an inhomogeneous Poisson process with function intensity 1 + sin(x) (bounded by 2)
x <- inhpois(end=10, fun=function(y) {1 + sin(y)}, M=2)
# Simulate a homogeneous Poisson process with intensity 3
x <- inhpois(end=10, fun=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.