Error functions for prediction of episodes of poor air quality