Statistics for The development of a predictive autofocus algorithm using a general image formation model