org.jasen.core.calculators
Class CompoundCalculator
java.lang.Object
org.jasen.core.calculators.CompoundCalculator
- All Implemented Interfaces:
- ProbabilityCalculator
- public class CompoundCalculator
- extends Object
- implements ProbabilityCalculator
Calculates the combined probability using the standard compound probability algorithm.
Specifically:
ab...n / ab...n + (1-a)(1-b)...(1-n)
Where:
'a' and 'b' are discrete probabilities
- Author:
- Jason Polites
Method Summary |
double |
calculate(double[] probabilities,
int start,
int end)
Calculates the combined probability of the set of probabilities passed |
CompoundCalculator
public CompoundCalculator()
calculate
public double calculate(double[] probabilities,
int start,
int end)
throws JasenException
- Description copied from interface:
ProbabilityCalculator
- Calculates the combined probability of the set of probabilities passed
- Specified by:
calculate
in interface ProbabilityCalculator
- Parameters:
probabilities
- The probability setstart
- The start index in the set to be usedend
- The end index in the set to be used
- Returns:
- A single primitive double between 0.0 and 1.0
- Throws:
JasenException