[GenABEL-dev] Tolerance level in GenABEL RUnit test
L.C. Karssen
lennart at karssen.org
Fri May 8 15:52:45 CEST 2015
I spoke too early: in fact almost all checks in runit.polylik.R fail:
> checkEquals(h2htNew$h2an$est,h2htOld$h2an$est, tolerance = tol)
Error in checkEquals(h2htNew$h2an$est, h2htOld$h2an$est, tolerance = tol) :
Mean relative difference: 3.36492e-05
> checkEquals(h2htNew$h2an$min,h2htOld$h2an$min, tolerance = tol)
Error in checkEquals(h2htNew$h2an$min, h2htOld$h2an$min, tolerance = tol) :
Mean relative difference: 5.961843e-06
> checkEquals(h2htNew$residualY,h2htOld$residualY, tolerance = tol)
Error in checkEquals(h2htNew$residualY, h2htOld$residualY, tolerance =
tol) :
Mean relative difference: 4.462787e-05
> checkEquals(h2htNew$pgresidualY,h2htOld$pgresidualY, tolerance = tol)
Error in checkEquals(h2htNew$pgresidualY, h2htOld$pgresidualY, tolerance
= tol) :
Mean relative difference: 0.001496624
> checkEquals(h2htNew$InvSigma,h2htOld$InvSigma, tolerance = tol)
Error in checkEquals(h2htNew$InvSigma, h2htOld$InvSigma, tolerance = tol) :
Mean relative difference: 0.004265527
> checkEquals(h2htNew$measuredIDs,h2htOld$measuredIDs, tolerance = tol)
[1] TRUE
So the question remains: is this to be expected and should the tolerance
be set less strict or is this a true bug that needs fixing?
Thanks,
Lennart.
On 08-05-15 15:26, L.C. Karssen wrote:
> Dear list,
>
> I just ran the unit tests in GenABEL's /insts/unitTests/ directory and
> get the following error:
>
> 1 Test Suite :
> GenABEL unit testing - 21 test functions, 0 errors, 1 failure
> FAILURE in test.polylik: Error in checkEquals(h2htNew$h2an$est,
> h2htOld$h2an$est, tolerance = tol) :
> Mean relative difference: 8.295007e-05
> Error:
>
> unit testing failed (#test failures: 1, #R errors: 0)
>
>
> This is a test in the runit.polylik.R file. The variable "tol" is set to
> 2*.Machine$double.eps^0.5, which is equal to 2.980232e-08 on my
> machine. As you can see the difference in the unit test is more than
> three orders of magnitude higher.
>
> The two variables that are compared are calculated like this:
> h2htOld <- polygenic(formula,kin=gkin,df,llfun="polylik")
> h2htNew <- polygenic(formula,kin=gkin,df,llfun="polylik_eigen")
>
> Since I'm not an expert on the finer details of the various functions
> used in polygenic() I was hoping one of you could enlighten me and tell
> me if we should expect the comparison to give a difference of order 1e-8
> or that 1e-4 is good enough.
>
>
> Thanks for your help,
>
> Lennart.
>
>
>
> _______________________________________________
> genabel-devel mailing list
> genabel-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel
>
--
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
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: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <http://lists.r-forge.r-project.org/pipermail/genabel-devel/attachments/20150508/2aeb5fcc/attachment.sig>
More information about the genabel-devel
mailing list