de.jstacs.models.mixture.gibbssampling
Class VarianceRatioBurnInTest

java.lang.Object
  extended by de.jstacs.models.mixture.gibbssampling.AbstractBurnInTest
      extended by de.jstacs.models.mixture.gibbssampling.VarianceRatioBurnInTest
All Implemented Interfaces:
InstantiableFromParameterSet, BurnInTest, Storable, Cloneable

public class VarianceRatioBurnInTest
extends AbstractBurnInTest

In this class the Variance-Ratio method of Gelman and Rubin is implemented to test the length of the burn-in phase of a multi-chain Gibbs Sampling (number of chains >2). The number of initial iterations is calculated by comparing the variances between the different chains with the variances within the chains. The method returns the same length of the burn-in for all sampled chains.

Author:
Berit Haldemann

Field Summary
 
Fields inherited from class de.jstacs.models.mixture.gibbssampling.AbstractBurnInTest
values
 
Constructor Summary
VarianceRatioBurnInTest(StringBuffer rep)
          The standard constructor for the Storable interface.
VarianceRatioBurnInTest(VarianceRatioBurnInTestParameterSet parameters)
          Creates a new VarianceRatioBurnInTest instance.
 
Method Summary
protected  int computeLengthOfBurnIn()
          Computes and returns the length of the burn-in phase given by the Variance-Ratio burn-in test.
protected  StringBuffer getFurtherInformation()
          This method returns further information for the AbstractBurnInTest.
 String getInstanceName()
          Returns a short description of the burn-in test.
protected  String getXMLTag()
          This method returns the XML tag that is used in AbstractBurnInTest.toXML() and AbstractBurnInTest.AbstractBurnInTest(StringBuffer).
protected  void setFurtherInformation(StringBuffer xml)
          This method sets further information for the AbstractBurnInTest.
 
Methods inherited from class de.jstacs.models.mixture.gibbssampling.AbstractBurnInTest
clone, getCurrentParameterSet, getLengthOfBurnIn, resetAllValues, setCurrentSamplingIndex, setValue, toXML
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VarianceRatioBurnInTest

public VarianceRatioBurnInTest(VarianceRatioBurnInTestParameterSet parameters)
                        throws CloneNotSupportedException
Creates a new VarianceRatioBurnInTest instance.

Parameters:
parameters - set of parameters
Throws:
CloneNotSupportedException - if the parameters can not be cloned

VarianceRatioBurnInTest

public VarianceRatioBurnInTest(StringBuffer rep)
                        throws NonParsableException
The standard constructor for the Storable interface. Creates a new VarianceRatioBurnInTest instance out of a StringBuffer.

Parameters:
rep - the StringBuffer
Throws:
NonParsableException - if the StringBuffer can not be parsed
Method Detail

getXMLTag

protected String getXMLTag()
Description copied from class: AbstractBurnInTest
This method returns the XML tag that is used in AbstractBurnInTest.toXML() and AbstractBurnInTest.AbstractBurnInTest(StringBuffer).

Specified by:
getXMLTag in class AbstractBurnInTest
Returns:
the XML tag that is used in AbstractBurnInTest.toXML() and AbstractBurnInTest.AbstractBurnInTest(StringBuffer)

getFurtherInformation

protected StringBuffer getFurtherInformation()
Description copied from class: AbstractBurnInTest
This method returns further information for the AbstractBurnInTest. It enables to store test specific data via the method AbstractBurnInTest.toXML().

This method should only be used in AbstractBurnInTest.toXML().

Specified by:
getFurtherInformation in class AbstractBurnInTest
Returns:
further information in XML format

setFurtherInformation

protected void setFurtherInformation(StringBuffer xml)
                              throws NonParsableException
Description copied from class: AbstractBurnInTest
This method sets further information for the AbstractBurnInTest. It enables to load test specific data in the constructor AbstractBurnInTest.AbstractBurnInTest(StringBuffer).

This method should only be used in AbstractBurnInTest.AbstractBurnInTest(StringBuffer).

Specified by:
setFurtherInformation in class AbstractBurnInTest
Parameters:
xml - contains further information in XML format
Throws:
NonParsableException - if the StringBuffer could not be parsed

getInstanceName

public String getInstanceName()
Description copied from interface: BurnInTest
Returns a short description of the burn-in test.

Returns:
a short description of the burn-in test.

computeLengthOfBurnIn

protected int computeLengthOfBurnIn()
Computes and returns the length of the burn-in phase given by the Variance-Ratio burn-in test. To get an effective test the number of Gibbs iterations should be greater than 250. Fewer iterations may lead to inaccuracy in the calculation of the different required variances.

Specified by:
computeLengthOfBurnIn in class AbstractBurnInTest
Returns:
the length of the burn-in phase
See Also:
AbstractBurnInTest.computeLengthOfBurnIn()