Summarize inference data (HDI)


When I summarize the statistics of my inference data using az.summary(), one of the columns of the dataframe is hdi_3%. A highest density interval is supposed to be a range of two values, but in the summarized data each entry of this column is one specific value. What does this value mean?

I am sorry if this is a very basic question.

Thank you in advance!

1 Like

When requesting the 94% HDI (arviz’s current default), there should be 2 columns, one representing the left end of the interval (the value below which 3% of the posterior falls) and one representing the right end of the interval (the value above which 3% of the posterior falls). So hdi_3% is the former and there should be a hdi_97% column with the latter.

1 Like

To just add to @cluhmann , I found the following command very handy:

az.hdi(trace,var_names=["XXX"], hdi_prob = 0.80).values()

It will print out the hdi of whatever variables you want from your trace with the specified hdi_prob value.