An important task of molecular simulation is the computation of free energy profiles $A(\zeta)$ where $\zeta$ is a control parameter acting on a multi-particle system. Among free-energy techniques, adaptive methods introduce an external bias to minimize the time spent sampling regions of the free energy that have already been visited. The time-dependent bias may be added to the potential or to the force governing the dynamics. We show how the biasing force can be efficiently constructed using an extended form of Bayes theorem.