Refactor to store stan.sampling
directly to enable diagnostic methods
#87
Labels
new idea / feature request
New feature or request
refactor
Issues to remove tech debt or improve design
Currently we store
stan.sampling.extract()
asself.posterior_samples
. However, we want to be able to retrieve chain level information fromstan.sampling
directly to enable diagnostic methods.However, we can't currently retrieve
stan.sampling
directly since we never store the attribute.There are two proposed solutions:
stan.sampling
at the end of fit, and only callstan.sampling.extract()
for downstream methods such as predict, plot, diagnostic.self.posterior_samples
as-is, and additionally storestan.sampling.to_dataframe()
to something likeself.posterior_samples_chain
.The first may require refactoring of other methods when we don't use
stan.sampling
for example if we fit using VI, MAP, or Pyro.The second requires storing double the information that we would otherwise. An alternative approach to the second method is to parse the dataframe to the same state that our current
self.posterior_samples
is in, but poses a challenge because matrix samples are stored as a single column in a dataframe.Another alternative to the second method is to store only the chain info from the dataframe, but we'd have to guarantee order preservation between the dataframe and arrays in
stan.sampling.extract()
The text was updated successfully, but these errors were encountered: