The invention relates to a device for determining a transformation between an accelerometer coordinate system of an accelerometer 3 attached to a subject and a subject coordinate system. Defining that a vertical and upward pointing direction in the subject coordinate system is equal to an acceleration-measurement-based vertical and upward pointing direction in the accelerometer coordinate system leads to a first direction in the accelerometer coordinate system. A second direction in the accelerometer coordinate system is provided, which is equal to a direction in the subject coordinate system of the subject having a known spatial relation to the vertical and upward pointing direction in the subject coordinate system, wherein the transformation is determined based on the first and second directions and the known spatial relation. This allows for an improved determination of the transformation, which can be used for, for instance, improved activity or posture detection.