Timed Inference for Behavioral Pattern Recognition