public class MarkovModelDiffSM extends BayesianNetworkDiffSM implements Mutable, SamplingDifferentiableStatisticalModel
AbstractDifferentiableStatisticalModel for an inhomogeneous Markov model.
The modeled length can be modified which might be very important for de-novo motif discovery.ess, isTrained, logNormalizationConstant, numFreePars, nums, order, parameters, plugInParameters, structureMeasure, treesalphabets, length, rUNKNOWN| Constructor and Description |
|---|
MarkovModelDiffSM(AlphabetContainer alphabet,
int length,
double ess,
boolean plugInParameters,
InhomogeneousMarkov structureMeasure)
This constructor creates an instance without any prior for the modeled length.
|
MarkovModelDiffSM(AlphabetContainer alphabet,
int length,
double ess,
boolean plugInParameters,
InhomogeneousMarkov structureMeasure,
DurationDiffSM lengthPenalty)
This constructor creates an instance with an prior for the modeled length.
|
MarkovModelDiffSM(AlphabetContainer alphabet,
int length,
double ess,
boolean plugInParameters,
int order,
DurationDiffSM lengthPenalty)
This constructor creates an instance with an prior for the modeled length.
|
MarkovModelDiffSM(StringBuffer xml)
The standard constructor for the interface
Storable. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
fromXML(StringBuffer source)
This method is called in the constructor for the
Storable
interface to create a scoring function from a StringBuffer. |
double |
getLogPriorTerm()
This method computes a value that is proportional to
|
int |
getOrder()
Returns the order of the inhomogeneous Markov model.
|
int[][] |
getSamplingGroups(int parameterOffset)
Returns groups of indexes of parameters that shall be drawn
together in a sampling procedure
|
boolean |
modify(int offsetLeft,
int offsetRight)
Manually modifies the model.
|
void |
normalizeParameters()
Normalizes all parameters to log-probabilities.
|
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
addGradientOfLogPriorTerm, clone, createTrees, emitDataSet, fillInfixScore, getCurrentParameterSet, getCurrentParameterValues, getESS, getInfixFilter, getInstanceName, getLogNormalizationConstant, getLogPartialNormalizationConstant, getLogScoreAndPartialDerivation, getLogScoreFor, getMaximalMarkovOrder, getMaximumScore, getNumberOfParameters, getPositionDependentKMerProb, getPositionForParameter, getPWM, getSizeOfEventSpaceForRandomVariablesOfParameter, initializeFunction, initializeFunctionRandomly, isInitialized, precomputeNormalization, setParameters, setPlugInParameters, toHtml, toStringgetInitialClassParam, getLogProbFor, getLogProbFor, getLogProbFor, getLogScoreFor, getLogScoreFor, isNormalized, isNormalizedgetAlphabetContainer, getCharacteristics, getLength, getLogScoreAndPartialDerivation, getLogScoreAndPartialDerivation, getLogScoreFor, getLogScoreFor, getNumberOfRecommendedStarts, getNumberOfStarts, getNumericalCharacteristics, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddGradientOfLogPriorTerm, getESS, getLogNormalizationConstant, getLogPartialNormalizationConstant, getSizeOfEventSpaceForRandomVariablesOfParameter, isNormalizedclone, getCurrentParameterValues, getInitialClassParam, getLogScoreAndPartialDerivation, getLogScoreAndPartialDerivation, getLogScoreAndPartialDerivation, getNumberOfParameters, getNumberOfRecommendedStarts, initializeFunction, initializeFunctionRandomly, setParametersemitDataSet, getLogProbFor, getLogProbFor, getLogProbFor, getMaximalMarkovOrdergetAlphabetContainer, getCharacteristics, getInstanceName, getLength, getLogScoreFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getNumericalCharacteristics, isInitialized, toStringpublic MarkovModelDiffSM(AlphabetContainer alphabet, int length, double ess, boolean plugInParameters, int order, DurationDiffSM lengthPenalty) throws Exception
alphabet - the AlphabetContainer of the MarkovModelDiffSMlength - the initial length of the modeled sequencesess - the equivalent sample sizeplugInParameters - a switch whether to use plug-in parameters of notorder - the order of the Markov modellengthPenalty - the prior on the modeled sequence lengthException - if super class constructor throws an Exception or if the lengthPenalty does not allow the initial lengthpublic MarkovModelDiffSM(AlphabetContainer alphabet, int length, double ess, boolean plugInParameters, InhomogeneousMarkov structureMeasure) throws Exception
alphabet - the AlphabetContainer of the MarkovModelDiffSMlength - the initial length of the modeled sequencesess - the equivalent sample sizeplugInParameters - a switch whether to use plug-in parameters of notstructureMeasure - an InhomogeneousMarkov Measure for the structureException - if super class constructor throws an Exceptionpublic MarkovModelDiffSM(AlphabetContainer alphabet, int length, double ess, boolean plugInParameters, InhomogeneousMarkov structureMeasure, DurationDiffSM lengthPenalty) throws Exception
alphabet - the AlphabetContainer of the MarkovModelDiffSMlength - the initial length of the modeled sequencesess - the equivalent sample sizeplugInParameters - a switch whether to use plug-in parameters of notstructureMeasure - a InhomogeneousMarkov Measure for the structurelengthPenalty - the prior on the modeled sequence lengthException - if super class constructor throws an Exception or if the lengthPenalty does not allow the initial lengthpublic MarkovModelDiffSM(StringBuffer xml) throws NonParsableException
Storable.
Recreates a MarkovModelDiffSM from its XML
representation as saved by the method toXML().xml - the XML representation as StringBufferNonParsableException - if the XML code could not be parsedprotected void fromXML(StringBuffer source) throws NonParsableException
AbstractDifferentiableSequenceScoreStorable
interface to create a scoring function from a StringBuffer.fromXML in class BayesianNetworkDiffSMsource - the XML representation as StringBufferNonParsableException - if the StringBuffer could not be parsedAbstractDifferentiableSequenceScore.AbstractDifferentiableSequenceScore(StringBuffer)public StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.toXML in interface StorabletoXML in class BayesianNetworkDiffSMpublic double getLogPriorTerm()
DifferentiableStatisticalModel
DifferentiableStatisticalModel.getESS() * DifferentiableStatisticalModel.getLogNormalizationConstant() + Math.log( prior )
prior is the prior for the parameters of this model.getLogPriorTerm in interface DifferentiableStatisticalModelgetLogPriorTerm in interface StatisticalModelgetLogPriorTerm in class BayesianNetworkDiffSMDifferentiableStatisticalModel.getESS() * DifferentiableStatisticalModel.getLogNormalizationConstant() + Math.log( prior ).DifferentiableStatisticalModel.getESS(),
DifferentiableStatisticalModel.getLogNormalizationConstant()public int getOrder()
public boolean modify(int offsetLeft,
int offsetRight)
MutableoffsetLeft
and offsetRight define how many positions the left or
right border positions shall be moved. Negative numbers indicate moves to
the left while positive numbers correspond to moves to the right.public void normalizeParameters()
public int[][] getSamplingGroups(int parameterOffset)
SamplingDifferentiableStatisticalModelgetSamplingGroups in interface SamplingDifferentiableStatisticalModelparameterOffset - a global offset on the parameter indexesparameterOffset.