Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.scoringFunctions
Interface NormalizableScoringFunction

All Superinterfaces:
  Cloneable, ScoringFunction, Storable

All Known Implementing Classes:
  AbstractMixtureScoringFunction, AbstractNormalizableScoringFunction, BayesianNetworkScoringFunction, DurationScoringFunction, HiddenMotifsMixture, HMM0ScoringFunction, HMMScoringFunction, HomogeneousScoringFunction, IndependentProductScoringFunction, MixtureDuration, MixtureScoringFunction, MRFScoringFunction, MutableMarkovModelScoringFunction, NormalizedScoringFunction, PositionScoringFunction, SkewNormalLikeScoringFunction, StrandScoringFunction, UniformDurationScoringFunction, UniformHomogeneousScoringFunction, UniformScoringFunction, VariableLengthScoringFunction

    public interface NormalizableScoringFunction

extends ScoringFunction

The interface for normalizable `ScoringFunction`s.

Author:
  Jens Keilwagen, Jan Grau

Field Summary

Fields inherited from interface de.jstacs.scoringFunctions.ScoringFunction
`UNKNOWN`

Method Summary
`void` | `addGradientOfLogPriorTerm(double[] grad, int start)` This method computes the gradient of `getLogPriorTerm()` for each parameter of this model.
`double` | `getEss()` Returns the equivalent sample size (ess) of this model, i.e. the equivalent sample size for the class or component that is represented by this model.
`double` | `getInitialClassParam(double classProb)` Returns the initial class parameter for the class this `ScoringFunction` is responsible for, based on the class probability `classProb`.
`double` | `getLogPriorTerm()` This method computes a value that is proportional to `getEss()` `* Math.log( `getNormalizationConstant()` ) + Math.log( prior ).`
`double` | `getNormalizationConstant()` Returns the sum of the scores over all sequences of the event space.
`double` | `getPartialNormalizationConstant(int parameterIndex)` Returns the partial normalization constant for the parameter with index `parameterIndex`.
`int` | `getSizeOfEventSpaceForRandomVariablesOfParameter(int index)` Returns the size of the event space of the random variables that are affected by parameter no.
`boolean` | `isNormalized()` This method indicates whether the implemented score is already normalized to 1 or not.

Methods inherited from interface de.jstacs.scoringFunctions.ScoringFunction
`clone, getAlphabetContainer, getCurrentParameterValues, getInstanceName, getLength, getLogScore, getLogScore, getLogScoreAndPartialDerivation, getLogScoreAndPartialDerivation, getNumberOfParameters, getNumberOfRecommendedStarts, initializeFunction, initializeFunctionRandomly, isInitialized, setParameters`

Methods inherited from interface de.jstacs.Storable
`toXML`

Method Detail

### getSizeOfEventSpaceForRandomVariablesOfParameter

    int getSizeOfEventSpaceForRandomVariablesOfParameter(int index)

  Returns the size of the event space of the random variables that are affected by parameter no. `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, ...

  Parameters:
    `index` - the index of the parameter
  Returns:
    the size of the event space

### getNormalizationConstant

    double getNormalizationConstant()

  Returns the sum of the scores over all sequences of the event space.

  Returns:
    the normalization constant Z

### getPartialNormalizationConstant

    double getPartialNormalizationConstant(int parameterIndex)
                                           throws Exception

  Returns the partial normalization constant for the parameter with index `parameterIndex`. This is the partial derivation of the normalization constant for the parameter with index `parameterIndex`, in LaTex notation: `\frac{\partial Z(\lambda)}{\partial \lambda_{index}}`.

  Parameters:
    `parameterIndex` - the index of the parameter
  Returns:
    the partial normalization constant
  Throws:
    `Exception` - if something went wrong with the normalization
  See Also:
    `getNormalizationConstant()`

### getEss

    double getEss()

  Returns the equivalent sample size (ess) of this model, i.e. the equivalent sample size for the class or component that is represented by this model.

  Returns:
    the equivalent sample size.

### getLogPriorTerm

    double getLogPriorTerm()

  This method computes a value that is proportional to

  `getEss()` `* Math.log( `getNormalizationConstant()` ) + Math.log( prior ).`

  where `prior` is the prior for the parameters of this model.

  Returns:
    a value that is proportional to `getEss()` `* Math.log( `getNormalizationConstant()` ) + Math.log( prior ).`
  See Also:
    `getEss()`, `getNormalizationConstant()`

### addGradientOfLogPriorTerm

    void addGradientOfLogPriorTerm(double[] grad,
                                   int start)
                                   throws Exception

  This method computes the gradient of `getLogPriorTerm()` for each parameter of this model. The results are added to the array `grad` beginning at index `start`.

  Parameters:
    `grad` - the array of gradients
    `start` - the start index in the `grad` array, where the partial derivations for the parameters of this models shall be entered
  Throws:
    `Exception` - if something went wrong with the computing of the gradients
  See Also:
    `getLogPriorTerm()`

### isNormalized

    boolean isNormalized()

  This method indicates whether the implemented score is already normalized to 1 or not. The standard implementation returns `false`.

  Returns:
    `true` if the implemented score is already normalized to 1, `false` otherwise

### getInitialClassParam

    double getInitialClassParam(double classProb)

  Description copied from interface: `ScoringFunction`
  Returns the initial class parameter for the class this `ScoringFunction` is responsible for, based on the class probability `classProb`.

  Specified by:
    `getInitialClassParam` in interface `ScoringFunction`
  Parameters:
    `classProb` - the class probability
  Returns:
    the initial class parameter

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD