1  Quick Start

The typical workflow is:

Input data
Two data frames: node arrivals + edge arrivals.
make_events()
Normalises times and builds event-indexed tables.
fit_hawkesNet()
Choose a kernel (BA / CS / bipartite) and fit.

If you haven’t already, install the package:

# install.packages("devtools")
devtools::install_github("JosephReps/hawkesNet")

ReprEx

# Our input data

# Edge arrivals w/ times
edges <- data.frame(
  i = c(1,1,3,1,4,1,4,2,9),
  j = c(2,3,4,5,6,7,8,9,10),
  time = 1:9
)

# Node arrivals w/ times
nodes <- data.frame(id = 1:10, time = 0:9)

# Making the events object from our data
ev <- make_events(nodes = nodes, edges = edges)

# Fit the data using an appropriate kernel, in this case BA
fit <- fit_hawkesNet(
  ev = ev,
  params_init = list(mu = 1, K = 1, beta = 1, beta_edges = 1),
  mark_type = "ba"
)

summary(fit)
Note

In the example above, we have taken special care to ensure the edges and nodes data frames satisfy the BA kernel assumptions. To learn more about this, head to the BA kernel page in the Example section.

Diagnostics

View model fit diagnostics.

par(mfrow=c(1,2))
plot(fit, type = "tau_qq")
plot(fit, type = "degree_hist")