|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.sequenceScores.statisticalModels.trainable.discrete.Constraint
de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous.InhConstraint
de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous.MEMConstraint
public class MEMConstraint
This constraint can be used for any maximum entropy model (MEM) application.
Field Summary |
---|
Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous.InhConstraint |
---|
offset |
Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.discrete.Constraint |
---|
counts, freq, usedPositions |
Constructor Summary | |
---|---|
MEMConstraint(int[] pos,
int[] alphabetLength)
Creates a MEMConstraint as part of a (whole) model. |
|
MEMConstraint(int[] pos,
int[] alphabetLength,
int[] corrected_positions)
Creates a MEMConstraint as part of a model. |
|
MEMConstraint(StringBuffer xml)
The standard constructor for the interface Storable . |
Method Summary | |
---|---|
void |
addParameters(int offset,
IntList list,
MEMConstraint[] constraint,
double[] params,
int[] start)
|
protected void |
appendAdditionalInfo(StringBuffer xml)
This method appends additional information that is not stored in the base class to the StringBuffer . |
MEMConstraint |
clone()
|
int |
comparePosition(int offset,
MEMConstraint constr)
|
void |
draw(double ess)
Draws the parameters from a Dirichlet. |
void |
estimate(double ess)
Estimates the (smoothed) relative frequencies using the ess (equivalent sample size). |
protected void |
extractAdditionalInfo(StringBuffer xml)
This method parses additional information from the StringBuffer
that is not parsed in the base class. |
int |
getCorrectedPosition(int index)
Returns the value of the corrected position index . |
double |
getExpLambda(int index)
Returns the exponential value of ![]() index : ![]() |
double |
getFreq(int index)
Returns the current frequency with index index . |
double |
getLambda(int index)
Returns the value of ![]() |
protected String |
getXMLTag()
Returns the XML tag that is used for the class to en- or decode. |
void |
multiplyExpLambdaWith(int index,
double val)
Multiplies the exponential value of ![]() val :
![]() |
void |
reset()
This method resets all member variables that are in some way counters, frequencies, ... |
int |
satisfiesSpecificConstraint(SequenceIterator sequence)
Returns the index of the constraint that is satisfied by sequence . |
void |
setExpLambda(int index,
double val)
Sets the exponential value of ![]() |
void |
setLambda(int index,
double val)
Sets the value of ![]() |
String |
toString()
|
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous.InhConstraint |
---|
getDescription, satisfiesSpecificConstraint |
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.discrete.Constraint |
---|
add, add, estimateUnConditional, getCount, getFreq, getFreqInfo, getMarginalOrder, getNumberOfSpecificConstraints, getPosition, getPositions, resetCounts, toXML |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MEMConstraint(int[] pos, int[] alphabetLength) throws IllegalArgumentException
MEMConstraint
as part of a (whole) model.
pos
- the used positions (have to be sorted)alphabetLength
- an array containing the length of the the alphabet for each
position (of the whole model)
IllegalArgumentException
- if pos
is not sortedConstraint.Constraint(int[], int)
public MEMConstraint(int[] pos, int[] alphabetLength, int[] corrected_positions) throws IllegalArgumentException
MEMConstraint
as part of a model.
pos
- the used positions (have to be sorted)alphabetLength
- an array containing the length of the the alphabet for each
position (of the whole model)corrected_positions
- an array containing the corrected positions if the maximum
entropy model is decomposed into parts
IllegalArgumentException
- if pos
is not sorted or
pos.length != corrected_positions.length
InhConstraint.InhConstraint(int[], int[])
public MEMConstraint(StringBuffer xml) throws NonParsableException
Storable
.
Creates a new MEMConstraint
out of its XML representation.
xml
- the XML representation as StringBuffer
NonParsableException
- if the MEMConstraint
could not be reconstructed out
of the XML representation (the StringBuffer
could not
be parsed)Storable
,
InhConstraint.InhConstraint(StringBuffer)
Method Detail |
---|
public MEMConstraint clone() throws CloneNotSupportedException
clone
in class InhConstraint
CloneNotSupportedException
public void estimate(double ess)
Constraint
estimate
in class Constraint
ess
- the esspublic void draw(double ess)
ess
- the equivalent sample sizepublic int getCorrectedPosition(int index)
index
.
index
- the index of the position
public double getExpLambda(int index)
index
:
index
- the index
public double getLambda(int index)
index
- the index
public void multiplyExpLambdaWith(int index, double val)
val
:
val
to the
value of index
:
index
- the indexval
- the factor/valuepublic void reset()
Constraint
reset
in class Constraint
public int satisfiesSpecificConstraint(SequenceIterator sequence)
sequence
.
sequence
- the SequenceIterator
public double getFreq(int index)
Constraint
index
.
getFreq
in class Constraint
index
- the index
public void setExpLambda(int index, double val)
val
:
index
- the indexval
- the value to be setpublic void setLambda(int index, double val)
val
:
index
- the indexval
- the valuepublic String toString()
toString
in class Constraint
protected void appendAdditionalInfo(StringBuffer xml)
Constraint
StringBuffer
.
appendAdditionalInfo
in class InhConstraint
xml
- the StringBuffer
that is used for appending additional
informationprotected String getXMLTag()
Constraint
getXMLTag
in class Constraint
protected void extractAdditionalInfo(StringBuffer xml) throws NonParsableException
Constraint
StringBuffer
that is not parsed in the base class.
extractAdditionalInfo
in class InhConstraint
xml
- the StringBuffer
to be parsed
NonParsableException
- if something with the parsing went wrongpublic int comparePosition(int offset, MEMConstraint constr)
public void addParameters(int offset, IntList list, MEMConstraint[] constraint, double[] params, int[] start)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |