|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.scoringFunctions.directedGraphicalModels.Parameter
public class Parameter
Class for the parameters of a BayesianNetworkScoringFunction. Each
parameter holds its current value, the symbol and position it is responsible
for and the context of the current symbol. A parameter can either be free or
determined by other parameters (on the same simplex).
| Field Summary | |
|---|---|
protected int[][] |
context
The context of this parameter. |
protected double |
count
The counts for this parameter. |
protected int |
position
The position of symbol this parameter is responsible for. |
protected double |
pseudoCount
The pseudocount for this parameter. |
protected byte |
symbol
The symbol (out of some Alphabet) this parameter
is responsible for. |
| Constructor Summary | |
|---|---|
Parameter(int index,
byte symbol,
int position,
double pseudoCount,
boolean free)
Creates a new Parameter, that is Parameter no
index in the list of Parameters of the
BayesianNetworkScoringFunction and responsible for
symbol at position position and pseudo count
pseudoCount. |
|
Parameter(int index,
byte symbol,
int position,
int[][] context,
double pseudoCount,
boolean free)
Creates a new Parameter, that is Parameter no
index in the list of Parameters of the
BayesianNetworkScoringFunction and responsible for
symbol at position position having context
context and pseudocount pseudoCount. |
|
Parameter(StringBuffer representation)
The standard constructor for the interface Storable. |
|
| Method Summary | |
|---|---|
void |
addCount(double count2)
Adds count2 to the counts of this parameter. |
Parameter |
clone()
|
double |
doesApplyFor(Sequence seq)
Indicates if the Sequence seq fulfills all
requirements defined in the context. |
double |
getCounts()
Returns the current counts for this parameter. |
int |
getDepth()
Returns the depth of the tree, i.e. the number of parents of this parameter. |
double |
getExpValue()
Returns Math.exp(, which is pre-computed. |
int |
getIndex()
Returns the index of this parameter as defined in the constructor. |
double |
getLogPartialNormalizer()
Returns the partial derivative of the normalization constant with respect to this parameter. |
double |
getLogT()
Returns the part of the normalization constant of parameters before this parameter in the structure of the network. |
double |
getLogZ()
Returns the part of the normalization constant of parameters after this parameter in the structure of the network. |
int |
getPosition()
Returns the position of the symbol this parameter is responsible for as defined in the constructor. |
double |
getPseudoCount()
Returns the pseudocount as given in the constructor. |
double |
getValue()
Returns the current value of this parameter. |
void |
invalidateNormalizers()
Resets all internal normalization constants to null. |
boolean |
isFree()
Indicates if this parameter is free. |
void |
print()
Prints the counts and the value of this parameter to System.out. |
void |
reset()
Resets the counts to the pseudocounts and the value to 0. |
void |
setValue(double value)
Sets the current value of this parameter. |
StringBuffer |
toXML()
This method returns an XML representation as StringBuffer of an
instance of the implementing class. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected byte symbol
Alphabet) this parameter
is responsible for.
protected int position
symbol this parameter is responsible for.
protected int[][] context
context.length is
equal to the number of parents, context[i] holds the
information for parent no i, context[i][0]
holds the position of parent i, context[i][1]
,... hold the possible configurations of parent i in the
context. Normally, only context[i][1] exists, i.e. only one
configuration is allowed in the context.
protected double count
protected double pseudoCount
| Constructor Detail |
|---|
public Parameter(int index,
byte symbol,
int position,
double pseudoCount,
boolean free)
Parameter, that is Parameter no
index in the list of Parameters of the
BayesianNetworkScoringFunction and responsible for
symbol at position position and pseudo count
pseudoCount.
index - the index in the list of all parameterssymbol - the symbol this parameter is responsible forposition - the position of the symbolpseudoCount - the pseudocountfree - indicates if this parameter is a free parameter
public Parameter(int index,
byte symbol,
int position,
int[][] context,
double pseudoCount,
boolean free)
Parameter, that is Parameter no
index in the list of Parameters of the
BayesianNetworkScoringFunction and responsible for
symbol at position position having context
context and pseudocount pseudoCount.
index - the index in the list of all parameterssymbol - the symbol this parameter is responsible forposition - the position of the symbolcontext - the context of this parameterpseudoCount - the pseudocountfree - indicates if this parameter is a free parameter
public Parameter(StringBuffer representation)
throws NonParsableException
Storable.
Re-creates a parameter from its XML-representation as returned by the
method toXML().
representation - the XML code as StringBuffer
NonParsableException - if the StringBuffer representation could
not be parsed| Method Detail |
|---|
public Parameter clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic double getPseudoCount()
Parameter(int, byte, int, double, boolean),
Parameter(int, byte, int, int[][], double, boolean)public void reset()
0.
public int getDepth()
public void print()
System.out.
public double doesApplyFor(Sequence seq)
Sequence seq fulfills all
requirements defined in the context.
seq - the sequence
true if this parameter is responsible for
seq, false otherwisepublic double getValue()
public void setValue(double value)
value - the new value to be setpublic double getExpValue()
Math.exp(getValue()), which is pre-computed.
public StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.
toXML in interface Storablepublic void invalidateNormalizers()
null.
public double getLogPartialNormalizer()
throws Exception
Exception - if no normalization constants have been pre-computedpublic double getCounts()
public void addCount(double count2)
count2 to the counts of this parameter.
count2 - the counts to be addedpublic boolean isFree()
true if the parameter is free, false
otherwisepublic int getPosition()
Parameter(int, byte, int, double, boolean),
Parameter(int, byte, int, int[][], double, boolean)public int getIndex()
Parameter(int, byte, int, double, boolean),
Parameter(int, byte, int, int[][], double, boolean)public double getLogZ()
public double getLogT()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||