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

stansummary save to CSV doesn't respect default significant figures #1088

Open
mitzimorris opened this issue Mar 28, 2022 · 1 comment
Open
Assignees
Labels

Comments

@mitzimorris
Copy link
Member

Summary:

Utility stansummary use of sig figs combined with scientific notation results in only 2 digit's worth of precision.

Description:

cf: stan-dev/cmdstanpy#550 (comment)

It seems that the CSV output doesn't respect the default sig-figs that the docs cite.

without specifying -s:

name,Mean,MCSE,StdDev,5%,50%,95%,N_Eff,N_Eff/s,R_hat
"lp__",-7.29137,0.0194958,0.751762,-8.82028,-6.99659,-6.74977,1486.9,19062.8,0.999907
with -s 2

name,Mean,MCSE,StdDev,5%,50%,95%,N_Eff,N_Eff/s,R_hat
"lp__",-7.3,0.019,0.75,-8.8,-7,-6.7,1.5e+03,1.9e+04,1
I should note that the values displayed in stdout do seem to have a default value of 2 significant figures.

Reproducible Steps:

Please report steps to reproduce the issue. If it's not possible to reproduce, please include a description of how you discovered the issue.

If you have a reproducible example, please include it.

Current Output:

The current output. Knowing what is the current behavior is useful.

Expected Output:

Describe what you expect the output to be. Knowing the correct behavior is also very useful.

Additional Information:

Provide any additional information here.

Current Version:

v2.29.2

@mitzimorris mitzimorris self-assigned this Mar 28, 2022
@WardBrian
Copy link
Member

I think 6 is actually a better default value, but the issue is it is not documented. More discussion here:
https://discourse.mc-stan.org/t/cmdstanpy-error-in-fit-summary/26939/13?u=wardbrian

Furthermore, as is pointed out earlier in that thread, std::setprecision does not really align with the natural notion of 'significant figures'

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

No branches or pull requests

2 participants