de.jstacs.scoringFunctions.directedGraphicalModels.structureLearning.measures.pmmMeasures
Class PMMMutualInformation

java.lang.Object
  extended by de.jstacs.scoringFunctions.directedGraphicalModels.structureLearning.measures.Measure
      extended by de.jstacs.scoringFunctions.directedGraphicalModels.structureLearning.measures.pmmMeasures.PMMMutualInformation
All Implemented Interfaces:
InstantiableFromParameterSet, Storable, Cloneable

public class PMMMutualInformation
extends Measure

Class for the network structure of a BayesianNetworkScoringFunction that is a permuted Markov model based on mutual information.

Author:
Jan Grau

Nested Class Summary
static class PMMMutualInformation.PMMMutualInformationParameterSet
          Class for the parameters of a PMMMutualInformation structure Measure.
 
Constructor Summary
PMMMutualInformation(byte order, BTMutualInformation.DataSource clazz, double[] ess)
          Creates a new PMMMutualInformation of order order.
PMMMutualInformation(PMMMutualInformation.PMMMutualInformationParameterSet parameters)
          Creates a new PMMMutualInformation from the corresponding InstanceParameterSet parameters.
PMMMutualInformation(StringBuffer buf)
          The standard constructor for the interface Storable.
 
Method Summary
 PMMMutualInformation clone()
           
 InstanceParameterSet getCurrentParameterSet()
          Returns the InstanceParameterSet that has been used to instantiate the current instance of the implementing class.
 String getInstanceName()
          Returns the name of the Measure and possibly some additional information about the current instance.
 int[][] getParents(Sample fg, Sample bg, double[] weightsFg, double[] weightsBg, int length)
          Returns the optimal parents for the given data and weights.
 StringBuffer toXML()
          This method returns an XML representation as StringBuffer of an instance of the implementing class.
 
Methods inherited from class de.jstacs.scoringFunctions.directedGraphicalModels.structureLearning.measures.Measure
fillTensor, fillTensor, getCMI, getCMI, getEAR, getEAR, getMI, getMI, getStatistics, getStatisticsOrderTwo, isShiftable, sum, toParents, union
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PMMMutualInformation

public PMMMutualInformation(byte order,
                            BTMutualInformation.DataSource clazz,
                            double[] ess)
                     throws Exception
Creates a new PMMMutualInformation of order order.

Parameters:
order - the order, may be 1 or 2.
clazz - the classes used for computation of mutual information, as defined by BTMutualInformation.DataSource
ess - the equivalent sample sizes of both classes
Throws:
Exception - if the order is not 1 or 2

PMMMutualInformation

public PMMMutualInformation(PMMMutualInformation.PMMMutualInformationParameterSet parameters)
                     throws Exception
Creates a new PMMMutualInformation from the corresponding InstanceParameterSet parameters.

Parameters:
parameters - the corresponding parameters
Throws:
Exception - if the order is not 1 or 2

PMMMutualInformation

public PMMMutualInformation(StringBuffer buf)
                     throws NonParsableException
The standard constructor for the interface Storable. Recreates a PMMMutualInformation from its XML representation as returned by toXML().

Parameters:
buf - the XML representation as StringBuffer
Throws:
NonParsableException - if the XML code could not be parsed
Method Detail

clone

public PMMMutualInformation clone()
                           throws CloneNotSupportedException
Overrides:
clone in class Measure
Throws:
CloneNotSupportedException

getInstanceName

public String getInstanceName()
Description copied from class: Measure
Returns the name of the Measure and possibly some additional information about the current instance.

Specified by:
getInstanceName in class Measure
Returns:
the name of the Measure

getParents

public int[][] getParents(Sample fg,
                          Sample bg,
                          double[] weightsFg,
                          double[] weightsBg,
                          int length)
                   throws Exception
Description copied from class: Measure
Returns the optimal parents for the given data and weights. The returned array of parents p at each position i is build as follows:

Specified by:
getParents in class Measure
Parameters:
fg - the data of the current (foreground) class
bg - the data of the negative (background) class
weightsFg - the weights for the sequences of fg
weightsBg - the weights for the sequences of bg
length - the length of the model, must be equal to the length of the sequences
Returns:
the the array p with the optimal parents
Throws:
Exception - if the lengths do not match or other problems concerning the data occur

toXML

public StringBuffer toXML()
Description copied from interface: Storable
This method returns an XML representation as StringBuffer of an instance of the implementing class.

Returns:
the XML representation

getCurrentParameterSet

public InstanceParameterSet getCurrentParameterSet()
                                            throws Exception
Description copied from interface: InstantiableFromParameterSet
Returns the InstanceParameterSet that has been used to instantiate the current instance of the implementing class. If the current instance was not created using an InstanceParameterSet, an equivalent InstanceParameterSet should be returned, so that an instance created using this InstanceParameterSet would be in principle equal to the current instance.

Returns:
the current InstanceParameterSet
Throws:
Exception - if the InstanceParameterSet could not be returned