|
2905 | 2905 | "cell_type": "code", |
2906 | 2906 | "execution_count": null, |
2907 | 2907 | "metadata": { |
2908 | | - "tags": [ |
2909 | | - "hide-input" |
2910 | | - ] |
| 2908 | + "tags": [ |
| 2909 | + "hide-input" |
| 2910 | + ] |
2911 | 2911 | }, |
2912 | 2912 | "outputs": [], |
2913 | 2913 | "source": [ |
|
3544 | 3544 | "cell_type": "markdown", |
3545 | 3545 | "metadata": {}, |
3546 | 3546 | "source": [ |
3547 | | - "### Pair-distibution function (PDF)\n", |
| 3547 | + "### Pair-distribution function (PDF)\n", |
| 3548 | + "\n", |
3548 | 3549 | "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", |
3549 | 3550 | "The pair-distribution function (PDF): \n", |
3550 | 3551 | "\n", |
|
3563 | 3564 | "metadata": {}, |
3564 | 3565 | "outputs": [], |
3565 | 3566 | "source": [ |
3566 | | - "from pedpy import compute_pair_distibution_function\n", |
| 3567 | + "from pedpy import compute_pair_distribution_function\n", |
3567 | 3568 | "\n", |
3568 | 3569 | "# Compute pair distribution function\n", |
3569 | | - "radius_bins, pair_distribution = compute_pair_distibution_function(\n", |
| 3570 | + "radius_bins, pair_distribution = compute_pair_distribution_function(\n", |
3570 | 3571 | " traj_data=traj, radius_bin_size=0.1, randomisation_stacking=1\n", |
3571 | 3572 | ")" |
3572 | 3573 | ] |
|
3598 | 3599 | "source": [ |
3599 | 3600 | "#### Parameters of the PDF\n", |
3600 | 3601 | "\n", |
3601 | | - "The function `compute_pair_distibution_function` has two main parameters:\n", |
| 3602 | + "The function `compute_pair_distribution_function` has two main parameters:\n", |
| 3603 | + "\n", |
3602 | 3604 | "- `radius_bin_size` is the size of the radius bins for which probability will be computed. On one hand a larger bin size results in smoother pdf but decreases the accuracy of the description, as more individuals can be detected in each bin. On the other hand, a smaller bin will increase the accuracy of the description but may lead to noisy or `Nan` values as each bin may not be populated (leading to invalid divisions). We suggest using a bin size value between 0.1 and 0.3 m as these values are close to order of magniture of a chest depth.\n", |
3603 | 3605 | "- `randomisation_stacking` is the number of time the data stacked before being shuffled in order to compute the probability $P_{Ni}$ of measuring given pair-wise distances for pedestrians that do not interact. Stacking the data multiple times helps harmonize the random positions more effectively, ensuring that the PDF converges to results that are independent of the randomization method." |
3604 | 3606 | ] |
|
3616 | 3618 | "metadata": {}, |
3617 | 3619 | "outputs": [], |
3618 | 3620 | "source": [ |
3619 | | - "from pedpy import compute_pair_distibution_function\n", |
| 3621 | + "from pedpy import compute_pair_distribution_function\n", |
3620 | 3622 | "\n", |
3621 | 3623 | "radius_bin_sizes = [0.05, 0.1, 0.25, 0.5]\n", |
3622 | 3624 | "\n", |
3623 | 3625 | "varying_radius_bin_sizes = [\n", |
3624 | 3626 | " (\n", |
3625 | 3627 | " i,\n", |
3626 | | - " compute_pair_distibution_function(\n", |
| 3628 | + " compute_pair_distribution_function(\n", |
3627 | 3629 | " traj_data=traj,\n", |
3628 | 3630 | " radius_bin_size=radius_bin_size,\n", |
3629 | 3631 | " randomisation_stacking=1,\n", |
|
3646 | 3648 | "metadata": {}, |
3647 | 3649 | "outputs": [], |
3648 | 3650 | "source": [ |
3649 | | - "from pedpy import compute_pair_distibution_function\n", |
| 3651 | + "from pedpy import compute_pair_distribution_function\n", |
3650 | 3652 | "from time import time\n", |
3651 | 3653 | "\n", |
3652 | 3654 | "randomisation_stackings = [1, 3, 5]\n", |
|
3656 | 3658 | "for i, randomisation_stacking in enumerate(randomisation_stackings):\n", |
3657 | 3659 | " begin_time = time()\n", |
3658 | 3660 | "\n", |
3659 | | - " pdf = compute_pair_distibution_function(\n", |
| 3661 | + " pdf = compute_pair_distribution_function(\n", |
3660 | 3662 | " traj_data=traj,\n", |
3661 | 3663 | " radius_bin_size=0.15,\n", |
3662 | 3664 | " randomisation_stacking=randomisation_stacking,\n", |
|
4428 | 4430 | "name": "python", |
4429 | 4431 | "nbconvert_exporter": "python", |
4430 | 4432 | "pygments_lexer": "ipython3", |
4431 | | - "version": "3.11.4" |
| 4433 | + "version": "3.12.4" |
4432 | 4434 | } |
4433 | 4435 | }, |
4434 | 4436 | "nbformat": 4, |
|
0 commit comments