Skip to content

← statistics package

HighestDensityInterval

Calculate bounds of the highest density interval along some axis, also known as the smallest credible interval or highest posterior density interval when applied to samples from a Bayesian posterior distribution.

This is a Bayesian analog to confidence intervals, also known as smallest credible interval. While for a symmetric distribution, this will be a pair of standard quantiles, for asymmetric distributions and empirical samples, this amounts to finding the tightest interval that contains the specified probability mass. Note that such an interval does not necessarily include the mean or median of the data. This will replace the original axis by an axis with two elements, the lower and upper bounds of the interval. The type of the axis can be selected via the new axis property. More Info... Version 0.5.0

Ports/Properties

data

Data to process.

verbose name
Data
default value
None
port type
DataPort
value type
AnyNumeric (can be None)
data direction
INOUT

axis

Axis along which to calculate the HDI. You can also enter the axis label here as in feature.mylabel.

verbose name
Axis
default value
distribution
port type
ComboPort
value type
str (can be None)

prob_mass

Probability mass within the interval. Typical choices are 0.9 and 0.95.

verbose name
Probability Mass
default value
0.9
port type
FloatPort
value type
float (can be None)

stream

Name of stream to process. Wildcards are supported, so mystream* will process all streams whose name starts with mystream.

verbose name
Stream
default value
None
port type
StringPort
value type
str (can be None)

new_axis

Type of the new axis to create. If set to 'feature', a new feature axis will be created with the bounds as string labels. If set to 'statistic', a new statistic axis will be created. You can also specify a desired new label for the axis in here by writing axistype.mylabel.

verbose name
New Axis
default value
statistic
port type
ComboPort
value type
str (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)