generate_series: Main function to generate a Hawkes process sequence. It...

View source: R/simulation.R

generate_seriesR Documentation

Main function to generate a Hawkes process sequence. It allows intermediary saves and continuing a stopped simulation. Creates a CSV file with two columns, each row is an event: (magnitude, time)

Description

Main function to generate a Hawkes process sequence. It allows intermediary saves and continuing a stopped simulation. Creates a CSV file with two columns, each row is an event: (magnitude, time)

Usage

generate_series(
  model,
  par,
  model_type,
  sim_no = 1,
  cores = 1,
  Tmax = Inf,
  maxEvents = NULL,
  M = NULL,
  tol = 1e-05,
  return_as_object = F,
  init_history = NULL
)

Arguments

model

A model class object with par and model_type presented. par and model_type are not requird once this is given

par

A named vector of model parameters, K, alpha, beta, mmin, c, theta - parameters of the Hawkes kernel

model_type

Model type

sim_no

The number of simulated cascades

cores

The number of cores (processes) used for simulation

Tmax

Maximum time of simulation.

maxEvents

Maximum number of events to be simulated.

M

Magnitude of the initial event

tol

Simulation stops when intensity smaller than tol.

return_as_object

wether return the cascades within a model object

init_history

If given, the simulation will start after the last event in the given init_history

Value

A list of data.frames where each data.frame is a simulated event cascade with the given model by default. Or a model object with the data.frames if return_as_object is True

Examples

generate_series(model_type = 'EXP',
                             par = c(K = 0.9, theta = 1),
                             sim_no = 10, Tmax = Inf)

qykong/HawkesFit documentation built on Jan. 26, 2023, 7:49 p.m.