face2face.statistics.distribution.calculate_triangle_duration¶
-
face2face.statistics.distribution.
calculate_triangle_duration
(Data, bins=None)¶ Calculates the probabilities for the contact duration between triangle constellations
Calculates the probability how long a triangle constellation lasts.
- Parameters
Data.interaction (Data) – Contains a dataframe with the tij-data from the dataset
- Returns
x_y_list (List) – A list with two lists. The first list contains the probabilitys for the y-axis and the second list contains the triangle duration delta T
delta_t_list (list) – Contains all the calculated $delta t$ values for the contact duration of the used data set.
References
- 1
Cattuto C, Van den Broeck W, Barrat A, Colizza V, Pinton JF, et al. (2010) Dynamics of Person-to-Person Interactions from Distributed RFID Sensor Networks. PLOS ONE
Examples
>>> attr_list = ["ID", "Age", "Sex"] >>> test_df = Data(path_tij="face2face/data/Test/tij_test.dat", separator_tij="\\t", >>> path_meta="face2face/data/Test/meta_test.dat", separator_meta="\\t", >>> meta_attr_list=attr_list) >>> y_x_list, delta_t_list = calculate_triangle_duration(test_df) >>> print(y_x_list[0]) [0.42857142857142855, 0.2857142857142857, 0.14285714285714285, 0.14285714285714285] >>> print(y_x_list[1]) [20, 40, 60, 80]