protected class HomogeneousTrainSM.HomCondProb extends Constraint
counts, freq, usedPositions| Constructor and Description |
|---|
HomogeneousTrainSM.HomCondProb(HomogeneousTrainSM.HomCondProb old)
Creates a new
HomogeneousTrainSM.HomCondProb instance from a given one. |
HomogeneousTrainSM.HomCondProb(int[] pos,
int n)
The main constructor.
|
HomogeneousTrainSM.HomCondProb(StringBuffer xml)
The standard constructor for the interface
Storable
. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(Sequence seq,
double weight,
int start,
int prevIndex)
|
protected void |
appendAdditionalInfo(StringBuffer xml)
This method appends additional information that is not stored in the base
class to the
StringBuffer. |
void |
estimate(double ess)
Estimates the (smoothed) relative frequencies using the ess
(equivalent sample size).
|
protected void |
estimateUnConditional(int start,
int end,
double pc,
boolean exceptionWhenNoData)
Estimates unconditionally.
|
protected void |
extractAdditionalInfo(StringBuffer xml)
This method parses additional information from the
StringBuffer
that is not parsed in the base class. |
String |
getDescription(AlphabetContainer con,
int i)
Returns the decoded symbol for the encoded symbol
i. |
double |
getLnFreq(int index)
Returns the logarithmic frequency at a given position
index. |
protected String |
getXMLTag()
Returns the XML tag that is used for the class to en- or decode.
|
int |
satisfiesSpecificConstraint(Sequence seq,
int start)
This method returns the index of the specific constraint that is
fulfilled by the
Sequence seq beginning at position
start. |
String |
toString() |
add, add, clone, getCount, getFreq, getFreq, getFreqInfo, getMarginalOrder, getNumberOfSpecificConstraints, getPosition, getPositions, reset, resetCounts, toXMLpublic HomogeneousTrainSM.HomCondProb(int[] pos,
int n)
HomogeneousTrainSM.HomCondProb instance and
checks that each position is used maximally once. In all/most cases
pos is new int[]{0,1,2...} and n
is Math.pow(Alphabet.length(),pos.length).pos - the used positions (will be cloned), have to be
non-negativen - the number of specific constraintsConstraint.Constraint(int[], int)public HomogeneousTrainSM.HomCondProb(StringBuffer xml) throws NonParsableException
Storable
. Creates a new HomogeneousTrainSM.HomCondProb instance out of its XML
representation.xml - the XML representation as StringBufferNonParsableException - if the StringBuffer could not be parsedStorable,
Constraint.Constraint(StringBuffer)public HomogeneousTrainSM.HomCondProb(HomogeneousTrainSM.HomCondProb old)
HomogeneousTrainSM.HomCondProb instance from a given one. This
constructor is used for cloning instances, since any instance is an
inner instance of a HomogeneousTrainSM.old - the old instance to be clonedHomogeneousTrainSM.HomCondProb#HomCondProb(int[],int)public void estimate(double ess)
Constraintestimate in class Constraintess - the esspublic double getLnFreq(int index)
index.index - the given indexindexpublic int satisfiesSpecificConstraint(Sequence seq, int start)
ConstraintSequence seq beginning at position
start.satisfiesSpecificConstraint in class Constraintseq - the sequencestart - the start positionpublic String toString()
toString in class Constraintpublic final void addAll(Sequence seq, double weight, int start, int prevIndex)
protected void appendAdditionalInfo(StringBuffer xml)
ConstraintStringBuffer.appendAdditionalInfo in class Constraintxml - the StringBuffer that is used for appending additional
informationprotected String getXMLTag()
ConstraintgetXMLTag in class Constraintprotected void estimateUnConditional(int start,
int end,
double pc,
boolean exceptionWhenNoData)
ConstraintestimateUnConditional in class Constraintstart - the start indexend - the end indexpc - the pseudocount for each parameterexceptionWhenNoData - indicates if an (runtime) exception is thrown if no data was
available to estimate the parametersprotected void extractAdditionalInfo(StringBuffer xml) throws NonParsableException
ConstraintStringBuffer
that is not parsed in the base class.extractAdditionalInfo in class Constraintxml - the StringBuffer to be parsedNonParsableException - if something with the parsing went wrongpublic String getDescription(AlphabetContainer con, int i)
Constrainti.getDescription in class Constraintcon - the AlphabetContaineri - the encoded symboli