Outcome point values

<< Click to Display Table of Contents >>

Navigation:  Using SMILE Wrappers > Discrete nodes and numeric domains >

Outcome point values

To define a discrete distribution over numeric node outcomes, use Network.setNodePointValues. The example below assumes that node has three outcomes:

Java:

net.setPointValues(nodeHandle, new double[] { 3.14, -2.78, 77 });

Python:

net.set_point_values(nodeHandle, [ 3.14, -2.78, 77 ])

R:

net$setPointValues(nodeHandle, c({ 3.14, -2.78, 77 }))

C#:

net.SetPointValues(nodeHandle, new double[] { 3.14, -2.78, 77 });

The three numeric values in will be associated with existing node outcomes. There is also no requirement for ordering point values. The identifiers of the outcomes will not be modified, as nodes with point values always require outcome identifiers.

Outcome modifying methods like Network.addOutcome, Network.insertOutcome or Network.deleteOutcome work normally when node has point values. New outcomes will have their point values initialized to zero. The point values can only be changed all at once with another Network.setPointValues call.

With point values defined, it is straightforward to calculate the mean and standard deviation for the marginal probability distribution over the outcomes of the node. To retrieve the mean or the standard deviation, call Network.getNodeMean or Network.getNodeStdDev respectively.

Point values do not allow for continuous evidence in the discrete nodes. Calling Network.setContEvidence will fail, even if the parameter is equal to one of the defined point values.

To remove point values, call Network.removePointValues. Network.hasPointValues returns true if node has point values defined.