-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update sensitivity.R #80
base: master
Are you sure you want to change the base?
Conversation
In the sensitivity function it was written min(p1,p1). I substituted it with min(p1,p2). Additionally, with small numbers x is not always equivalent to 10^log10(x), because of this my analysis stopped when testp12 was the argument for prior.snp2hyp(). I think the best solution is changing the 'if' in this function so: (any(p12 < 10^log10(p1*p2)) || any(p12 > 10^log10(p1)) || any(p12 > 10^log10(p2)))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 116 looks a good fix.
I don't understand line 21 - are you trying to use logs to deal with very small p? because I think better to do that all on the log scale than have 10^log10(p2), for example.
I'll try to explain! It's just a quick fix so maybe you'll have a better idea. The problem is in |
I just installed coloc, but looks like the typo "min(p1,p1)" is still not fixed? |
I know this is a relatively old pull request, but I just wanted to try and explain why the error occurs for certain An example of this is if we define
which shows that it is a floating-point precision error causing the problem. The same can be true for very large numbers (not particularly applicable here, but informative nonetheless):
Using a value that is better represented by a floating-point number avoids this issue:
To avoid using logs in the argument for the |
In the sensitivity function it was written min(p1,p1). I substituted it with min(p1,p2).
Additionally, with small numbers x is not always equivalent to 10^log10(x), because of this my analysis stopped when testp12 was the argument for prior.snp2hyp(). I think the best solution is changing the 'if' in this function so: (any(p12 < 10^log10(p1*p2)) || any(p12 > 10^log10(p1)) || any(p12 > 10^log10(p2)))