DataType
- The data type of the elements.@PublicationReference(author="Wikipedia", title="Conditional Probability", type=WebPage, year=2014, url="http://en.wikipedia.org/wiki/Conditional_probability") public class ConditionalProbability<DataType> extends java.lang.Object
Constructor and Description |
---|
ConditionalProbability()
Constructor for new Conditional Probability object.
|
Modifier and Type | Method and Description |
---|---|
double |
computeConditionalProbability(java.util.Collection<DataType> prior,
DataType posterior,
ComputableDistribution<java.util.Collection<DataType>> priorDistribution,
ComputableDistribution<java.util.Collection<DataType>> posteriorDistribution)
Computes the conditional probability between a collection of objects and a new object.
|
double |
computeConditionalProbability(DataType prior,
DataType posterior,
ComputableDistribution<DataType> priorDistribution,
ComputableDistribution<java.util.Collection<DataType>> posteriorDistribution)
Computes the conditional probability between two objects.
|
double |
computeConditionalProbabilityWhenDataTypeHasHistoricalData(DataType prior,
DataType posterior,
ComputableDistribution<DataType> priorDistribution,
ComputableDistribution<DataType> posteriorDistribution)
Computes the conditional probability between two objects.
|
public ConditionalProbability()
public double computeConditionalProbability(java.util.Collection<DataType> prior, DataType posterior, ComputableDistribution<java.util.Collection<DataType>> priorDistribution, ComputableDistribution<java.util.Collection<DataType>> posteriorDistribution)
prior
- The collection of objects that's conditioned on. If conditional probability is thought of as "A given B", this is the B.posterior
- The new object; finding its probability given the prior. This is the "A" in the conditional probability definition.priorDistribution
- The distribution which the prior is over.posteriorDistribution
- The distribution which the posterior is over. If the prior contains n elements, this is a distribution over collections of size n+1public double computeConditionalProbability(DataType prior, DataType posterior, ComputableDistribution<DataType> priorDistribution, ComputableDistribution<java.util.Collection<DataType>> posteriorDistribution)
prior
- The object that's conditioning the posterior. If conditional probability is thought of as "A given B", this is the B.posterior
- The object whose probability is based off the prior. This is the "A" in the conditional probability definition.priorDistribution
- A distribution for the objects.posteriorDistribution
- A distribution for all pairs of objects.public double computeConditionalProbabilityWhenDataTypeHasHistoricalData(DataType prior, DataType posterior, ComputableDistribution<DataType> priorDistribution, ComputableDistribution<DataType> posteriorDistribution)
prior
- The object that's conditioning the posterior. If conditional probability is thought of as "A given B", this is the B.posterior
- The object whose probability is based off the prior. This is the "A" in the conditional probability definition.priorDistribution
- A distribution for the objects.posteriorDistribution
- A distribution for all pairs of objects.