According to an aspect, there is provided a method of operating an apparatus to determine a transformation matrix for measurements from an accelerometer that is worn by a subject, the apparatus comprising a memory unit arranged to store information for several activity events, the method comprising (i) detecting (202) an activity event in acceleration measurements obtained by the accelerometer, wherein the subject is in one or more postures during the activity event; (ii) determining (204) at least one quality indicator related to the detected activity event; (iii) determining (206) whether each of the at least one quality indicators meets a respective predetermined criterion; (iv) responsive to at least one quality indicator meeting the respective predetermined criterion, deciding (208) whether information related to the detected activity event can be stored in the memory unit, and if so, storing information related to the detected activity event in the memory unit together with information related to one or more other activity events if any; (v) determining (210) whether a calibration procedure should be performed based on information stored in the memory unit, and if so, processing the stored information to determine a transformation matrix, wherein the transformation matrix relates a frame of reference of the accelerometer to a frame of reference of the subject.