Examples of Equation Use

Here are example equations for some common or non-obvious situations:

State Comparisons:  Suppose the states of node Source are CA, TX, FL, BC and NY.  The states of node Dest are TX, NY, MA and UT.  We want to know if cross-border travel is required to transport from Source to Dest, and that is indicated by the boolean node Travel.  The equation below works even though nodes Source and Dest have different sets of states, and in a different order.

Travel (Source, Dest) = (Source != Dest)

Additive Noise:  Say you want to represent something like:
x1 = x2 + gauss (0, 0.2) which could indicate that x1 is the same as x2, but with the addition of Gaussian noise having mean 0 and s = 0.2.  You could do this by defining a new node x3, and setting the equations of x1 and x3 as:

x1 (x2, x3) = x2 + x3

p(x3) = NormalDist (x3, 0, 0.2)

 

Multiple Discretizations:  Sometimes it is useful to use more than one node to represent a continuous variable, and discretize each differently.  For example, the coarser one may be a parent for another node whose CPT would be too big with a finer discretization, while the finer one would serve as a parent for nodes requiring more accuracy.  Put a link from the finer node to the coarser, and give the coarser node an equation like:

X_d4 (X_d12) = X_d12

 

Noisy-Or:  To create a noisy-or node, just create a regular boolean nature node, put links to it from the possible causes, give it a noisy-or equation, and use that to build its CPT.  For extra computational efficiency you may want to select it and choose Modify Decompose Equations before building the CPT.

For example, if C1, C2 and C3 are boolean nodes representing causes of boolean node E, and there are links from each Ci to E, then E could have the noisy-or equation:

P (E | C1, C2, C3) =

NoisyOrDist (E, 0, C1, 0.5, C2, 0.3, C3, 0.1)

For its meaning, see the NoisyOrDist description.  The causes, and even the link parameters, can be more complex expressions (then you won’t be able to use Modify Decompose Equations though).

For example:

P (Bond | Temperature, BackTemp, Pressure, Switch,Eff)=

NoisyOrDist (Bond, 0.001,

Temperature > BackTemp, 0.5,

Pressure == high, 0.3,

Switch, 0.9 * Eff)