[GenABEL-dev] Best way to 'round' small floats

Frank, Alvaro Jesus alvaro.frank at rwth-aachen.de
Wed May 21 10:02:25 CEST 2014


Hi All,
chi^2 refers to the std error used to divide beta to calculate the t-test value? I am not familiar with this kind of t-statistic using Likelihood Ratio Test, the one I was familiar with is the one presented in the attached paper. 
It seem to me weird that a ^2 value can be negative... Dominant should not have much difference with any other in terms of relation between the values used. I think Paolo and us have hinted several times to possible problems with significant digits and how this may affect results. I.e: Biomarkers with values exact up to 10^-3 will not give reliable results on any value direct or indirectly multiplied or added with it beyond 10^-3.

Or perhaps that is a different issue.
________________________________________
From: genabel-devel-bounces at lists.r-forge.r-project.org [genabel-devel-bounces at lists.r-forge.r-project.org] on behalf of L.C. Karssen [lennart at karssen.org]
Sent: Monday, May 19, 2014 4:06 PM
To: GenABEL Development list
Subject: [GenABEL-dev] Best way to 'round' small floats

Dear list,

While working on adding p-values to the ProbABEL output I ran into the
fact that (at least in the checks) we end up with small negative chi^2
values (e.g. -1.14e-13) for some models (e.g. dominant). Of course this
shouldn't happen, but my guess is it's a numerical problem caused by
subtracting the two likelihoods for the Likelihood Ratio Test.

I'd like to add a bit of code like this to mitigate this issue:

  if (chi2 < 0 && abs(chi2) < EPS) { chi2 = 0 }

with EPS set to e.g. 1e-9.
This won't harm any analysis, since we're only interested in chi^2
values away from zero, but I was wondering if there is a more
appropriate way to do this.


Thanks,

Lennart.
--
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
L.C. Karssen
Utrecht
The Netherlands

lennart at karssen.org
http://blog.karssen.org
GPG key ID: A88F554A
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hippokratia-14-23.pdf
Type: application/pdf
Size: 461655 bytes
Desc: hippokratia-14-23.pdf
URL: <http://lists.r-forge.r-project.org/pipermail/genabel-devel/attachments/20140521/9071f805/attachment-0001.pdf>


More information about the genabel-devel mailing list