Currently, pointwise_logdensities(chains::AbstractChains) returns an OrderedDict of Matrices all of the shape (sample x chain).
I find it more convenient to work with the results of the pointwise functions applied to AbstractChains as an AbstractChains again, rather than the OrderedDict{String, Matrix}.
What is a good place  to support this conversion? A function in the MCMCChains extension such as:
function as_chains(lds_pointwise)
     Chains(stack(values(lds_pointwise); dims=2), collect(keys(lds_pointwise)))
end
chn = as_chains(logjoints_pointwise); # from @testset "pointwise_logdensities chain"
names(chn)
get(chn, :x)[1] == logjoints_pointwise["x"]One could even think of letting the pointwise_logdensities(..., ::AbstractChains) routinely return a Chains object.
This could be achieved by
- renaming the pointwise_logdensities(..., ::AbstractChains)topointwise_logdensities_dict,
- implementing it in the DynamicPPLMCMCChains extension by converting the result of pointwise_logdensities_dict.
What are opinions about this suggestion?