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

distuv LogCDF #1819

Open
ljcolling opened this issue Jul 28, 2022 · 2 comments
Open

distuv LogCDF #1819

ljcolling opened this issue Jul 28, 2022 · 2 comments

Comments

@ljcolling
Copy link

What are you trying to do?

Currently all the distributions have a CDF method. However, in addition to this, I think a LogCDF method would be useful. This would necessitate performing the calculations on the log scale, because simply taking the log of the CDF won't have sufficient accuracy.

For example,

dist := distuv.StudentsT{
		Mu:    0.0,
		Sigma: 1,
		Nu:    33,
		Src:   nil,
	}

math.Log(dist.CDF(23)) // returns 0

Compared with the equivalent R code

pt(q = 23, df = 33, ncp = 0, lower.tail = TRUE, log.p = TRUE) 
# [1] -3.43213e-22

Are you able to help contribute the feature?

I'm happy to help contribute to this. I'm currently using translations I've made of R nmath C library, and these translations could be used as the basis for this.

@kortschak
Copy link
Member

Can I confirm that the translations you have made are a reimplementation without reference to the nmath source or that the source is compatibly licensed with a BSD license (MIT/BSD etc)? If it is a direct translation of GPL code, I don't think we can accept it.

@ljcolling
Copy link
Author

Yeah, unfortunately it's a translation of the gpl source, so you're right that'll probably cause issues with license compatibility 🙁

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

No branches or pull requests

2 participants