randomly_permuted_times: Randomize temporal networks

View source: R/null_models.R View source: R/randomization_procedures.R

randomly_permuted_timesR Documentation

Randomize temporal networks

Description

Take a data frame specifying the edges of a temporal network and create a randomized reference network which maintains certain properties of the original network and destroys others.

Usage

total_randomization(edges)
randomly_permuted_times(edges)
vertex_randomization(edges)
contact_randomization(edges)
time_reversal(edges)
randomly_permuted_times(edges)
random_times(edges)
randomized_contacts(edges)
edge_randomization(edges)
randomized_edges(edges)

Arguments

edges

A data.frame of contacts specifying a temporal network. The data.frame has four columns: VertexFrom, VertexTo, TimeStart, and TimeStop. Each row represents a single directed contact between VertexFrom and VertexTo, beginning at TimeStart and ending at TimeStop. TimeStart and TimeStop may not be smaller than 0.

Details

randomly_permuted_times permutes the start time of contacts and adjusts the end time to maintain contact duration.

vertex_randomization assigns vertices randomly and with equal probability to contacts.

contact_randomization randomly permutes vertices between contacts.

time_reversal reverses the temporal order of contacts while maintaining the temporal distance of contacts.

randomly_permuted_times randomly permutes the start time of contacts while maintaining contact duration.

random_times assigns to the start time of each contact a random time between min(edges$TimeStart) and max(edges$TimeStop), maintaining the duration of each contact.

randomized_contacts redistributes contacts randomly among edges.

edge_randomization randomly exchanges whole contact sequences between edges.

randomized_edges randomly rewires edges. When an edge gets rewired, the contact sequence associated with that edge follow the edge.

total_randomization assigns vertices randomly to contacts, assuming that all vertices are equally likely participate in a contact

Randomized reference networks returned by these functions contain no contacts with self.

Value

A data.frame with the same columns as the edges, specifying the contacts of the randomized reference network.

Author(s)

Tim Gernat <mail@timgernat.name>

References

Holme & Saramaki, Physics Reports 519 (2012), p. 116-118

Examples

# load a temporal network
require(timeordered)
data(ants)

# randomly permute contact start timestamps while preserving contact duration
r1 <- randomly_permuted_times(ants)

# randomly permute vertices between contacts and assign a random start 
# timestamp to each contact while preserving contact duration
r2 <- contact_randomization(ants)
r2 <- random_times(r1)

timeordered documentation built on Aug. 21, 2023, 1:06 a.m.