Skip to content

Commit 302d071

Browse files
authored
Details about the computation of the pdf (#372)
* Details about the computation of the pdf * corrections following reviews
1 parent 6e874f0 commit 302d071

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

notebooks/user_guide.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3548,11 +3548,13 @@
35483548
"This method is inspired from condensed matter description and used in the work of [Cordes et al. (2023)](https://doi.org/10.1093/pnasnexus/pgae120) following [Karamousas et al. (2014)](https://doi.org/10.1103/PhysRevLett.113.238701).\n",
35493549
"The pair-distribution function (PDF): \n",
35503550
"\n",
3551-
"$$g(r)=P(r)/P_{Ni}(r)$$\n",
3551+
"$$g(r)=P(r)/P_{Ni}(r)$$.\n",
35523552
"\n",
35533553
"\"Quantifies the probability that two interacting pedestrians are found a given distance r apart, renormalized by the probability $P_{Ni}$ of measuring this distance for pedestrians that do not interact.\"\n",
35543554
"\n",
3555-
"This probability is approximated here by randomising the time information (randomisation of the time frames).\n",
3555+
"In this method, \"interacting pedestrians\" are defined as pedestrians that are present in the same spatial domain at the same time. One should also keep in mind that in its current implementation, the method does not take into account walls and corners, which should in theory block any \"interaction\" between pedestrians on opposite sides of the obstacles.\n",
3556+
"\n",
3557+
"The probability $P_{Ni}$ is approximated here by time randomising the original trajectory file. For this randomisation process, only the frame numbers of the trajectory file are shuffled. The created \"randomised trajectories\" contain random pedestrian positions, composed only of positions present in the original trajectory file. This method helps account for pedestrians' preferred space utilisation, which can be due to terrain features or social behaviours. One should note that the number of positions selected for each frame is also random during the creation of the randomised trajectory file. The random process should ensure a uniform distribution of positions for each frame. However, to smooth any noise that this method may induce, we recommend using a higher `randomisation_stacking` number (see details in the next section).\n",
35563558
"\n",
35573559
"The pair-distribution function of a given crowd recording can be computed using the following instructions:"
35583560
]

pedpy/methods/spatial_analysis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def compute_pair_distribution_function(
2424
"""Computes the pair distribution function g(r) for a given set of trajectory data.
2525
2626
This function calculates the spatial distribution of positions :math:`g(r)`
27-
:math:`g(r)` here referred to the Euclidean distance between agents.
27+
:math:`g(r)` here referred to the Euclidean distance between interacting pedestrians, i.e.,
28+
pedestrians that are in the same walkable area at the same moment.
2829
The pdf is given by the probability that two pedestrians are separated
2930
by :math:`r` normalized by the probability :math:`PNI(r)` that two non-interacting pedestrians
3031
are separated by :math:`r`, specifically

0 commit comments

Comments
 (0)