-
-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better API for obtaining posterior point estimates & more #1899
Comments
Intro
mean and median are already available via xarray, so I think we should not reimplement those. Doing It might be interesting to try and make the mode we use in some plots available with a similar api. It should not be too difficult given it's already implemented if using
Never used that but this looks general enough to live in xarray directly and seems to be somewhat available already: https://xarray.pydata.org/en/stable/generated/xarray.cov.html. If this is not good enough we should try and push those improvements directly to xarray.
Is this the same (or would be solved satisfactorly) as #1725 (that fixes #1469)?
The name might not have been the best choice but Also note that Practical remarks
|
As part of a notebook for pymc (pymc-devs/pymc-examples#241, seen here) to support the addition of the Generalized Extreme Value distribution (pymc-devs/pymc#5085), I had a few complexities processing results with the current API.
I'm raising this issue here to see if there is appetite for a PR along the proposed lines here.
As can be seen, this uses/abuses a few back-end Arviz functions. It would seem better to have a cleaner API to access the point estimates that can be obtained in the hdi plots parameters
point_estimate
argument, such asmean
,mode
,median
. Something like:az.get_point_estimate(point_estimate='mode', var_names=["μ", "σ", "ξ"])
.Again, this is a bit non-bayesian, but is useful for comparison with results from other sources. So something like:
az.get_var_covar(var_names=["μ", "σ", "ξ"])
.Again, looking at that
InferenceData
accessor to the xarraydrop_vars
, it would be neat if there was a comparableget_vars
which returned the results for the selected variables - this functionality is already built-in of course, as is used through the arguments to many of the plot functions. But something directly like:trace["posterior"].get_vars(["μ", "σ", "ξ"])
would be helpful.More minor: It seems that to examine the prior predictive checks, we should now use the
plot_posterior
function. I suspect aplot_prior
wrapper would be more logical and more readable code.The text was updated successfully, but these errors were encountered: