Methods
(inner) bayesFactors(nlogpvals, capopt) → {Array.<Number>}
Calculate a Bayes factor exp(Z^2 / 2) based on p-values. If the Z-score is very large, the Bayes factors
are calculated in an inexact (capped) manner that makes the calculation tractable but preserves comparisons.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
nlogpvals |
Array.<Number> | An array of -log10(p-value) entries | ||
cap |
Boolean |
<optional> |
true | Whether to apply an inexact method. If false, some values in the return array may be represented as "Infinity", but the Bayes factors will be directly calculated wherever possible. |
- Source:
Returns:
An array of exp(Z^2 / 2) statistics
- Type
- Array.<Number>
(inner) normalizeProbabilities(scores) → {Array.<Number>}
Normalize so that sum of all elements = 1.0. This method must be applied to bayes factors before calculating any
credible set.
Parameters:
Name | Type | Description |
---|---|---|
scores |
Array.<Number> | An array of probability scores for all elements in the range |
- Source:
Returns:
Posterior probabilities
- Type
- Array.<Number>