logstatsexp
Adds the functions logmeanexp, logvarexp, logstdexp
These functions are usually useful for me, thought it'd be nice to have them here.
Not sure why CI is failing on Julia 1.0 ?
I don't have an strong opinion on this, but Is it possible to implement this as an extension? This package is a really low level one, and adding a new dependency could have effects on downstream packages?
The same thing applies to LinearAlgebra, (but they should be it's own issue)
@longemen3000 The PR is not introducing any dependencies.
Statistics, while a Stdlib, it is a new dependency
Ohhh, nvm, my error, in that case, no comment at all
@longemen3000 Yes but Statistics is only used in tests
CI passing now.
@devmotion I agree the implementation is not optimal but I don't have time to tune it now. Could we merge as it is now?
I think we can merge now and work on optimization later.
Honestly, it's just a huge pain trying to optimize for allocations without having Transducers.jl, laziness, or good functional primitives in Julia.
@ParadaCarleton as far as I know you've never contributed to this package, so I really think that you should let the maintainers of this package decide when a PR is ready and can be merged. In my opinion, being a member of JuliaStats doesn't mean that you are able and should merge PRs in repos that you haven't contributed to and/or are not familiar with. For instance, there are many JuliaStats packages where I don't think it's appropriate for me to merge PRs.
Clearly, we should not over-optimize this PR. But at the same time we should hold off merging PRs if reviewer comments that can be addressed without too much effort are not resolved. For instance, I think currently the following things are missing in this PR:
- Definitions for non-
AbstractArrayinputs (it seems the same algorithm could be applied?) - Avoiding allocating
R .- log(N)etc. whenRis anArrayand broadcasting whenRis a scalar - Tests with non-
Float64inputs (these would have uncovered the promotion issues)