In general, the disclosure relates to medical devices and systems for detecting the posture state of patient. For example, a medical system may detect a posture state of a patient and deliver therapy based at least in part on the detected patient posture state. In some examples, the system may comprise a posture sensor that generates posture sensor data when a patient is in a posture state, and a processor that receives the first posture sensor data, compares the first posture state data to reference posture sensor data, and detects the presence of at least one of sensor signal drift or sensor signal shift for the posture sensor based at least in part on the comparison. In some examples, the processor may be configured to determine one or more offset correction values to apply to posture sensor data generated by the posture sensor when the at least one of sensor signal drift or sensor signal shift is determined to be present.