estimate_prior function

Estimate prior