Description Usage Arguments Examples
Simulate inhomogenous Hawkes process
1 2 3 4 5 6 7 8 9 | sim_hawkes(
lambda_fun,
history0 = NULL,
kern,
startT = max(history0),
endT = 10,
maxI = Inf,
progressBar = TRUE
)
|
lambda_fun |
function for inhomogenous poisson process |
history0 |
vector of historic times |
kern |
function Hawkes kernal |
startT |
numeric start time |
endT |
numeric end time |
maxI |
numeric maximum number of points to simulate |
1 2 3 4 5 6 7 8 9 | lambda_levels <- c(0.5, 1, 2, 1, 3, 0.5, 1, 1, 2, 0.5, 0.5, 0.5, 0.5, 2, 2, 2, 4, 0, 1, 1, 1)
lambda_fun <- stepfun(seq(10, 200, by = 10), y = lambda_levels)
kern <- function(x){return(decay_func(x, alpha = 1, delta = 1.2))}
x <- sim_hawkes(lambda_fun, NULL, kern, 0, 200)
hist(x, breaks = 200)
plot(lambda_fun, add = TRUE, col = "red")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.