A Julia package for fitting, analysing and plotting Hawkes processes.
You can find the maths behind the algorithm here. The Bayesian sampling algorithm is a generic version of the bayesianETAS
package from CRAN which can be found here.
- HawkesProcesses.jl: An Introduction
- Hawkes Processes and DIC
- Does a Terror Attack Lead to More Terror Attacks?
I provide a number of different tools to both fit and analyse a collection of events using Hawkes processes.
bg = 0.5
kappa = 0.5
kernel(x) = pdf.(Distributions.Exponential(1/0.5), x)
maxT = 100
simevents = HawkesProcesses.simulate(bg, kappa, kernel, maxT)
Sample the parameters of a Hawkes process using the latent variable Bayesian MCMC algorithm. Currently only constant background, constant κ and exponential kernel are available, but this will be extend to generic functions in the future.
bgSamps, kappaSamps, kernSamps = HawkesProcesses.fit(simEvents, maxT, 1000)
likelihood = HawkesProcesses.likelihood(simevents, bg, kappa, Distributions.Exponential(1/0.5))
intensity = HawkesProcesses.intensity(ts, simevents, bg, kappa, kernel)
- Make functions consistent with Julia style guide.
- Check type safety
- Return parent vector from simulate.
- Likelihood with functional background
- Generic Bayesian inference.