face2face.statistics.distribution.calculate_inter_contact_duration¶
-
face2face.statistics.distribution.
calculate_inter_contact_duration
(Data, bins=None)¶ Calculates the probabilities for the inter-contact duration
Calculates the probability for the inter-contact duration delta T of three distinct persons.
- Parameters
Data.interaction (Data) – Contains a dataframe with the tij-data from the data set
- Returns
x_y_list (List) – A list with two lists. The first list contains the probabilities for the y-axis and the second list contains the inter-contact duration tAC-tAB
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
For this small example data set we fixed the bins for this function. This is not necessary for the normal usage.
>>> 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) >>> bins = [20, 40, 60, 80] >>> x_y_list, delta_t_list = calculate_inter_contact_duration(test_df, bins=bins) >>> print(x_y_list[0]) [0.0, 0.049999999999999996, 0.0] >>> print(x_y_list[1]) [20, 40, 60]