Closed nabriis closed 2 months ago
@jakobsj DoD review and review the suggested change
@nabriis Sounds sensible, and many thanks for adding the example code. I think a brief discussion at daily would be useful to clarify. In general, this new class should seek to align as much as possible with Samples, as well as I suppose JointDistribution, such that the prepended "Joint" onto "Samples" and "Distribution" behaves in the same way, which appears from your suggestion to be OK. Which other aspects/alignments are there to consider - how about other functionality of Samples, such as plotting - could one align the behaviour there as well to generate the meaningful plots of each of the sets of samples?
@jakobsj Plotting and other operations are usually done like this:
samples["x"].plot_ci()
I think this work fine. I think doing samples.plot_ci() would make too many plots. One could add more methods over time like Ns
or compute_std
from Samples object and return a list of stds for this joint object.
@nabriis But doesn't that assume that samples
there is a dict, and the proposal is to change it to an instance of a new JointSamples
class?
@nabriis But doesn't that assume that
samples
there is a dict, and the proposal is to change it to an instance of a newJointSamples
class?
It does assume the samples is a dict (or at least asssumes it has a key, value pair). The proposal is to subclass JointSamples from dict to maintain the same behavior.
Ah I see, I had missed that. Interesting. Maybe that does make a lot of sense. Somehow I had/would? expect it to be subclassed from Samples
if it is to "behave like Samples" for example by having a burnthin method. Would multiple inheritance make sense here?
@nabriis DoD approved.
Description:
Allow users to remove burnin after calling
get_samples
in when using Gibbs sampling more easily.Suggested change. Overload the dict object as "JointSamples" object, which contains multiple samples objects. Enable method
burnthin
such that users can call:The code would be this in
_samples.py
The repr would return stuff like
Definition of done: