Module: marking

Methods

(inner) findCredibleSet(probs, cutoffopt) → {Array.<Number>}

Given an array of probabilities, determine which elements of the array fall within the X% credible set, where X is the cutoff value.
Parameters:
Name Type Attributes Default Description
probs Array.<Number> Calculated probabilities used to rank the credible set. This method will normalize the provided input to ensure that the values sum to 1.0.
cutoff Number <optional>
0.95 Keep taking items until we have accounted for >= this fraction of the total probability. For example, 0.95 would represent the 95% credible set.
Source:
Returns:
An array with posterior probabilities (for the items in the credible set), and zero for all other elements. This array is the same length as the provided probabilities array.
Type
Array.<Number>

(inner) markBoolean(credibleSetMembers) → {Array.<Boolean>}

Given a numeric pre-calculated credible set, return an array of booleans where true denotes membership in the credible set. This is a helper method used when visualizing the members of the credible set by raw membership.
Parameters:
Name Type Description
credibleSetMembers Array.<Number> An array indicating contributions to the credible set, where non-members are represented by some falsy value.
Source:
Returns:
An array of booleans identifying whether or not each item is in the credible set. This array is the same length as the provided credible set array.
Type
Array.<Boolean>

(inner) rescaleCredibleSet(credibleSetMembers) → {Array.<Number>}

Visualization helper method for rescaling data to a predictable output range, eg when range for a color gradient must be specified in advance. Given an array of probabilities for items in a credible set, rescale the probabilities within only the credible set to their total sum. Example for 95% credible set: [0.92, 0.06, 0.02] -> [0.938, 0.061, 0]. The first two elements here belong to the credible set, the last element does not.
Parameters:
Name Type Description
credibleSetMembers Array.<Number> Calculated probabilities used to rank the credible set.
Source:
Returns:
The fraction of credible set probabilities each item accounts for. This array is the same length as the provided credible set.
Type
Array.<Number>