We present an analysis of optical techniques for the detection of chemical warfare agents and toxic industrial chemicals in real-world conditions. We analyze the problem of detecting a target species in the presence of a multitude of interferences that are often stochastic and we provide a broadly applicable technique for evaluating the sensitivity, probability of false positives ͑PFP͒, and probability of false negatives ͑PFN͒ for a sensor through the illustrative example of a laser photoacoustic spectrometer ͑L-PAS͒. This methodology includes ͑1͒ a model of real-world air composition, ͑2͒ an analytical model of an actual field-deployed L-PAS, ͑3͒ stochasticity in instrument response and air composition, ͑4͒ repeated detection calculations to obtain statistics and receiver operating characteristic curves, and ͑5͒ analyzing these statistics to determine the sensor's sensitivity, PFP, and PFN. This methodology was used to analyze variations in sensor design and ambient conditions, and can be utilized as a framework for comparing different sensors.