Calibrating a posture detector for a patients body involves measuring outputs of one or more sensors disposed in relation to the patients body while the patient assumes a plurality of positions. A transfer matrix is formed having coefficients corresponding to the measured outputs. The transfer matrix defines a relationship between a coordinate system of the one or more sensors and a coordinate system of the patients body. The body coordinate system is used as a reference coordinate system for posture detection. Posture, including tilt and/or tilt angle and may be determined based ON first and second rotational angles defined in relation to the body coordinate system.