Functions to estimate priors from data.