intensity {hawkesbow} | R Documentation |
Intensity of a Hawkes process
Description
Outputs the intensity of a Hawkes process x
, given the specified set of parameters.
Usage
intensity(x, t, fun = NULL, repr = NULL, family = NULL, M = NULL, ...)
Arguments
x |
A non-negative numeric vector, sorted in ascending order; or an object of class "hawkes" output by function |
t |
A non-negative numeric value or vector, at which the intensity should be computed. |
fun |
(default = TRUE) A non-negative numeric function or value - intensity (function) of the immigrant process. |
repr |
(default = NULL) A non-negative numeric value - mean number of offsprings. |
family |
(default = NULL) A character string "name" naming a distribution with corresponding distribution function |
M |
(default = NULL) A non-negative numeric value - upper bound on |
... |
Additional arguments passed on to the random generation function |
Details
If the input x
has been simulated using the function hawkes
, the parameters of the simulation will be used by default to compute the intensity.
If any parameter is specified in this function call, the function will use this instead.
Value
The intensity at time t.
Examples
# Simulate an exponential Hawkes process with baseline intensity 1,
# reproduction mean 0.5 and exponential fertility distribution with rate 2.
x <- hawkes(10, fun=1, repr=0.5, family="exp", rate=2)
intensity(x, 0:10)
# Intensity with a different set of parameters
intensity(x, 0:10, repr=0.8, rate=3)
# Intensity with a different distribution function
intensity(x, 0:10, family="chisq", df=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))})
intensity(x, 0:10, family=function(y) ifelse(y>0 & y<1, 2-2*y, 0))