Statistical detection and survival analysis with applications in sensor networks and healthcare