Calculates intercept and slope values with a linear model to standardize accelerometer and magnetometer data to values between -1 and +1.
Standardize(MagOrSR, MagOrHV, MagOrSW, AccOrSR, AccOrHV, AccOrSW, magSRmin,
magSRmax, magHVmin, magHVmax, magSWmin, magSWmax, accSRmin, accSRmax, accHVmin,
accHVmax, accSWmin, accSWmax)
Surge Magnetometer Orientation -1 or 1
Heave Magnetometer Orientation -1 or 1
Sway Magnetometer Orientation -1 or 1
Surge Accelerometer Orientation -1 or 1
Heave Accelerometer Orientation -1 or 1
Sway Accelerometer Orientation -1 or 1
Surge Magnetometer minimum
Surge Magnetometer maximum
Heave Magnetometer minimum
Heave Magnetometer maximum
Sway Magnetometer minimum
Sway Magnetometer maximum
Surge Accelerometer minimum
Surge Accelerometer maximum
Heave Accelerometer minimum
Heave Accelerometer maximum
Sway Accelerometer minimum
Sway Accelerometer maximum
Returns a [2,6] matrix with intercept in the first row and slope in the second row and columns in the order of the orientation parameter input. Row names are c("B0 Intercept","B1 Slope") and column names are c("MagSurge","MagHeave","MagSway","AccSurge","AccHeave","AccSway").
Standardization/Calibration/normalization/relativizing of accelerometer and magnetometer data. The right-hand-rule indicates the orientation (polarity) of the magnetometers and accelerometers required for the pseudotrack reconstruction algorithm, so that when the front, top or left side of the tag is facing the earth, the accelerometers are at the maximal reading (+1) when the tag is not moving. A similar rule applies for the magnetometers except the maximal reading for each axis will be when the front, top or left side is facing north and at the angle of inclination of the magnetic field (the angle at which the magnetic field enters the earth) at that location on the planet. If the tag sensors conform to this rule all the orientation parameters should be 1, any sensors that are opposite to this should have -1 as an orientation value. Instead of labeling the tag in X,Y and Z dimensions, the directions are labeled as Surge, Heave and Sway where Surge indicates the front (anterior) to back (posterior) axis, the Heave is the top (dorsal) to bottom (ventral) axis and the Sway is the right to left (lateral) axis.
# NOT RUN {
betas<-Standardize(1,1,-1,1,1,1,-57.8,68.76,-61.8,64.2,-70.16,58.08,-10.1,9.55,-9.75,9.72,
-9.91,9.43)
betas
# }
Run the code above in your browser using DataLab