# probability

## probability

Source:

Probability

### Methods

#### (static) aggregate(pa1, pa2) → {number}

Source:

Aggregates two probability estimates from independent sources about the occurrence of a single event a. It returns the aggregated probability of occurrence of the event a. The assumption here is that the two probabilities (estimates) are not correlated with each other and the common prior probability of a is 0.5.

For a detailed explanation, refer to the paper titled Bayesian Group Belief by Franz Dietrich published in Social Choice and Welfare October 2010, Volume 35, Issue 4, pp 595–626.

##### Example
``````aggregate( 0.5, 0.6 );
// returns 0.6
aggregate( 0.5, 0.4 );
// returns 0.4
aggregate( 0.6, 0.6 );
// returns 0.6923076923076923
aggregate( 0.4, 0.6 );
// returns 0.5``````
##### Parameters:
Name Type Description
`pa1` number

first estimate of probability of occurrence of event a.

`pa2` number

second estimate of probability of occurrence of event a.

##### Returns:

the aggregated probability.

Type
number

#### (static) range4CI(successCount, totalCount, zscoreopt) → {object}

Source:

Computes probability from the observed count of successes (`successCount`) out of the total count (`totalCount`) along with its range for required level of Confidence Interval (CI) i.e. `zscore` . The range is the minimum and maximum probability values for given `zscore` or CI.

These computations are based on approach specified in the Wilson's Notes on Probable Inference, The Law of Succession, and Statistical Inference published in ASA's Journal.

For quick reference, typical value of `zscore` for 90% and 95% CI is approximately 1.645 and 1.960 respectively.

##### Example
``````range4CI( 1, 10 );
// returns {
//   probability: 0.18518871952479238,
//   min: 0.02263232984000629,
//   max: 0.34774510920957846
// }
range4CI( 10, 100 );
// returns {
//   probability: 0.1105389143431459,
//   min: 0.06071598345043355,
//   max: 0.16036184523585828
// }``````
##### Parameters:
Name Type Attributes Default Description
`successCount` number

observed count of successes out of

`totalCount` number

the total count.

`zscore` number <optional>
`1.645`

for the required level of CI.

##### Returns:

containing `probability`, `min` and `max`.

Type
object