|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.models.discrete.Constraint
de.jstacs.models.discrete.homogeneous.HomogeneousModel.HomCondProb
protected class HomogeneousModel.HomCondProb
This class handles the (conditional) probabilities of a homogeneous model in a fast way.
| Field Summary |
|---|
| Fields inherited from class de.jstacs.models.discrete.Constraint |
|---|
counts, freq, usedPositions |
| Constructor Summary | |
|---|---|
HomogeneousModel.HomCondProb(HomogeneousModel.HomCondProb old)
Creates a new HomogeneousModel.HomCondProb instance from a given one. |
|
HomogeneousModel.HomCondProb(int[] pos,
int n)
The main constructor. |
|
HomogeneousModel.HomCondProb(StringBuffer xml)
The standard constructor for the interface Storable
. |
|
| Method Summary | |
|---|---|
void |
addAll(Sequence seq,
double weight,
int start,
int prevIndex)
Adds the given weight to the counts corresponding to the
Sequence seq from start to the end
of the Sequence. |
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()
|
| Methods inherited from class de.jstacs.models.discrete.Constraint |
|---|
add, add, clone, getCount, getFreq, getFreq, getFreqInfo, getMarginalOrder, getNumberOfSpecificConstraints, getPosition, getPositions, reset, resetCounts, toXML |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HomogeneousModel.HomCondProb(int[] pos,
int n)
HomogeneousModel.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 HomogeneousModel.HomCondProb(StringBuffer xml)
throws NonParsableException
Storable
. Creates a new HomogeneousModel.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 HomogeneousModel.HomCondProb(HomogeneousModel.HomCondProb old)
HomogeneousModel.HomCondProb instance from a given one. This
constructor is used for cloning instances, since any instance is an
inner instance of a HomogeneousModel.
old - the old instance to be clonedHomogeneousModel.HomCondProb#HomCondProb(int[],int)| Method Detail |
|---|
public void estimate(double ess)
Constraint
estimate in class Constraintess - the esspublic double getLnFreq(int index)
index.
index - the given index
index
public int satisfiesSpecificConstraint(Sequence seq,
int start)
ConstraintSequence seq beginning at position
start.
satisfiesSpecificConstraint in class Constraintseq - the sequencestart - the start position
public String toString()
toString in class Constraint
public final void addAll(Sequence seq,
double weight,
int start,
int prevIndex)
weight to the counts corresponding to the
Sequence seq from start to the end
of the Sequence.
seq - the Sequenceweight - the given weightstart - the first index within the SequenceprevIndex - the previous index used for adding a countprotected void appendAdditionalInfo(StringBuffer xml)
ConstraintStringBuffer.
appendAdditionalInfo in class Constraintxml - 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 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 parameters
protected void extractAdditionalInfo(StringBuffer xml)
throws NonParsableException
ConstraintStringBuffer
that is not parsed in the base class.
extractAdditionalInfo in class Constraintxml - the StringBuffer to be parsed
NonParsableException - if something with the parsing went wrong
public String getDescription(AlphabetContainer con,
int i)
Constrainti.
getDescription in class Constraintcon - the AlphabetContaineri - the encoded symbol
i
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||