bayesia logo

Filtered States

Context

  • For any node, whether discrete or continuous, you can define one Filtered State among the states of the node.

  • With a Filtered State, you can represent situations in which a node cannot represent a meaningful value given specific states of its parent nodes.

Introductory Example

For instance, a consumer survey may ask about the age of the survey respondent's spouse. However, if a respondent is not married, he or she will not be able to provide a value for Age of Spouse.

Assuming that the survey questionnaire also includes a binary node Married with the states True and False, we can reason that a value for Age of Spouse does only exist if Married=True. If the respondent is not married, however, a value for Age of Spouse cannot exist.

In BayesiaLab, there is a special state to handle such "impossible" conditions. This special state is called Filtered State.

In this example, if Married=False, then Age of Spouse cannot take on a numerical value. Instead, Age of Spouse is set to the Filtered State.

⚠️

When conducting surveys, these situations are often handled with skip logic. For instance, if you are not married, you won't even be asked about your spouse's age. However, this kind of logic is often not reflected in the dataset containing the survey responses. In the data, you may only have a blank field for Age of Spouse, which may be indistinguishable from a missing value. For reasons that are explained in detail in Missing Values, a Filtered Value is entirely different than a missing value.

Once such a node becomes part of a Bayesian network, its Filtered States appear like regular states and act as such in Conditional Probability Tables, for instance.

The following animation illustrates how a Filtered State appears in a network and represents the logic described above.

Filtered State Indicators

Given the special properties of Filtered States, BayesiaLab reminds you regarding their presence in networks and nodes:

  • If a network contains nodes with Filtered States, a Filtered State indicator  is displayed in the Status Bar.
  • If a node contains a Filtered State,
    • the Filtered State symbol  is displayed as a tag on the node.
    FilteredStatesSpouseAgeNetwork
    • its Monitor displays the Filtered State icon  plus the asterisk sign (*) in lieu of the State Name.
    FilteredStatesSpouseAgeMonitor

Importing Data with Filtered Values

During Data Import or Data Association, Filtered States can be automatically generated from the imported dataset.

However, this requires that the codes that identify Filtered Values in the dataset are formally declared in the first step of the Data Import Wizard.

In the following screenshot of the first step in the Data Import Wizard, the Filtered Values coded as "FV" in the imported dataset are replaced by the asterisk character "*".

FilteredStatesDataImportWizard

At the conclusion of the Data Import or Data Association process, for each node that contains a Filtered Value, a new Filtered State will be added to the default states of the node.

For continuous nodes, a new artificial interval with an infinitesimally small width of 10-7 will be added after the "normal" intervals that are generated during the discretization step of the Data Import Wizard.

This newly-created state will serve at the Filtered State, and "*", i.e., the asterisk character, will be its State Name.

Associating Data with Filtered Values

The process for associating a dataset with an existing network depends on whether the variable that includes Filtered Values is newly added to the network or whether it already exists.

  • If the variable with Filtered Values is going to be added to the network, the process is the same as with [Importing Data with Filtered Values](/articles/bayesialab/graph-windows-graph-panel-filtered-states/a/Importing Data with Filtered Values).
  • If the variable with Filtered Values already exists as a node in the network, several cases need to be differentiated:
    • No existing Filtered State in the continuous node in the network, but Filtered Values in the to-be-associated dataset:
      A new artificial interval with a width of 10-7 after the intervals that are already defined for the corresponding node.
    • An existing Filtered State in the continuous node in the network, but no Filtered Values in the to-be-associated dataset:
      • Should values of the variable happen to fall into the infinitesimally small interval assigned to the Filtered State, they will be treated as Filtered Values and assigned to the Filtered State.
    • An existing Filtered State in the continuous node in the network, plus Filtered Values in the to-be-associated dataset.
      • Filtered Values of the dataset are assigned to the existing Filtered State of the node.
      • Should values of the variable happen to fall into the infinitesimally small interval assigned to the Filtered State, they will be treated as Filtered Values and assigned to the Filtered State.

Editing Filtered States

The Node Editor features a tab that allows you to designate an existing state (or interval) as a Filtered State.


Copyright © 2025 Bayesia S.A.S., Bayesia USA, LLC, and Bayesia Singapore Pte. Ltd. All Rights Reserved.