Function starts by identifying ten second windows of non-movement. Next, the average acceleration per axis per window is used to estimate calibration error (offset and scaling) per axis. The function provides recommended correction factors to address the calibration error and a summary of the callibration procedure.
g.calibrate(datafile, spherecrit = 0.3,
minloadcrit = 72,
printsummary = TRUE,chunksize=c(),windowsizes=c(5,900,3600),
selectdaysfile=c(),
dayborder=0, desiredtz = "", ...)name of accelerometer file
the minimum required acceleration value (in g) on both sides of 0 g for each axis. Used to judge whether the sphere is sufficiently populated
the minimum number of hours the code needs to read for the autocalibration procedure to be effective (only sensitive to multitudes of 12 hrs, other values will be ceiled). After loading these hours only extra data is loaded if calibration error has not been reduced to under 0.01 g.
if TRUE will print a summary when done
number between 0.2 and 1 to specificy the size of chunks to be loaded as a fraction of a 12 hour period, e.g. 0.5 equals 6 hour chunks. The default is 1 (12 hrs). For machines with less than 4Gb of RAM memory a value below 1 is recommended.
see g.getmeta
see g.part1
see g.part1
see g.getmeta
Please ignore. Only used by the code internally when called from within g.part1 with selectdaysfile specific.
scalescaling correction values, e.g. c(1,1,1)
offsetoffset correction values, e.g. c(0,0,0)
tempoffsetcorrection values related to temperature, e.g. c(0,0,0)
cal.error.startabsolute difference between Euclidean norm during all non-movement windows and 1 g before autocalibration
cal.error.endabsolute difference between Euclidean norm during all non-movement windows and 1 g after autocalibration
spheredataaverage, standard deviation, Euclidean norm and temperature (if available) for all ten second non-movement windows as used for the autocalibration procedure
npointsnumber of 10 second no-movement windows used to populate the sphere
nhoursusednumber of hours of measurement data scanned to find the ten second time windows with no movement
meantempcalmean temperature corresponding to the data as used for autocalibration. Only applies to data collected with GENEActiv monitor.
van Hees VT, Fang Z, Langford J, Assah F, Mohammad A, da Silva IC, Trenell MI, White T, Wareham NJ, Brage S. Auto-calibration of accelerometer data for free-living physical activity assessment using local gravity and temperature: an evaluation on four continents. J Appl Physiol (1985). 2014 Aug 7
# NOT RUN {
datafile = "C:/myfolder/testfile.bin"
#Apply autocalibration:
C = g.calibrate(datafile)
print(C$scale)
print(C$offset)
# }
Run the code above in your browser using DataLab