protected class HomogeneousTrainSM.HomCondProb extends Constraint
counts, freq, usedPositions
Constructor and Description |
---|
HomCondProb(HomogeneousTrainSM.HomCondProb old)
Creates a new
HomogeneousTrainSM.HomCondProb instance from a given one. |
HomCondProb(int[] pos,
int n)
The main constructor.
|
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, toXML
public 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 HomCondProb(StringBuffer xml) throws NonParsableException
Storable
. Creates a new HomogeneousTrainSM.HomCondProb
instance out of its XML
representation.xml
- the XML representation as StringBuffer
NonParsableException
- if the StringBuffer
could not be parsedStorable
,
Constraint.Constraint(StringBuffer)
public 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)
Constraint
estimate
in class Constraint
ess
- the esspublic double getLnFreq(int index)
index
.index
- the given indexindex
public int satisfiesSpecificConstraint(Sequence seq, int start)
Constraint
Sequence
seq
beginning at position
start
.satisfiesSpecificConstraint
in class Constraint
seq
- the sequencestart
- the start positionpublic String toString()
toString
in class Constraint
public final void addAll(Sequence seq, double weight, int start, int prevIndex)
protected void appendAdditionalInfo(StringBuffer xml)
Constraint
StringBuffer
.appendAdditionalInfo
in class Constraint
xml
- the StringBuffer
that is used for appending additional
informationprotected String getXMLTag()
Constraint
getXMLTag
in class Constraint
protected void estimateUnConditional(int start, int end, double pc, boolean exceptionWhenNoData)
Constraint
estimateUnConditional
in class Constraint
start
- 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
Constraint
StringBuffer
that is not parsed in the base class.extractAdditionalInfo
in class Constraint
xml
- the StringBuffer
to be parsedNonParsableException
- if something with the parsing went wrongpublic String getDescription(AlphabetContainer con, int i)
Constraint
i
.getDescription
in class Constraint
con
- the AlphabetContainer
i
- the encoded symboli