Skip to content
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

N-G integral is divergent for some simulated values #3

Closed
dwinter opened this issue Dec 10, 2014 · 2 comments
Closed

N-G integral is divergent for some simulated values #3

dwinter opened this issue Dec 10, 2014 · 2 comments
Labels

Comments

@dwinter
Copy link
Owner

dwinter commented Dec 10, 2014

At present, some fitness values, including those simulated with our rma_gamma function, break they density function. There doesn't seem to be any rhyme or reason to which fitness values do this, but they occur most often when the mean effect of mutations islarge, and the mutation rate is low:

dma_gamma(B=13, Ut=1.3, a=2, log=TRUE, Ve=1e-4, w=0.889)
dma_gamma(B=13, Ut=1.3, a=2, log=TRUE, Ve=1e-4, w=0.888)
dma_gamma(B=13, Ut=1.3, a=2, log=TRUE, Ve=1e-4, w=0.890)

One work around, as demonstrated above, might be to catch these errors and take values very-slightly either side of the error-producing one. This likely relates to the errors we want to catch in #2 .

@dwinter dwinter added the bug label Dec 10, 2014
@dwinter
Copy link
Owner Author

dwinter commented Dec 10, 2014

Digging a little deeper on this, I can at least find the value that kills it

dfe:::NG_convolution(Beta=13, Ve=1e-4, a=2, k=15, z=0.889)

There is a bit of a spike in the function near this fitness value, taking values to the left and the right:

sapply(seq(0.885, 0.888, 0.001), dfe:::NG_convolution, Beta=13, Ve=1e-4, a=2, k=15)   
sapply(seq(0.890, 0.895, 0.001), dfe:::NG_convolution, Beta=13, Ve=1e-4, a=2, k=15)

dwinter added a commit that referenced this issue Dec 10, 2014
Keeping #3 open for now, as may still run into this problem, and lower tolerance
may lead to slower fitting?
@dwinter
Copy link
Owner Author

dwinter commented Mar 9, 2015

This bug is closed since moving to GSL for integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant