Quantifying the degree of locking in weakly forced stochastic systems.