org.biojava.bio.dist
Interface OrderNDistribution

All Superinterfaces:
Changeable, Distribution
All Known Implementing Classes:
AbstractOrderNDistribution

public interface OrderNDistribution
extends Distribution

Provides an N'th order distribution. This is a distribution over one alphabet which is conditioned on having previously observed one or more other symbols (potentially from different alphabets).

Order-N distributions are always over a CrossProductAlphabet.

Note: Unlike normal distributions, the total weights for all symbols in the overall alphabet do not sum to 1.0. Instead, the weights of each sub-distribution should sum to 1.0.

This would typically be used in conjunction with an OrderNSymbolList.

Since:
1.0
Author:
Thomas Down, Samiul Hasan, Matthew Pocock

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.biojava.bio.dist.Distribution
Distribution.NullModelForwarder
 
Field Summary
 
Fields inherited from interface org.biojava.bio.dist.Distribution
NULL_MODEL, WEIGHTS
 
Method Summary
 Collection conditionedDistributions()
          Get the conditioned distributions.
 Alphabet getConditionedAlphabet()
          Get the conditioned alphabet.
 Alphabet getConditioningAlphabet()
          Get the conditioning alphabet of this distribution.
 Distribution getDistribution(Symbol sym)
           
 void setDistribution(Symbol sym, Distribution dist)
          Set the distribution assocated with a symbol.
 
Methods inherited from interface org.biojava.bio.dist.Distribution
getAlphabet, getNullModel, getWeight, registerWithTrainer, sampleSymbol, setNullModel, setWeight
 
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
 

Method Detail

getConditioningAlphabet

Alphabet getConditioningAlphabet()
Get the conditioning alphabet of this distribution. If the `overall' alphabet is a cross-product of two alphabets, this will be the first of those alphabets. If it is a cross-product of more than two alphabets, the conditioning alphabet is the cross-product of all but the last alphabet.

Returns:
the conditioning Alphabet

getConditionedAlphabet

Alphabet getConditionedAlphabet()
Get the conditioned alphabet. This is the last alphabet in the distribution's overall cross-product. It will be the alphabet of all the sub-distributions contained within this OrderNDistribution.

Returns:
the conditioned Alphabet

conditionedDistributions

Collection conditionedDistributions()
Get the conditioned distributions.

Returns:
the conditioned distributions

setDistribution

void setDistribution(Symbol sym,
                     Distribution dist)
                     throws IllegalSymbolException,
                            IllegalAlphabetException
Set the distribution assocated with a symbol.

Parameters:
sym - the symbol in the conditioning Alphabet
dist - a distribution over the conditioned Alphabet
Throws:
IllegalSymbolException - if sym is not in the conditioning Alphabet
IllegalAlphabetException - if dist is not over the conditioned Alphabet

getDistribution

Distribution getDistribution(Symbol sym)
                             throws IllegalSymbolException
Throws:
IllegalSymbolException