Skip to content
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

Add more methods for basic summary stats for Chains #421

Open
ElOceanografo opened this issue May 19, 2023 · 3 comments
Open

Add more methods for basic summary stats for Chains #421

ElOceanografo opened this issue May 19, 2023 · 3 comments

Comments

@ElOceanografo
Copy link

I was recently surprised to find that calling std() on a Chains threw an error. Looking into it, it appears that only a few individual summary statistics (mean, cor, and quantile) are defined for Chains objects. Is there any reason not to implement methods for others, like cov, var, and std? If not I'm willing to make a PR.

@cpfiffer
Copy link
Member

cpfiffer commented May 24, 2023 via email

@ElOceanografo
Copy link
Author

I've started working on a PR and was wondering about what the return type for cov(chns) should be. A 2D AxisArray would seem to be a good choice. However, that's inconsistent with the ChainDataFrame returned by mean(chns). Is there a particular reason why mean returns a (somewhat) complicated structure like that, rather than a plain vector or categorical AxisArray?

@cpfiffer
Copy link
Member

I think the reason we defined it what way was to override a bunch of pretty-printing options. In the case of cov, I agree that it's maybe a little weird to have a ChainDataFrame since it's a square matrix. I'd be okay this time with it returning an AxisArray, but we should at some point do something a little more thoughtful about the ChainDataFrame type. That was code I added in. While it is pretty, it is a little bit of a pain in the ass to work with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants