HawkesProcesses.jl
Functions
HawkesProcesses.fit
— Methodfit(events::Array{<:Number, 1}, maxT::Number, its::Int64)
Arguments
events
The array of event times to fit the Hawkes process too.maxT
The boundary time over which the events were observed.its
Number of iterations to sample for.
Notes
- All
events
must be unique
HawkesProcesses.hierarchical_fit
— Methodhierarchical_fit(eventsTimesList, maxT, its)
Arguments
eventTimesList
An array of arrays of events.maxT
The boundary time over which the events were observed.its
Number 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
kappa
must 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::Number
time to which evaluate the integrated intensity function.events::Array{<:Number}
events from the intensity function.bg::Number
Background rate.kappa::Number
Kappa parameterkern::Distributions.Distribution
Distribution 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
events
Vector of events to calculate the likelihood for.background
Background rate.kappa
Kappa parameter.kernel
Function or distribution of the kernel.maxT
Maximum 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::Number
the 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.bg
the background rate of the Hawkes process.kappa
the kappa parameter of the Hawkes process.kern
the kernel distriubtion of the Hawkes process.