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

exploit new expint(n,z) function #244

Open
4 of 6 tasks
stevengj opened this issue Oct 19, 2020 · 3 comments
Open
4 of 6 tasks

exploit new expint(n,z) function #244

stevengj opened this issue Oct 19, 2020 · 3 comments

Comments

@stevengj
Copy link
Member

stevengj commented Oct 19, 2020

Might be good to define a few additional functions in terms of the new expint functions:

(Even for real arguments, the expint implementation seems to be faster than what we have now for gamma_inc, although it might not be as accurate for the "lower" incomplete gamma function. I feel like we should just have a gamma(n,x) method that returns the upper incomplete gamma function, similar to Mathematica, in any case.)

@azev77
Copy link

azev77 commented Oct 25, 2020

Thanks @stevengj !
This makes it possible to add the requested Gompertz distribution to Distributions.jl.

  1. The moment generating function for Gompertz requires:
    image
    Is this available here?
  2. Currently expint() doesn't work (unless I'm using #Master) bc the latest release was in May.
    Approx when can we expect a new release?

@stevengj
Copy link
Member Author

stevengj commented Oct 26, 2020

  1. Yes, expint(t/b, η) should work fine for that case. The new implementation by @augustt198 supports arbitrary real and complex orders and arguments.

  2. I think we need to fix expint type instabilty for negative order #246, hopefully over the next week or so, before a new release.

@stevengj
Copy link
Member Author

stevengj commented Oct 26, 2020

It looks like what you really need for the Gomperz CDF is the scaled function expintx(ν, z) = exp(z) * expint(ν, z). It could be useful to pull this out as a specialized function, since the expint implementation internally scales by exp(-z) in many cases — it is better to avoid computing exp(z) * exp(-z), in order to avoid spurious underflow for large arguments. We could probably refactor expint to pull out the unscaled code.

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

No branches or pull requests

2 participants