-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Adapt summary function to circular variables #1313
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Can show an example (screenshot to this PR is fine)
(I just wanted to see does it create nan for other stats or what)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can show an example (screenshot to this PR is fine)
Plus now that you have added the glycan
example you can add examples to the docstring of using the new argument. If you plan to modify the glycan example maybe it's better to wait for the new example though, just commenting to make sure we document and properly advertise the cool new features.
Thanks for your comments @OriolAbril and @ahartikainen. I updated the PR description. As you can see, circular statistics are placed only where the circular variables are, so no need for extra columns. Maybe waiting for the new example to update the doctrings will be better but I will check with @aloctavodia |
That looks great. This PR doesn't need to address this, but should we add a column for Also (I forgot already this) are those in degrees or in radians? |
Codecov Report
@@ Coverage Diff @@
## master #1313 +/- ##
=======================================
Coverage 93.12% 93.12%
=======================================
Files 101 101
Lines 10034 10038 +4
=======================================
+ Hits 9344 9348 +4
Misses 690 690
Continue to review full report at Codecov.
|
arviz/stats/stats.py
Outdated
|
||
if kind != "diagnostics": | ||
for metric, circ_stat in zip( | ||
metrics[:5], (circ_mean, circ_sd, circ_hdi_lower, circ_hdi_higher, circ_mcse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats 5 here? Would add comment for the magic number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree about the comment.
The 5 is related to the "stats" columns, the diagnostics are computed the same for linear and circular variables. Actually, we have to think if the diagnostics also need to be changed for circular variables (not part of this PR).
Co-authored-by: Oriol Abril-Pla <[email protected]>
Not sure about having a "true column" for circular variables. I think a better approach is to have that information included in the InferenceData object. |
This angles are in radians |
Description
In this PR I changed the
az.summary
function to display statistics for circular variables more neatly. It is related to issue #339.torsionals = az.load_arviz_data('glycan_torsion_angles')
az.summary(torsionals, circ_var_names=['tors'])
outputs:
Checklist