HawkesProcesses.jl
Functions
HawkesProcesses.fit — Methodfit(events::Array{<:Number, 1}, maxT::Number, its::Int64)Arguments
eventsThe array of event times to fit the Hawkes process too.maxTThe boundary time over which the events were observed.itsNumber of iterations to sample for.
Notes
- All
eventsmust be unique
HawkesProcesses.hierarchical_fit — Methodhierarchical_fit(eventsTimesList, maxT, its)Arguments
eventTimesListAn array of arrays of events.maxTThe boundary time over which the events were observed.itsNumber for of iterations to sample for.
HawkesProcesses.intensity — Methodintensity(ts, events, background, kappa, kernel)Evaluate the intensity over a timegrid for some observed events with given Hawkes parameters.
Arguments
ts::Array{<:Number,1}: time grid to evalue the intensity overevents::Array{<:Number,1}: Events of the processbackground: Background ratekappa::Float64: Kappa valuekernel::Function: Kernel function
Notes
kappamust be between 0 and 1
HawkesProcesses.compensator — Methodcompensator(ts::Number, events::Array{<:Number}, bg::Number, kappa::Number, kern::Distributions.Distribution)The compensator or integrated intensity function.
Arguments
ts::Numbertime to which evaluate the integrated intensity function.events::Array{<:Number}events from the intensity function.bg::NumberBackground rate.kappa::NumberKappa parameterkern::Distributions.DistributionDistribution of the kernel.
Examples
HawkesProcesses.simulate — Methodsimulate(bg::Number, kappa::Float64, kern::Function, maxT::Number)Simulate a Hawkes process between 0 and maxT with parameters bg, kappa, kern.
Arguments
bg: The background rate of the Hawkes process. Constant or positive function.kappa: The kappa parameter of the Hawkes process.kern: The kernel function of the Hawkes process.maxT: Maximum time that the Hawkes process will be simulated for.
Notes
- kappa must be between 0 and 1 for a stable Hawkes process.
Examples
``julia kern_f(x) = pdf.(Distributions.Exponential(1/0.5), x)
simevents = simulate(0.5, 0.5, kern_f, 100) ``
HawkesProcesses.likelihood — Methodlikelihood(events::Array{<:Number, 1}, background::Float64, kappa::Float64, kernel::Distributions.Distribution, maxT::Number)Calculate the log likelihood of a Hawkes process for given parameters.
Arguments
eventsVector of events to calculate the likelihood for.backgroundBackground rate.kappaKappa parameter.kernelFunction or distribution of the kernel.maxTMaximum time of the process.
Notes
- The kernel function must be a proper probability distribution.
Examples
HawkesProcesses.time_change_null — Methodtime_change_null(events, maxT)Calculate the residuals for some events from a constant Poisson process.
Arguments
events::Array{<:Number}the events from the process.maxT::Numberthe maximum window time.
HawkesProcesses.time_change_hawkes — Methodtime_change_hawkes(events, bg, kappa, kern)Calculate the residuals using the time change theorem for a Hawkes process.
Arguments
events::Array{<:Number}the events from the process.bgthe background rate of the Hawkes process.kappathe kappa parameter of the Hawkes process.kernthe kernel distriubtion of the Hawkes process.