sim_hawkes: Simulate inhomogenous Hawkes process

Description Usage Arguments Examples

View source: R/sim_hawkes.R

Description

Simulate inhomogenous Hawkes process

Usage

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
)

Arguments

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

Examples

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")

AnthonyEbert/StateSpaceInference documentation built on May 25, 2021, 2:45 a.m.