Probabilistic models for pattern statistics