Towards Data Science

How to Build a Markov Chain in Python With NumPy

The article "How to Build a Markov Chain in Python With NumPy" offers a step‑by‑step guide that covers transition matrices, the Chapman–Kolmogorov equation, and stationary distributions. It uses a three‑state writing example to illustrate how to construct and analyze a Markov chain in Python with NumPy.

arXiv AI
Sep 10

Microcanonical Hamiltonian Monte Carlo and the Helmholtz Theorem

The paper investigates the Microcanonical Hamiltonian Monte Carlo (MHMC) algorithm from a thermodynamic perspective, deriving its state variables and potentials to show that it represents a microcanonical thermodynamic ensemble. It demonstrates analytically and numerically that MHMC satisfies the Helmholtz theorem, an alternative form of the first law of thermodynamics, and introduces a new sampling algorithm tailored for lower-dimensional inference problems. The authors conclude that canonical Markov Chain Monte Carlo methods are more natural than MHMC when evaluated through thermodynamic and information-theoretic lenses.

By Heinrich von Campe, Bjoern Malte Schaefer
arXiv Machine Learning
Oct 23

Generalizing Metropolis-Hastings for DAG Sampling

The paper introduces duet sampling, a generalization of the Metropolis-Hastings algorithm that selects two proposal distributions from a pool at each iteration to resample parents for multiple nodes in a directed acyclic graph (DAG). This approach enables Markov chain moves that mix more efficiently without extra computational cost, outperforming existing state‑of‑the‑art methods in experiments. The authors demonstrate that their novel moves, both alone and combined, achieve superior performance even when previous methods also adopt duet sampling.

By Daniele Nikzad, Mikko Koivisto
arXiv Machine Learning
Aug 27

Data-driven Effective Modeling of Stochastic Chemical Reaction Networks

The paper introduces a data-driven effective model for stochastic chemical reaction networks that bypasses the high computational cost of the Stochastic Simulation Algorithm (SSA). By approximating the finite-time transition kernel of the SSA-induced continuous-time Markov chain with a generative machine learning model, the method operates on a user-defined coarse time step independent of microscopic reaction events. Using a conditional normalizing flow as the stochastic propagator, the trained model recursively generates statistically consistent trajectories, achieving significant computational savings while maintaining accuracy, as demonstrated through numerous numerical examples.

By Yuan Chen, Weize Mao, Dongbin Xiu