simulate_cascades {NetworkInference} | R Documentation |
Simulate cascades from a diffusion network
Description
Simulate diffusion cascades based on the generative model underlying netinf and a diffusion network.
Usage
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 |
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 |
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 |
model |
character, diffusion model to use. One of |
nodes |
vector of node ids if different from nodes included in
|
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
data(cascades)
out <- netinf(cascades, trans_mod = "exponential", n_edges = 5, params = 1)
simulated_cascades <- simulate_cascades(out, nsim = 10)
# Simulation from partial cascade