de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous
Class MEMTools

java.lang.Object
  extended by de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous.MEMTools

public class MEMTools
extends Object

Author:
Jens Keilwagen

Nested Class Summary
static class MEMTools.DualFunction
          The dual function to the constraint problem of learning MEM's.
 
Field Summary
static byte BGIS
          This constant can be used to specify that the model should use the blockwise iterative scaling for training.
static byte BGIS_P
          This constant can be used to specify that the model should use the blockwise iterative scaling for training.
static byte GIS
          This constant can be used to specify that the model should use the iterative scaling for training.
protected static double LIN_EPS
          The epsilon for the line search in an optimization using the Optimizer.
static byte SGIS
          This constant can be used to specify that the model should use the iterative scaling for training.
static byte SGIS_P
          This constant can be used to specify that the model should use the iterative scaling for training.
protected static double STARTDISTANCE
          The start distance for the line search in an optimization using the Optimizer.
 
Constructor Summary
MEMTools()
           
 
Method Summary
static double getExpPartOfProb(MEMConstraint[] constraints, int[] fulfilled, SequenceIterator sequence)
          This method computes the exponential part of the probability, i.e., everything except the normalization constant.
static void setParametersToValue(MEMConstraint[] constraint, double val)
          This method is a convenience method that sets the same value for all parameter of the constraints
static double train(MEMConstraint[] constraints, int[][] cond, SequenceIterator sequence, byte algorithm, TerminationCondition condition, OutputStream stream, int[] alphLen)
          This method approximates the distribution either analytically or numerically.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SGIS_P

public static final byte SGIS_P
This constant can be used to specify that the model should use the iterative scaling for training.

See Also:
Constant Field Values

BGIS_P

public static final byte BGIS_P
This constant can be used to specify that the model should use the blockwise iterative scaling for training.

See Also:
Constant Field Values

GIS

public static final byte GIS
This constant can be used to specify that the model should use the iterative scaling for training.

See Also:
Constant Field Values

SGIS

public static final byte SGIS
This constant can be used to specify that the model should use the iterative scaling for training.

See Also:
Constant Field Values

BGIS

public static final byte BGIS
This constant can be used to specify that the model should use the blockwise iterative scaling for training.

See Also:
Constant Field Values

LIN_EPS

protected static final double LIN_EPS
The epsilon for the line search in an optimization using the Optimizer.

See Also:
Constant Field Values

STARTDISTANCE

protected static final double STARTDISTANCE
The start distance for the line search in an optimization using the Optimizer.

See Also:
Constant Field Values
Constructor Detail

MEMTools

public MEMTools()
Method Detail

train

public static double train(MEMConstraint[] constraints,
                           int[][] cond,
                           SequenceIterator sequence,
                           byte algorithm,
                           TerminationCondition condition,
                           OutputStream stream,
                           int[] alphLen)
                    throws Exception
This method approximates the distribution either analytically or numerically.

Parameters:
constraints - the constraints to be used
cond - the conditions
sequence - the SequenceIterator used in normalization and numerical approximation
algorithm - the choice of numerical approximation
condition - the TerminationCondition for stopping the iterative algorithm
stream - a possibility for writing some information
alphLen - the alphabet length of all positions
Returns:
the normalization constant
Throws:
Exception - if something went wrong inside the algorithms

setParametersToValue

public static void setParametersToValue(MEMConstraint[] constraint,
                                        double val)
This method is a convenience method that sets the same value for all parameter of the constraints

Parameters:
constraint - the constraints
val - the value to be set

getExpPartOfProb

public static double getExpPartOfProb(MEMConstraint[] constraints,
                                      int[] fulfilled,
                                      SequenceIterator sequence)
This method computes the exponential part of the probability, i.e., everything except the normalization constant.

Parameters:
constraints - the constraint
fulfilled - an array allowing to store which specific constraint is used, can be null
sequence - a sequence iteration
Returns:
the exponential part of the probability