public abstract class DurationDiffSM extends PositionDiffSM
ExtendedZOOPSDiffSM
Modifier and Type | Field and Description |
---|---|
protected int |
delta
The difference of maximal and minimal value.
|
protected double |
ess
The equivalent sample size.
|
protected int |
max
The maximal value.
|
protected int |
min
The minimal value.
|
internal
alphabets, length, r
UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
DurationDiffSM(int min,
int max,
double ess)
The default constructor.
|
protected |
DurationDiffSM(StringBuffer source)
This is the constructor for
Storable . |
Modifier and Type | Method and Description |
---|---|
abstract void |
adjust(int[] length,
double[] weight)
This method adjust the parameter based on the given statistic.
|
protected void |
fromXML(StringBuffer xml)
This method is called in the constructor for the
Storable
interface to create a scoring function from a StringBuffer . |
double |
getESS()
Returns the equivalent sample size (ess) of this model, i.e.
|
double |
getLogNormalizationConstant()
Returns the logarithm of the sum of the scores over all sequences of the event space.
|
double |
getLogPartialNormalizationConstant(int parameterIndex)
Returns the logarithm of the partial normalization constant for the parameter with index
parameterIndex . |
int |
getMax()
Returns the maximal value that can be scored.
|
int |
getMin()
Returns the minimal value that can be scored.
|
int |
getNumberOfPossibilities()
Returns the number of different possibilities that can be scored.
|
protected abstract String |
getRNotation(String distributionName,
NumberFormat nf)
This method returns the distribution in R notation.
|
int |
getSizeOfEventSpaceForRandomVariablesOfParameter(int index)
Returns the size of the event space of the random variables that are
affected by parameter no.
|
abstract void |
initializeUniformly()
This method set special parameters that lead to an uniform distribution.
|
boolean |
isPossible(int... positions)
This method returns
true if the given positions are in the domain of the
PositionDiffSM. |
void |
modify(int delta)
This method modifies the underlying
AlphabetContainer . |
boolean |
next()
This method steps to the next reasonable outcome if possible.
|
void |
reset()
This method resets the iterator to the initial state (first reasonable output) so that it can be used again.
|
String |
toString(NumberFormat nf)
This method returns a
String representation of the instance. |
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
clone, getInternalPosition, getLogScore, getLogScoreAndPartialDerivation, getLogScoreAndPartialDerivation, getLogScoreAndPartialDerivationForInternal, getLogScoreFor, getLogScoreForInternal, getValuesFromSequence
emitDataSet, getInitialClassParam, getLogProbFor, getLogProbFor, getLogProbFor, getLogScoreFor, getLogScoreFor, getMaximalMarkovOrder, isNormalized, isNormalized
getAlphabetContainer, getCharacteristics, getLength, getLogScoreAndPartialDerivation, getLogScoreAndPartialDerivation, getLogScoreFor, getLogScoreFor, getNumberOfRecommendedStarts, getNumberOfStarts, getNumericalCharacteristics, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addGradientOfLogPriorTerm, getLogPriorTerm
getCurrentParameterValues, getLogScoreAndPartialDerivation, getLogScoreAndPartialDerivation, getNumberOfParameters, getNumberOfRecommendedStarts, initializeFunction, initializeFunctionRandomly, setParameters
getAlphabetContainer, getCharacteristics, getInstanceName, getLength, getLogScoreFor, getLogScoreFor, getNumericalCharacteristics, isInitialized
protected double ess
protected int min
protected int max
protected int delta
protected DurationDiffSM(int min, int max, double ess)
min
- the minimal valuemax
- the maximal valueess
- the equivalent sample sizeprotected DurationDiffSM(StringBuffer source) throws NonParsableException
source
- the XML representation as StringBuffer
NonParsableException
- if the XML representation could not be parsedpublic StringBuffer toXML()
Storable
StringBuffer
of an
instance of the implementing class.toXML
in interface Storable
toXML
in class PositionDiffSM
protected void fromXML(StringBuffer xml) throws NonParsableException
AbstractDifferentiableSequenceScore
Storable
interface to create a scoring function from a StringBuffer
.fromXML
in class PositionDiffSM
xml
- the XML representation as StringBuffer
NonParsableException
- if the StringBuffer
could not be parsedAbstractDifferentiableSequenceScore.AbstractDifferentiableSequenceScore(StringBuffer)
public void reset()
PositionDiffSM
reset
in class PositionDiffSM
public boolean next()
PositionDiffSM
next
in class PositionDiffSM
true
if a next reasonable outcome could be set, otherwise false
public int getSizeOfEventSpaceForRandomVariablesOfParameter(int index)
DifferentiableStatisticalModel
index
, i.e. the product of the
sizes of the alphabets at the position of each random variable affected
by parameter index
. For DNA alphabets this corresponds to 4
for a PWM, 16 for a WAM except position 0, ...index
- the index of the parameterpublic final double getESS()
DifferentiableStatisticalModel
public boolean isPossible(int... positions)
PositionDiffSM
true
if the given positions
are in the domain of the
PositionDiffSM.isPossible
in class PositionDiffSM
positions
- the positions to be testedtrue
if the given positions
are in the domain of the
PositionDiffSMpublic final int getMin()
public final int getMax()
public int getNumberOfPossibilities()
public abstract void initializeUniformly()
public abstract void adjust(int[] length, double[] weight)
length
- an array containing length valuesweight
- an array containing corresponding weight valuespublic void modify(int delta)
AlphabetContainer
. This might be necessary if the motif length changed.delta
- the changeMutable.modify(int, int)
,
MutableMotifDiscoverer.modifyMotif(int, int, int)
public final double getLogNormalizationConstant()
DifferentiableStatisticalModel
public final double getLogPartialNormalizationConstant(int parameterIndex) throws Exception
DifferentiableStatisticalModel
parameterIndex
. This is the logarithm of the partial derivation of the
normalization constant for the parameter with index
parameterIndex
,
parameterIndex
- the index of the parameterException
- if something went wrong with the normalizationDifferentiableStatisticalModel.getLogNormalizationConstant()
protected abstract String getRNotation(String distributionName, NumberFormat nf)
distributionName
- the name of the distribution, e.g., "p"nf
- the NumberFormat
to be used, can be null
REnvironment
public String toString(NumberFormat nf)
SequenceScore
String
representation of the instance.nf
- the NumberFormat
for the String
representation of parameters or probabilitiesString
representation of the instance