Probabilistic Approaches For Tracking Physiological States In The Cortex Through Sleep And Seizures