hawkes | R Documentation |
Simulates a Hawkes process using its cluster representation:
First, the immigrants are drawn according to an (inhomogeneous) Poisson process with intensity measure fun
.
Second, the number of offsprings of an immigrant follows a Poisson distribution with intensity repr
.
Third, these offsprings are distributed according to the family
distribution.
Then, generate further offsprings according to the last two steps.
hawkes(end, fun, repr, family, 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 immigrant process. |
repr |
A non-negative numeric value - mean number of offsprings. |
family |
A character string "name" naming a distribution with corresponding random generation function |
M |
(default = NULL) A non-negative numeric value - upper bound on |
... |
Additional arguments passed on to the random generation function. |
A S3 object of class Hawkes containing a vector ($p) of simulated values, and all other objects used for the simulation.
# Simulate an exponential Hawkes process with baseline intensity 1,
# reproduction mean 0.5 and exponential fertility function with rate 2.
x <- hawkes(10, fun=1, repr=0.5, family="exp", rate=2)
# Simulate a Hawkes process with baseline intensity function 1 + sin(x),
# reproduction mean 0.5 and custom [0,1]-triangular fertility function.
x <- hawkes(10, fun=function(y) {1+sin(y)}, M=2, repr=0.5,
family=function(n) {1 - sqrt(1 - runif(n))})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.