Open ParadaCarleton opened 1 year ago
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 https://github.com/JuliaStats/Distributions.jl/issues/1139?
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
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.Distribution
s, 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.
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.
Ah, right. Yes, if ASH is to define its own transport methods, MeasureBase should be plenty.
The ASH package wants to add
logpdf
andlogcdf
, 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