Skip to content

About

Mean first-passage time of 1D diffusion with stochastic resetting: exact formula and optimal reset rate checked against Numba Monte Carlo (1.7% mean error), plus heavy-tailed (Pareto) reset times.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

Stochastic Resetting: Mean First-Passage Time

How fast does a diffusing particle find a target if it is sent back to its starting point at random times, and does a Monte Carlo simulation reproduce the exact answer? Code accompanying my BSc thesis.

Exact MFPT vs resetting rate, with Monte Carlo estimates and 95% confidence intervals

What's inside

One notebook, mfpt_stochastic_resetting.ipynb, with the formulas and Numba simulators in resetting.py.

Section Question it answers
1. Theory What is the exact mean first-passage time (MFPT) under resetting at rate λ, and which λ minimises it?
2. Simulation Does a Monte Carlo simulation reproduce the formula, over a wide range of rates and near the optimum?
3. Sharpness of the optimum Can the simulation alone locate the optimal rate?
4. Noise or bias Are the differences between simulation and theory just noise?
5. Pareto resetting Does the sample MFPT still converge when the time between resets is heavy-tailed?

Headline results

  • Optimal rate. For diffusion coefficient D = 1 and target distance L = 1 the MFPT is minimised at λ* = 2.540, where it equals 1.544. In general λ* = z²D/L², with z solving z/2 = 1 − e^(−z).
  • Simulation matches theory within 2%. Mean absolute percentage error 2.07% over 20 rates from 0.5 to 10, and 1.78% over 100 rates near the optimum (5,000 runs per rate).
  • The remaining gap is a bias, not noise. 86% of the points lie above the curve (mean z-score +1.08, against a standard error of 0.10). The simulation checks for the target only once per time step, so passages are recorded late. Moving the target out by the standard continuity correction, 0.5826·√(2D·dt), brings the mean z-score to −0.10 and the error near the optimum from 1.78% to 1.19%, the level noise alone would give. The residuals still pass a normality test (Shapiro–Wilk p = 0.88), so that test alone would have missed the offset.
  • The optimum is flat. Every rate from 2 to 3.5 gives an MFPT within 1.7% of the minimum, about one standard error of a simulated point, so 5,000 runs per rate cannot locate λ* precisely.
  • Heavy-tailed resets break the sample mean. With Pareto-distributed time between resets, the running mean of 1,000,000 runs settles for tail index α = 1.5 (1.94) and α = 2.5 (2.24), but for α = 0.5 (infinite mean time between resets) it keeps jumping: 7.87 after 500,000 runs, 8.90 after 1,000,000.

Running mean of the first-passage time under Pareto resetting

Method

A particle starts at x = 0 and diffuses with coefficient D until it reaches x ≥ L. In each time step dt it is reset to 0 with probability 1 − e^(−λ·dt), otherwise it takes a Gaussian step with variance 2D·dt (dt = 10⁻⁴, 5,000 runs per rate). The simulation loop is compiled with Numba and seeded, so every number above is reproducible. Each estimate comes with its standard error, which the residual analysis uses to separate noise from bias. The exact MFPT is T(λ) = (e^(√(λ/D)·L) − 1)/λ (Evans & Majumdar, 2011). In the extension, the time between resets is Pareto with minimum 0.1 and tail index α ∈ {0.5, 1.5, 2.5}, simulated with dt = 10⁻³.

Quickstart

Requires uv.

git clone https://github.com/bartox12/Stochastic-Processes.git
cd Stochastic-Processes
uv sync
uv run jupyter lab mfpt_stochastic_resetting.ipynb

Running all cells takes about 10 minutes, most of it the 3 million Pareto runs in section 5.

Repository layout

├── mfpt_stochastic_resetting.ipynb   theory, simulations, bias check, Pareto extension
├── resetting.py                      exact MFPT, optimal rate, Numba simulators
├── plots/                            figures written by the notebook
└── pyproject.toml                    uv-managed environment

Limitations

  • One setting. One dimension, reset to the starting point, D = L = 1. Other values of D and L follow by rescaling time and space, but other geometries (higher dimensions, a reset point away from the start) are not covered.
  • Time-step bias is corrected, not removed. The continuity correction is a first-order approximation applied to the theory. A smaller time step, or checking for crossings between steps, would remove the bias in the simulation itself.
  • The Pareto extension is empirical. There is no exact MFPT to compare it with, and the α = 0.5 value is a lower bound: one run was stopped at the time limit of 500,000.

References

Broadie, Glasserman & Kou (1997) · Evans & Majumdar (2011) · Evans, Majumdar & Schehr (2020)

About

Mean first-passage time of 1D diffusion with stochastic resetting: exact formula and optimal reset rate checked against Numba Monte Carlo (1.7% mean error), plus heavy-tailed (Pareto) reset times.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages