Maximum-likelihood estimation to calculate diffusion and free energy profiles from molecular simulations.