In the help section on LR, we have the following note:
lr.maxLRange: The percentage of the entire data range to perform a linear regression on.
lr.chkLinearR: Sets the amount of tolerance in the automatic determination of linear segments.
lr.chkLinearR=10 (default value set in orgsys.cnf)
Question: what is the tolerance unit for lr.chkLinearR? Is it in percentage?
I was trying to check the behaviour of this tolerance on a dataset with the following labtalk script:
LR.maxLRange=80; lr.chkLinearR=90; %z=Data1; LR -b %z_B;
Data1 is A B 10 10 9 9 8 8 7 7 6 6.1 (purposely put to be deviated from 6 by 0.1) 5 5 4 4 3 3 2 2 1 1
If lr.chkLinearR=90 is in percentage, the LR should take all 80% of the range (as define by LR.maxLRange=80) starting from row 1 to row 9. However, the result only take the first 4 points only. Trying other values of lr.chkLinearR (say 1000) give the same result.
It would be very helpful if somebody can clarify the definition of lr.chkLinearR.
ChkLinearR is not in percent, but rather a measure of the error on slope of the progressive linear fit. The routine will first fit 30% of the given range, then it will fit the next 30% with a 10% increment. Each time, it will compare the measured slope with the 1st range(slope0). If the following is satisfied, then the looping will stop and considered the data is no longer linear.