|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.agena.minerva.model.extendedbn.ExtendedNode
uk.co.agena.minerva.model.extendedbn.NumericalEN
uk.co.agena.minerva.model.extendedbn.DiscreteRealEN
public class DiscreteRealEN
A DiscreteRealEN is a node whose states represent real numbers that are in no particular order e.g. -2.0, 4.5, 0, 1.8
Field Summary | |
---|---|
protected static java.lang.String[][] |
defaultStateNames
|
Fields inherited from interface uk.co.agena.minerva.util.model.Writable |
---|
FIELD_SEPARATOR |
Constructor Summary | |
---|---|
DiscreteRealEN()
Default constructor. |
|
DiscreteRealEN(NameDescription name,
uk.co.agena.minerva.model.corebn.CoreBN connBn)
Constructs a DiscreteRealEN with the specified name and connected Core BN. |
|
DiscreteRealEN(NameDescription name,
java.lang.String connNodeId,
uk.co.agena.minerva.model.corebn.CoreBN connBn)
Constructs a DiscreteRealEN with the specified name, connected node ID and connected BN. |
Method Summary | |
---|---|
void |
configureDefaultExtendedStates()
Sets up a default list of ExtendedStates for this node based on the default state names for this class. |
protected DataPoint |
createDataPointFromExtendedState(ExtendedState es,
double value)
Creates a DataPoint for the supplied ExtendedState that represents the marginal probability associated with the ExtendedState. |
DataSet |
createDataSetForExtendedStates()
Create a DatsSet from the Extended States of this node. |
DataSet |
createDataSetFromNumericValue(double value,
NameDescription name)
Takes the supplied value and creates a DataSet of evidence. |
java.util.List |
createExtendedStates(DataSet ds)
Takes the supplied DataSet and uses it to generate a List of ExtendedStates which are then returned. |
ExtendedState |
createNewExtendedState(int index)
Creates a new ExtendedState, all the way to the core. |
void |
extendedNodeAttributeChanged(ExtendedNodeEvent ene,
int attribute)
Called when selected attributes of the node are changed. |
static java.lang.String[][] |
getDefaultStateNames()
|
java.lang.Object |
getSamplesForState(int index,
boolean boundsOnly)
Just returns the single numerical value as the only sample for the supplied state. |
double |
mean()
Calculates the mean of the marginals for this ExtendedNode. |
double |
median()
Calculates the median of the marginals for this ExtendedNode. |
double |
percentile(double perc)
Calculates the specified percentile of the marginals for this ExtendedNode. |
java.util.List |
replaceState(int index,
int numDivisions)
Takes the state at the specified index and replaces it with the required number of new states. |
double |
standardDeviation()
Calculates the standard deviation of the marginals for this ExtendedNode. |
double |
variance()
Calculates the variance of the marginals for this ExtendedNode. |
Methods inherited from class uk.co.agena.minerva.model.extendedbn.NumericalEN |
---|
fillArraysUsingAbsolutes, fillArraysUsingIntervals, getDisceteValues |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static java.lang.String[][] defaultStateNames
Constructor Detail |
---|
public DiscreteRealEN()
public DiscreteRealEN(NameDescription name, uk.co.agena.minerva.model.corebn.CoreBN connBn) throws ExtendedBNException
name
- the name of the DiscreteRealENconnBn
- a reference to the underlying BN
ExtendedNodeCreationException
- if there is a problem creating the node
ExtendedBNException
public DiscreteRealEN(NameDescription name, java.lang.String connNodeId, uk.co.agena.minerva.model.corebn.CoreBN connBn) throws ExtendedBNException
name
- the name of the NumericalENconnNodeId
- the ID of the connected node in the underlying BN.connBn
- a reference to the underlying CoreBN
ExtendedBNException
- if there is a problem creating the nodeMethod Detail |
---|
public static java.lang.String[][] getDefaultStateNames()
public void configureDefaultExtendedStates() throws ExtendedStateException
configureDefaultExtendedStates
in class ExtendedNode
ExtendedStateException
public DataSet createDataSetFromNumericValue(double value, NameDescription name) throws ExtendedBNException
createDataSetFromNumericValue
in class NumericalEN
value
- the value entered as an observation
ExtendedBNException
- if there is a problem creating the DataSetprotected DataPoint createDataPointFromExtendedState(ExtendedState es, double value) throws ExtendedBNException
createDataPointFromExtendedState
in class ExtendedNode
es
- the ExtendedState that the DataPoint will representvalue
- the marginal probability value currently associated with the ExtendedState
ExtendedBNException
- if there is a problem creating the DataPoint (only thrown in
selected subclasses)public java.util.List createExtendedStates(DataSet ds) throws ExtendedStateNumberingException, ExtendedStateException
ExtendedNode
createExtendedStates
in class ExtendedNode
ds
- the DataSet used for creating the ExtendedStates
ExtendedStateNumberingException
ExtendedStateException
public DataSet createDataSetForExtendedStates() throws ExtendedStateException
createDataSetForExtendedStates
in class ExtendedNode
ExtendedStateException
public void extendedNodeAttributeChanged(ExtendedNodeEvent ene, int attribute)
ExtendedNode
extendedNodeAttributeChanged
in interface ExtendedNodeListener
extendedNodeAttributeChanged
in class ExtendedNode
public java.util.List replaceState(int index, int numDivisions) throws ExtendedStateException, ExtendedNodeMethodNotSupportedException
replaceState
in class ExtendedNode
index
- the index of the state to splitnumDivisions
- the number of divisions it should be split into
ExtendedStateException
ExtendedNodeMethodNotSupportedException
public ExtendedState createNewExtendedState(int index) throws ExtendedNodeMethodNotSupportedException, ExtendedBNException
ExtendedNode
createNewExtendedState
in class ExtendedNode
ExtendedBNException
ExtendedNodeMethodNotSupportedException
public java.lang.Object getSamplesForState(int index, boolean boundsOnly) throws ExtendedStateException
getSamplesForState
in class ExtendedNode
index
- the index of the state to sampleboundsOnly
- TODO
ExtendedStateNotFoundException
- if there is no state at the supplied index
ExtendedStateException
public double mean() throws ExtendedBNException
NumericalEN
mean
in class NumericalEN
ExtendedBNException
- if there is a problem calculating the meanpublic double median() throws ExtendedBNException
NumericalEN
median
in class NumericalEN
ExtendedBNException
- if there is a problem calculating the medianpublic double percentile(double perc) throws ExtendedBNException
NumericalEN
percentile
in class NumericalEN
perc
- the required percentile
ExtendedBNException
- if there is a problem calculating the percentilepublic double standardDeviation() throws ExtendedBNException
NumericalEN
standardDeviation
in class NumericalEN
ExtendedBNException
- if there is a problem calculating the standard deviationpublic double variance() throws ExtendedBNException
NumericalEN
variance
in class NumericalEN
ExtendedBNException
- if there is a problem calculating the variance
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |