Simple Vehicle Identification Mtheory: A Unbbayes-Mebn Tutorial
Simple Vehicle Identification Mtheory: A Unbbayes-Mebn Tutorial
A UNBBayes-MEBN Tutorial
1. Start UnBBayes
a. Double-click the unbbayes.jar file. 2a.
(On Windows you can also run
unbbayes.bat; on Linux you can run
unbayes.sh)
2. Create new MTheory
a. Click “New MEBN” button on toolbar just below main menu bar.
3. Make 3 new MFrags
a. Click “New MFrag” button at left of MFrag editing pane.
b. In the MFrag name field, highlight “DMFrag1” and type “Region_MFrag.” Hit
“Enter.”
3a.
c. Click “New MFrag” button at left of MFrag editing pane.
d. In the MFrag name field, highlight “DMFrag2” and type “Vehicle_MFrag.” Hit
“Enter.”
e. Click “New MFrag” button at left of MFrag editing pane.
f. In the MFrag name field, highlight “DMFrag3” and type “Reference_MFrag.”
Hit “Enter.”
g. You now have three blank MFrags as shown below.
3h.
4a.
6b.
6c.
6d.
e. Highlight ObjectEntity and Click “+” again.
f. Change the name “EX3” in the name field to “Vehicle.”
g. Save your MTheory again. You may want to keep partial models at different
stages. To do this, you can use the “File > Save as…” menu item, click on the
file, and then edit the name to “SimpleVehicleID_v2.ubf” to indicate the
version number.
7. Define IsA context node in the Region MFrag.
a. Click “Edit the MTheory” button (see 4a.)
b. Double-click “Region_MFrag” in the MTheory tree. Make sure “Region_MFrag”
appears above the editing pane.
c. Click the “Insert Ordinary Variable” button at left of editing pane.
d. Move cursor to top of the MFrag palette and click to drop an IsA node into the
MFrag.
e. Select “Region” from the drop-down list of types.
f. Change the name “OX1” to “rgn” in the ordinary variable name field.
g. Right-click on the IsA node and select “Resize to fit text” or resize by dragging
the node border. Your MFrag should now look like the figure below.
7c.
8. Define resident node in Region MFrag.
a. Click the “Insert Resident Node” button at left of editing pane.
b. Move cursor onto palette below the IsA node and click to drop a new resident
node onto the palette.
c. Highlight the name “RX1” in the name field at the top of the editing pane and
change to “RegionType. Hit “Enter.” Resize the new resident node as in 7g.
d. In the Resident Node pane, click the “Edit Arguments” button shown as “()” to
select the ordinary variable for this resident node. You may need to resize
the top-left pane as described in 3h.
e. Double-click on “rgn (Region)” to insert the ordinary variable. Resize the
resident node as in 7g.
8c.
8d.
8e. 8a.
8f.
11e. 11d.
11f.
11g.
11i.
11h.
h. Add the reference context node. Click “Insert context node” to the left of the
editing pane and insert a blank context node onto the editing pane. This
reference node will represent the knowledge that the link between the
RegionType of a region and VehicleType of a vehicle applies when the vehicle
is located in the region.
i. Click “formula” in the Context Node pane at the upper left of the window.
j. Click the “=” button above the formula area. The expression (op_1=op_2) will
appear inside the context node.
k. Highlight “op_1” in the formula area. Click the “Add ordinary variable” button
below the formula area.
11h.
11o.
12. Define local distribution for RegionType random variable.
a. Click “Edit the MTheory” button and double-click “RegionType” random variable
in the MTheory tree. (If you do not see the random variable, you can expand the
Region MFrag to show its random variables by clicking on the triangle to the left
of the MFrag name. Or you can double-click the MFrag and then select the
RegionType random variable in the editing pane.)
b. With the RegionType node selected, click the distribution button “#” in the
Resident Node area. A box will pop up for the distribution.
c. Click the “default” button. A formula will appear in the blank node window.
d. Change the word “formula” after each of the states to 0.75 for OnRoad and 0.25
for OffRoad. Be careful not to erase the comma after the probability for the first
state.
e. Click “Compile.” You should see a message that the table compiled successfully.
Click “Save,” and then click “Exit.” (Make sure you click “Save” or your edits will be
lost.)
18. Now try adding another node “Speed” to represent the vehicle speed, as shown
below.
a. Add the Speed(veh) node to the Vehicle MFrag as in Step 11 above.
b. Give it states “Slow” and “Fast”.
c. Draw an arc from VehicleType(veh) to Speed(veh).
d. Give it the distribution as shown below.
e. Try different evidence and different queries. Notice that the situation-specific
Bayesian network will include only the nodes necessary to answer your
query. See the examples below with the same MTheory, the same four
objects, and different evidence.