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

Create logpdf and logcdf stubs? #15

Open
ParadaCarleton opened this issue Sep 19, 2022 · 5 comments
Open

Create logpdf and logcdf stubs? #15

ParadaCarleton opened this issue Sep 19, 2022 · 5 comments

Comments

@ParadaCarleton
Copy link

The ASH package wants to add logpdf and logcdf, but adding a dependency on Distributions might be a little bit overboard. Should we add these here, then overload them in Distributions.jl?

(I recognize that this package is for more than just probability densities, but this seems like the best place to put them.)

@devmotion

@devmotion
Copy link
Member

I don't think this should be done. DensityInterface defines logdensityof and densityof which can be used for evaluating densities. So IMO there's no need for logpdf or pdf.

Currently also the API of pdf/logpdf assumes that you call it with a Distribution object. And to define that one has to depend on Distributions anyway. So to me it seems you might rather be interested in JuliaStats/Distributions.jl#1139?

@oschulz
Copy link
Collaborator

oschulz commented Sep 20, 2022

Could ASH just use logdensityof instead of logpdf? Histograms aren't always normalized anyway, so logpdf wouldn't be an ideal choice, semantically.

logcdf is more tricky, we don't have anything in DensityInterface for that. One option here might be to depend on MeasureBase. MeasureBase has recently gained an API to define transports between measures - transport to/from MeasureBase.StdUniform is equivalent to cdf/quantile functionality. Semantically, the result of ash can be seen as a measure and could in principle be a MeasureBase.AbstractMeasure. MeasureBase is more lightweight as a dependency than Distributions.

CC @cscherrer

@cscherrer
Copy link
Contributor

Thanks @oschulz . It's worth noting that while MeasureBase only provides the API for this functionality and implemetations for a "standard" measures". To get transports for Distributions.Distributions, users will need to depend on DistributionMeasures.jl. That package depends on Distributions (not the other way around). So unfortunately with the current setup it wouldn't be enough for users to just load Distributions.

@oschulz
Copy link
Collaborator

oschulz commented Sep 20, 2022

It's worth noting that while MeasureBase only provides the API for this functionality and implemetations for a "standard" measures"

Yes, but that should be sufficient to define a cdf/quantile equivalent for ASH interpolations, right? DistributionMeasures should not be required as a dependency.

@cscherrer
Copy link
Contributor

Ah, right. Yes, if ASH is to define its own transport methods, MeasureBase should be plenty.

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

4 participants