M3.3 Random Walkers in a Valley: Langevin Dynamics and Stationarity
Builds on2 notes
A valley and a thousand lost walkers
A thousand walkers start together on one side of a foggy valley. Their motion is random but biased downhill, more strongly on steeper slopes.
Where are they an hour later? How would a wider valley, or a flat-bottomed valley with steep sides, change the result?
Downhill motion concentrates walkers; noise spreads them. Can these effects maintain a fixed density without freezing the walkers? First find a law with balanced flux, then ask whether other initial laws approach it.
DiscussionQ1
Represent terrain, downhill preference, random motion, and the proposed long-time distribution mathematically.
Show the reasoning
Let be height or potential. The negative gradient points steeply downhill, with magnitude determined by slope, so it supplies the drift.
Add the noise from M3.1:
This is overdamped Langevin dynamics. The conventional coefficient simplifies equilibrium. More generally use , with temperature or noise intensity .
A stationary distribution stays unchanged when used as the initial law. Individual particles still move. Existence, uniqueness, and convergence from other starting laws require separate arguments.
Restoring drift versus spreading
In a confining single valley, drift pulls toward lower potential while diffusion spreads the density, as described by M3.2.
A cloud high on a slope first moves downhill. Near the bottom, weaker drift lets noise broaden it, while particles reaching steep slopes are pulled back. Under suitable ergodicity conditions, these effects reach a balance that eventually forgets the starting law.
Widening the potential horizontally weakens its slopes and widens its equilibrium density correspondingly. A narrow valley concentrates it. A flat bottom and rapidly rising sides instead produce a flatter center and thinner tails.
Negative potential gradient pulls inward; noise spreads mass. Their zero-flux balance has density proportional to .
Substitute the candidate into Fokker–Planck
Here and , giving
Stationarity requires a zero right-hand side. Guess , assuming is finite. In one dimension:
The expression inside the spatial derivative vanishes pointwise, so its derivative vanishes and .
The actual probability flux is , because . The displayed expression is ; both vanish for the candidate. Appropriate boundary behavior is also required.
Will it be reached? Nonexplosion, ergodicity, and related conditions must be checked separately. Finite normalizes the candidate but does not imply exponential convergence. Roberts and Tweedie [2] analyze relevant tail conditions. The quadratic case is directly solvable.
For , equilibrium is . Widening to gives ; gives standard deviation . For , the density is proportional to , with a flatter center, thinner tails, and standard deviation about . At temperature , the candidate becomes .
DetailsExact finite-step bias for V=x²/2
Euler–Maruyama gives xₙ₊₁=(1−h)xₙ+√(2h)εₙ. A stationary variance s must satisfy s=(1−h)²s+2h, so s=1/(1−h/2). This requires 0 less than h less than 2. Variances are approximately 1.05 at h=0.1, 1.33 at h=0.5, and 2 at h=1. At h≥2 no finite stationary variance exists. The bias here is O(h); nonlinear explicit Euler chains need their own stability and invariant-measure analysis [2].
How long is long enough?
If enough time has passed and the required convergence conditions hold, the cloud approaches the equilibrium shaped by . The formula quantifies the intuitive widening effect, but it does not tell us that one hour is sufficient.
Two distinct limitations matter:
- Finite time: a double-well potential can trap walkers on one side. In the appropriate barrier-crossing regime, escape times have an Arrhenius factor of order , with further prefactors and assumptions. A stationary two-well law need not be well represented by a short simulation.
- Finite step: even a stable numerical chain can have a biased stationary law. The quadratic variance above is , while nonlinear problems need separate checks. Stability alone does not establish negligible bias.
Separate mixing and discretization effects
import numpy as np
rng = np.random.default_rng(0)
def langevin(gradV,x0,T,h,n=20000):
x = np.full(n,x0,float)
for _ in range(int(T/h)):
x = x-h*gradV(x)+np.sqrt(2*h)*rng.standard_normal(n)
return x
x = langevin(lambda x:x,3.,20.,.01)
print(x.mean(),x.var())
for h in [.1,.5,1.]:
print(h,langevin(lambda x:x,3.,20.,h).var(),1/(1-h/2))
# An explicit scheme for a quartic double well requires extra stability checks.
xb = langevin(lambda x:32*x*(x**2-1),-1.,20.,.01)
print('finite:',np.isfinite(xb).all(),'right-well fraction:',(xb>0).mean())
# Compare smaller h as well as longer T before attributing a mismatch to mixing.
The quadratic example should match the predicted finite-step variance after sufficient relaxation. A double well can retain strong initial-side bias at short times, but its explicit nonlinear discretization can also fail. Check finite values, refine the step, and compare the scheme before interpreting a histogram as evidence of slow mixing alone.
Check your understanding
References
- Pavliotis, G. A. Stochastic Processes and Applications: Diffusion Processes, the Fokker–Planck and Langevin Equations. Springer, 2014.
- Roberts, G. O., Tweedie, R. L. Exponential Convergence of Langevin Distributions and Their Discrete Approximations. Bernoulli 2(4), 1996.
- Gardiner, C. Stochastic Methods: A Handbook for the Natural and Social Sciences. Springer, 4th ed., 2009.
- Särkkä, S., Solin, A. Applied Stochastic Differential Equations. Cambridge University Press, 2019.