|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.SimpleState
de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.SimpleSamplingState
public class SimpleSamplingState
This class implements a state that can be used for a HMM that obtains its parameters from sampling.
| Field Summary |
|---|
| Fields inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.SimpleState |
|---|
e, forward, name |
| Constructor Summary | |
|---|---|
SimpleSamplingState(SamplingEmission e,
String name,
boolean forward)
This constructor creates a state that can be used in a HMM that obtains its parameters from sampling. |
|
| Method Summary | |
|---|---|
void |
acceptParameters()
This methods accepts the drawn parameters. |
void |
drawParametersFromStatistic()
This method draws the parameters using a sufficient statistic representing a posteriori density. |
void |
extendSampling(int sampling,
boolean append)
This method allows to extend a sampling. |
double |
getLogGammaScoreForCurrentStatistic()
This method calculates a score for the current statistics, which is independent from the current parameters In general the gamma-score is a product of gamma-functions parameterized with the current statistics |
double |
getLogPosteriorFromStatistic()
This method calculates the a-posteriori probability for the current statistics |
void |
initForSampling(int starts)
This method initializes the instance for the sampling. |
boolean |
isInSamplingMode()
This method returns true if the object is currently used in
a sampling, otherwise false. |
boolean |
parseNextParameterSet()
This method allows the user to parse the next set of parameters (from a file). |
boolean |
parseParameterSet(int sampling,
int n)
This method allows the user to parse the set of parameters with index n of a certain sampling (from a file). |
void |
samplingStopped()
This method is the opposite of the method SamplingComponent.extendSampling(int, boolean). |
| Methods inherited from class de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.SimpleState |
|---|
addToStatistic, getGraphvizNodeOptions, getLogScoreFor, isSilent, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.TrainableState |
|---|
addToStatistic |
| Methods inherited from interface de.jstacs.sequenceScores.statisticalModels.trainable.hmm.states.State |
|---|
getGraphvizNodeOptions, getLogScoreFor, isSilent, toString |
| Constructor Detail |
|---|
public SimpleSamplingState(SamplingEmission e,
String name,
boolean forward)
e - the emissionname - the name of the emission (e.g. for the Graphviz representation)forward - a switch whether to use the forward or the reverse strand| Method Detail |
|---|
public void drawParametersFromStatistic()
throws Exception
SamplingFromStatisticSamplingComponent.acceptParameters() so that they can later be parsed using the
methods of the interface.
SamplingComponent.initForSampling(int) should be
called.
drawParametersFromStatistic in interface SamplingFromStatisticException - if there is a problem with drawing the parameters, the initialization, ...SamplingComponent.initForSampling(int),
SamplingComponent.acceptParameters()
public void extendSampling(int sampling,
boolean append)
throws IOException
SamplingComponent
extendSampling in interface SamplingComponentsampling - the index of the samplingappend - whether to append the sampled parameters to an existing file
or to overwrite the file
IOException - if the file could not be handled correctly
public void initForSampling(int starts)
throws IOException
SamplingComponent
initForSampling in interface SamplingComponentstarts - the number of different sampling starts that will be done
IOException - if something went wrongFile.createTempFile(String, String, java.io.File )public boolean isInSamplingMode()
SamplingComponenttrue if the object is currently used in
a sampling, otherwise false.
isInSamplingMode in interface SamplingComponenttrue if the object is currently used in a sampling,
otherwise falsepublic boolean parseNextParameterSet()
SamplingComponent
parseNextParameterSet in interface SamplingComponenttrue if the parameters could be parsed, otherwise
falseSamplingComponent.parseParameterSet(int, int)
public boolean parseParameterSet(int sampling,
int n)
throws Exception
SamplingComponentn of a certain sampling (from a file). The
internal numbering should start with 0. The parameter set with index 0 is
the initial (random) parameter set. It is recommended that a series of
parameter sets is accessed by the following lines:
for( sampling = 0; sampling < numSampling; sampling++ )
{
while( b )
{
//do something
b = parseNextParameterSet();
}
parseParameterSet in interface SamplingComponentsampling - the index of the samplingn - the index of the parameter set
true if the parameter set could be parsed
Exception - if there is a problem with parsing the parametersSamplingComponent.parseNextParameterSet()
public void samplingStopped()
throws IOException
SamplingComponentSamplingComponent.extendSampling(int, boolean). It can be
used for closing any streams of writer, ...
samplingStopped in interface SamplingComponentIOException - if something went wrongSamplingComponent.extendSampling(int, boolean)
public void acceptParameters()
throws IOException
SamplingComponent
acceptParameters in interface SamplingComponentIOException - if the file could not be handled correctlypublic double getLogGammaScoreForCurrentStatistic()
SamplingState
getLogGammaScoreForCurrentStatistic in interface SamplingStatepublic double getLogPosteriorFromStatistic()
SamplingFromStatistic
getLogPosteriorFromStatistic in interface SamplingFromStatistic
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||