public class BTExplainingAwayResidual extends Measure
Measure
that computes a maximum spanning tree
based on the explaining away residual and uses the resulting tree structure
as structure of a Bayesian tree (special case of a Bayesian network) in a
BayesianNetworkDiffSM
.Modifier and Type | Class and Description |
---|---|
static class |
BTExplainingAwayResidual.BTExplainingAwayResidualParameterSet
Class for the parameters of a
BTExplainingAwayResidual structure
Measure . |
Measure.MeasureParameterSet
parameters
Constructor and Description |
---|
BTExplainingAwayResidual(BTExplainingAwayResidual.BTExplainingAwayResidualParameterSet parameters)
|
BTExplainingAwayResidual(double[] ess)
Creates a new explaining away residual Bayesian tree
Measure . |
BTExplainingAwayResidual(StringBuffer buf)
The standard constructor for the interface
Storable . |
Modifier and Type | Method and Description |
---|---|
double[][] |
getEAR(DataSet fg,
DataSet bg,
double[] weightsFg,
double[] weightsBg,
int length)
Returns the explaining away residual (EAR) between all pairs of positions
as a matrix.
|
String |
getInstanceName()
Returns the name of the
Measure and possibly some additional
information about the current instance. |
int[][] |
getParents(DataSet fg,
DataSet bg,
double[] weightsFg,
double[] weightsBg,
int length)
Returns the optimal parents for the given data and weights.
|
String |
getXMLTag()
Returns the XML-tag for storing this measure
|
clone, fillTensor, fillTensor, fromXML, getCMI, getCMI, getCurrentParameterSet, getEAR, getEAR, getMatrixForKruskal, getMI, getMI, getStatistics, getStatisticsOrderTwo, isShiftable, reStructure, sum, toParents, toXML, union
public BTExplainingAwayResidual(double[] ess) throws Exception
Measure
.ess
- the equivalent sample sizes (ess) for the classesException
- if the parameters could bot be created for thepublic BTExplainingAwayResidual(BTExplainingAwayResidual.BTExplainingAwayResidualParameterSet parameters) throws CloneNotSupportedException
parameters
- the corresponding parametersCloneNotSupportedException
- if the parameters could not be clonedpublic BTExplainingAwayResidual(StringBuffer buf) throws NonParsableException
Storable
.
Recreates a BTExplainingAwayResidual
from is XML representation
as returned by Measure.toXML()
.buf
- the XML representation as StringBuffer
NonParsableException
- if the XML code could not be parsedpublic String getInstanceName()
Measure
Measure
and possibly some additional
information about the current instance.getInstanceName
in class Measure
Measure
public double[][] getEAR(DataSet fg, DataSet bg, double[] weightsFg, double[] weightsBg, int length) throws Exception
fg
- the foreground databg
- the background dataweightsFg
- the weights associated with the foreground dataweightsBg
- the weights associated with the background datalength
- the length of the sequencesException
- if the specified length does not match the length of the sequences in the datapublic int[][] getParents(DataSet fg, DataSet bg, double[] weightsFg, double[] weightsBg, int length) throws Exception
Measure
p
at each position i
is build
as follows:
p[i][p.length - 1]
contains the index i
itselfp[i][p.length - 2]
contains the "most
important" parentp[i][0]
contains the "least important" parentgetParents
in class Measure
fg
- the data of the current (foreground) classbg
- the data of the negative (background) classweightsFg
- 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
sequencesp
with the optimal parentsException
- if the lengths do not match or other problems concerning the
data occur