In this paper we present a method to forecast pollution episodes using measurements of the pollutant concentration along time. Specifically, we use a backfitting algorithm with local polynomial kernel smoothers to estimate a semiparametric additive quantile regression model. We also propose a statistical hypothesis test to determine critical values, i.e., the values of the concentration that are significant to forecast the pollution episodes. This test is based on a wild bootstrap approach modified to suit asymmetric loss functions, as occurs in quantile regression. The validity of the method was checked with both simulated and real data, the latter from SO2 emissions from a coal-fired power station located in Northern Spain.