The disclosure describes techniques for modifying an electrical stimulation or another type of therapy provided to a patient by a medical device. The therapy modification may be based on a posture and/or activity state of a patient that is detected by an IMD, such as a change in a detected posture state occupied by the patient. Different therapy modifications may be applied for different changes in detected posture state. An IMD may modify therapy based on a transition from one posture state to another posture state. The IMD may determine a posture state of the patient for use in controlling therapy adjustments and/or other aspects of the system. In some examples, when the patients movement and/or activity velocity exceeds a velocity threshold, a previously-determined stable posture state of the patient may be used to control therapy rather than a current posture state of the patient, which may be transient.