simulate_cascades: Simulate cascades from a diffusion network

Description Usage Arguments Value Examples

Description

Simulate diffusion cascades based on the generative model underlying netinf and a diffusion network.

Usage

1
2
3
simulate_cascades(diffnet, nsim = 1, max_time = Inf,
  start_probabilities = NULL, partial_cascade = NULL, params = NULL,
  model = NULL, nodes = NULL)

Arguments

diffnet

object of class diffnet.

nsim

integer, number of cascades to simulate.

max_time

numeric, the maximum time after which observations are censored

start_probabilities

a vector of probabilities for each node in diffnet, to be the node with the first event. If NULL a node is drawn from a uniform distribution over all nodes.

partial_cascade

object of type cascade, containing one partial cascades for which further development should be simulated.

params

numeric, (optional) parameters for diffusion time distribution. See the details section of netinf for specification details. Only use this argument if parameters different from those contained in the diffnet object should be used or the network is not an object of class diffnet.

model

character, diffusion model to use. One of c("exponential", "rayleigh", "log-normal"). Only use this argument if parameters different from those contained in the diffnet object should be used or the network is not an object of class diffnet.

nodes

vector of node ids if different from nodes included in diffnet

Value

A data frame with three columns. Containing 1) The names of the nodes ("node_name") that experience an event in each cascade, 2) the event time ("event_time") of the corresponding node, 3) the cascade identifier "cascade_id".

Examples

1
2
3
4
5
data(cascades) 
out <- netinf(cascades, trans_mod = "exponential", n_edges = 5, params = 1)
simulated_cascades <- simulate_cascades(out, nsim = 10)
 
# Simulation from partial cascade

desmarais-lab/NetworkInference documentation built on May 15, 2019, 5:05 a.m.