A model of particle diffusion in a magnetic field with islands and stochasticity is developed. Rather than integrating particle orbits around the torus, a mapping procedure is employed which reduces the problem to a two-dimensional diffusion process in the poloidal plane. The mapping equations are derived from the Hamiltonian form of the particle orbits, containing the magnetic moment as the random variable. A numerical code is developed which calculates the enhancement of losses in the presence of islands and stochasticity. The application to a magnetic field modelling Wendelstein VII-A exhibits the characteristic pattern of confinement time vs. rotational transform as found in the experiment.