A saved Evidence Scenario File can be reimported into the network from where it originated (e.g., after external modification, see Evidence Scenario File Syntax) or it can be loaded into an entirely different network file.
Main Menu > Data > Evidence Scenario File > Associate
.
If the newly-associated Evidence Scenario File contains incompatible content, e.g., nonexistent nodes in the network, BayesiaLab shows a corresponding error message:
However, the remaining, compatible content will be available in the now-attached Evidence Scenario File.
In BayesiaLab, you can manage sets of actual or potential observations in a Bayesian network using Evidence Scenario Files.
For instance, an Evidence Scenario File can serve as a convenient way to manage multiple sets of assumptions, such as what-if scenarios. This is particularly helpful when scenarios contain many individual assumptions. Imagine the business case of an airline represented as a Bayesian network. It would have to include assumptions regarding travel demand for all origin-destination pairs. Manually setting and modifying assumptions for hundreds of nodes would not be practical.
An Evidence Scenario File consists of one or more Evidence Scenarios.
And, each Evidence Scenario contains one or more node-specific observations, as illustrated below:
Applying an Evidence Scenario means setting the stored pieces of evidence to the corresponding nodes.
Note that evidence cannot be set on Not Observable Nodes, i.e., nodes that have a Cost of 0 (see Cost Management).
With a given Bayesian network, any current observation on a node or sets of observations set on multiple nodes can be recorded as an Evidence Scenario. As soon as you store an Evidence Scenario, BayesiaLab "starts a tab" by creating an internal Evidence Scenario File.
Four types of evidence can be saved as an Evidence Scenario:
Hard Evidence
Likelihood Evidence
Probabilistic Evidence
Numerical Evidence
To learn more about setting evidence, please see the section on Setting Evidence in Contextual Menu of Monitors.
Then, enter an optional comment in the pop-up window and assign a Weight to the Evidence Scenario you are storing. If you don't enter a comment, the Evidence Scenario will merely be indexed sequentially, starting with 0.
Click OK to confirm.
You can add further Evidence Scenarios to the ones already stored in the internal Evidence Scenario File.
Upon selecting (and therefore applying) an Evidence Scenario, the corresponding comment, if available, appears in the Status Bar.
Note that an Evidence Scenario File is saved with the Bayesian network file. So, reopening the saved network makes all stored Evidence Scenarios available again.
In addition to recalling Evidence Scenarios one by one, you can also use them in BayesiaLab batch-processing functions:
Batch Labeling
Batch Inference
Batch Joint Probability
Batch Outlier Explanation
In this context, the Evidence Scenario File provides the observations in the same way as an internal or external dataset.
When working with multiple networks that contain the same nodes, or at least some of the same nodes, it can be useful to share an Evidence Scenario File between them as well.
For that purpose, you can export an Evidence Scenario File and subsequently associate it with another network or be used with a WebSimulator.
Main Menu > Data > Evidence Scenario File > Export.
Then choose a file name and click Save.
The Evidence Scenario File is now saved in a human-readable and easily editable text format.
This allows you to modify the Evidence Scenario File with a text editor, e.g., to add a number of new Evidence Scenarios.
Each line of an Evidence Scenario File represents one Evidence Scenario.
Encoding an Evidence Scenario always follows the same pattern, with the node name and the evidence separated by a colon (:). The optional scenario name follows after a double slash (//).
?<NodeName>?:<Evidence>//<ScenarioName>
Evidence can be encoded in several ways in an Evidence Scenario File:
Hard Evidence:
?<NodeA>?:<State1>//Scenario1
Numerical Evidence:
?<NodeB>?:m{<value>}//Scenario2
Probabilistic Evidence:
?<NodeC>?:p{<StateA>:0.3;<StateB>:0.5;<StateC>:0.2}//Scenario3
Likelihood Evidence:
?<NodeD?:l{<StateX>:1;<StateY>:0.5}//Scenario4
To encode multiple pieces of evidence in one Evidence Scenario, simply separate the individual pieces of evidence with a semicolon. The scenario name remains at the end of the line, separated by a double slash.
For Temporal Bayesian networks, the syntax of the Evidence Scenario File is slightly different. Here, each line in the text file refers to a time step, in which the evidence specified in that line will be applied.
Each line starts with an integer value that represents the time step, in which the evidence of that line will be set.
Evidence can be encoded in several ways in an Evidence Scenario File:
To encode multiple pieces of evidence in one Time Step, simply separate the individual pieces of evidence with a semicolon.
For Temporal networks, recalling evidence from the Evidence Scenario File is different compared to Contemporaneous networks.
Now, the time-specific Evidence Scenarios will be set automatically as you perform a temporal simulation.
To store an observation as an Evidence Scenario, click the icon.
Now, an additional icon in the Status Bar indicates that there is an Evidence Scenario File.
Right-clicking the icon in the Status Bar brings up the list of stored Evidence Scenarios, enumerated by an index and, if available, with corresponding comments.
So, the next time to click the icon, the pop-up window asks whether you want to append the new Evidence Scenario to the list of Evidence Scenarios or replace a particular existing Evidence Scenario.
To apply (or recall) a stored Evidence Scenario, right-click on the Evidence Scenario File icon in the Status Bar and click on the scenario you want to apply to the network.
Also, hovering over the Evidence Scenario File icon with your pointer brings up the number of available Evidence Scenarios.
You can remove the current Evidence Scenario File by left-clicking on the icon.
Please see the sub-topic for a detailed discussion of the format.
As with BayesiaLab's Dictionaries, the syntax of an is straightforward. However, we need to distinguish between the syntax for Contemporaneous and Temporal networks: