TuringLang / ParetoSmooth.jl

An implementation of PSIS algorithms in Julia.
http://turinglang.org/ParetoSmooth.jl/
MIT License
19 stars 12 forks source link

Cleanup for last pull request #24

Closed ParadaCarleton closed 3 years ago

ParadaCarleton commented 3 years ago

Looks like the last pull request needs some minor edits:

  1. The functions seem to be very overtyped, assuming that everything is a Vector{Float64}, while users may want to use a different data structure. (Big data can oftentimes only be held in Float32, Float16, or more esoteric Float types.) The only thing we can assume is that anything passed will be an AbstractVector containing some kind of Real number. (Can't even assume they're Floats -- ForwardDiff's dual numbers aren't classed as floats since they're internally represented as a tuple of floats, so they're only a subtype of Real.)
  2. We need a comparison function that takes PsisLoo objects as inputs, rather than just a vector of log-likelihoods. I think it would be good to have functions dealing with the case that the user passes either a variable number of PsisLoo objects (without an enclosing data structure), or a named tuple of PsisLoo objects (in which case the names of the objects should be used as the model names).
  3. Looks like there's typos in the docstrings, and general formatting errors in the code. We should try and adhere to the Blue style guide from Invenia.
  4. We should hold to the API for ParetoSmooth samples (e.g. using something similar to :loo_score instead of :elpd_diff). The names were chosen to be generic, so we can implement other score functions besides elpd later. There also seems to be some information missing, like differences in the effective number of parameters.