How to print summary data printing upto 7 decimal places?

Does anyone know how to print the summary data up to 7 decimal places? For example, I have “idata_lv = pm.sample_smc()” and I am trying to print “az.summary(idata_lv)” but the table only gave me a result up to 3 decimal places. Example - The mean is close to 0.00166 but I get the rounded result of 0.002 that I don’t want.

Thanks a lot!

You can use the round_to argument to az.summary() to control the number of decimal places returned. Set it to "none" if you want the raw values. Doc page is here.

[edited to reflect @OriolAbril 's feedback below]

Do check the corresponding MCSE though. If you are interested in the mean, mcse_mean will give you the expected deviation across MCMC fits using the same model on the same data. In your case for example, if it were 0.0005 and you want to report 3 significant digits you’ll need to get more MCMC samples (for example fitting again amd using az.concat to merge the two of them). We would like to take into account the mcse when rounding as default, but it is not the case yet.

Potentially useful reference: How many iterations to run and how many digits to report

@cluhmann Thanks, I tried it but that doesn’t work. Any solution?

@OriolAbril Thanks! My MCSE is showing only 0.0 and I took 5000 draws for my model which is enough I believe. Can you help me out with how to get raw numbers not the rounded?

We would need for information about what "“doesn’t work” means.

@cluhmann I pass the the line “round_to=None” into the “az.summary(idata,round_to=None)” but still I am getting the rounded numbers not the raw numbers.

The docstring isn’t very clear, sorry. As you can see in the call signature, its default is None which means values are rounded to either 2 or 3 decimals depending on the column. To avoid rounding altogether you need to use "none" or "None" as strings, not the python None object.

That’s terrible API :slight_smile: Maybe use a sentinel flag for the default instead of None?