# Iteratively solving for prior probabilites.

I'm using Bayes theorem to classify data into two groups, where the conditional probability is known but the prior is not. So I assume that the ratio of prior probabilities is 1 and calculate the posterior probabilities. I then use the posterior probabilities to calculate a new prior, and I continue iterating until the difference in the ratio of instances of both groups between iterations is less than 1%.

I know this sounds kind of like "Bayesian updating", except I am not using new data, but iterating on the same set. For my problem this method works well, and it converges to a stable prior, but I don't know if this method has a name? Is it some special case of Bayesian inference? I also don't know if there is a good way of estimating error with this method.

## 1 Answer

This general class of prior estimation is called Empirical Bayes. As stated in the Wiki article, this is sometimes equivalent to setting the prior distribution to its most likely value.

Whether your iteration approach is a good idea depends on a few things. It's possible you're getting stuck in a local optimum, e.g. starting with a different initial prior ratio will give a different stable outcome. If not, then the only issue is that you could theoretically be overfitting on your dataset if the number of points is very small (e.g. if you happen to have a class distribution in your sample which does not reflect the true distribution). But with a lot of points, this seems like a reasonable approach to me (if you get global convergence).