public class PairDistribution extends AbstractChangeable implements Serializable, Distribution
Distribution.NullModelForwarderNULL_MODEL, WEIGHTS| Constructor and Description |
|---|
PairDistribution(Distribution first,
Distribution second)
Create a new PairDistribution that represents the product of two other
distributions.
|
| Modifier and Type | Method and Description |
|---|---|
Alphabet |
getAlphabet()
The alphabet from which this spectrum emits symbols.
|
Distribution |
getNullModel()
Retrieve the null model Distribution that this Distribution recognizes.
|
protected static Distribution |
getNullModel(Distribution first,
Distribution second)
Get a uniform null model over a PairDistribution over [first,second].
|
double |
getWeight(Symbol sym)
Return the probability that Symbol s is emitted by this spectrum.
|
void |
registerWithTrainer(DistributionTrainerContext dtc)
Register this distribution with a training context.
|
void |
registerWithTrainer(ModelTrainer trainer)
Register this paired distribution with a model trainer.
|
Symbol |
sampleSymbol()
Sample a symbol from this state's probability distribution.
|
void |
setNullModel(Distribution nullModel)
Set the null model Distribution that this Distribution recognizes.
|
void |
setWeight(Symbol sym,
double weight)
Set the probability or odds that Symbol s is emitted by this state.
|
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic PairDistribution(Distribution first, Distribution second)
first - the first distributionsecond - the second distributionprotected static Distribution getNullModel(Distribution first, Distribution second)
first - the first Alphabetsecond - the second Alphabetpublic Alphabet getAlphabet()
DistributiongetAlphabet in interface Distributionpublic Distribution getNullModel()
DistributiongetNullModel in interface Distributionpublic void setNullModel(Distribution nullModel) throws IllegalAlphabetException, ChangeVetoException
DistributionsetNullModel in interface DistributionnullModel - the new null model DistributionIllegalAlphabetException - if the null model has the wrong alphabetChangeVetoException - if this Distirbution doesn't support setting
the null model, or if one of its listeners objectspublic void registerWithTrainer(ModelTrainer trainer)
trainer - the trainer to register this distribution with.public double getWeight(Symbol sym) throws IllegalSymbolException
DistributionReturn the probability that Symbol s is emitted by this spectrum.
If the symbol is ambiguou, then it is the sum of the probability that each one of the matching symbols was emitted.
getWeight in interface Distributionsym - the Symbol emittedIllegalSymbolException - if s is not from this state's alphabetpublic void setWeight(Symbol sym, double weight) throws ChangeVetoException
DistributionsetWeight in interface Distributionsym - the Symbol emittedweight - the probability of emitting that symbolChangeVetoException - if this state does not allow weights
to be tampered with, or if one of the listeners vetoed this changepublic void registerWithTrainer(DistributionTrainerContext dtc)
DistributionRegister this distribution with a training context.
This should be invoked from within dtc.addDistribution(). This method is responsible for constructing a suitable DistributionTrainer instance and registering it by calling dtc.registerDistributionTrainer(this, trainer). If the distribution is a view onto another distribution, it can force the other to be registered by calling dtc.addDistribution(other), and can then get on with registering it's own trainer.
registerWithTrainer in interface Distributiondtc - the DistributionTrainerContext with witch to register a trainerpublic Symbol sampleSymbol()
DistributionsampleSymbol in interface DistributionCopyright © 2020 BioJava. All rights reserved.