{'fraction_non_alphanumeric': 0.022401433691756272, 'fraction_numerical': 0.0, 'mean_word_length': 5.570588235294117, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Residence times and other functionals of reflected Brownian motion.

We study the residence and local times for a Brownian particle confined by reflecting boundaries, and propose a general solution to the problem of finding the related probability distribution. Its Fourier transform (characteristic function) and Laplace transform (survival probability) are obtained in a compact matrix form involving the Laplace operator eigenbasis. Explicit combinatorial relations are derived for the moments, and the probability distribution is shown to be nearly Gaussian when the exploration time is long enough. When the eigenbasis (or a part of it) is known, the numerical computation of the residence time distributions is straightforward and accurate. The present approach can also be applied to investigate other functionals of reflected Brownian motion describing, in particular, restricted diffusion in an external field or potential (e.g., nuclei diffusing in an inhomogeneous magnetic field). Theoretical results for the local times are confronted with Monte Carlo simulations on the unit interval, disk, and sphere.