Skip to Content

Consistency

Context

Consistency compares two joint probabilities for an nn-dimensional observation EE.

  • the joint probability of the reference model, i.e. the current Bayesian network that represents the dependencies between the variables,
  • the joint probability of the straw model, i.e. the fully unconnected network, in which all the variables are marginally independent.
GC(E)=log⁡2(P(e1,…,en)∏i=1nP(ei))=LLS(E)−LLB(E)\mathrm{GC}(E) = \log_2\left(\frac{P(e_1, \ldots, e_n)}{\prod_{i=1}^n P(e_i)}\right) = \mathrm{LL}_S(E) - \mathrm{LL}_B(E)

where LLS(E)\mathrm{LL}_S(E) and LLB(E)\mathrm{LL}_B(E) are the log-losses associated with the evidence EE by using the straw model (SS) and the reference model (BB) respectively.

The log-loss reflects the cost (in bits) per instance of using our model, i.e. the number of bits that are needed to encode the probability of the pieces of evidence. The lower the probability is, the higher the log-loss is.

Positive Consistency means the reference model assigns the observation a higher probability and incurs lower Log-Loss than the independence baseline. Negative Consistency means the reference model assigns it a lower probability and incurs higher Log-Loss. BayesiaLab calls this a conflict.

Mean Consistency is the average difference in Log-Loss, in bits per observation. A positive mean indicates that the reference model incurs lower average Log-Loss on the observations being evaluated. The sign of the mean depends on the size and weight of the differences as well as their signs. See Information Gain for the current terminology.

Example

Let’s suppose we have the following reference structure with two Boolean nodes, N1\mathit{N1} and N2\mathit{N2}:

Reference structure: node N1 with an arc to node N2Monitors for N1 and N2, each showing 50 percent for False and True

Four different sets of two-dimensional evidence can be generated from this model:

  • E1:N1=False,N2=FalseE_1: \mathit{N1}=\mathrm{False}, \mathit{N2}=\mathrm{False}
  • E2:N1=False,N2=TrueE_2: \mathit{N1}=\mathrm{False}, \mathit{N2}=\mathrm{True}
  • E3:N1=True,N2=FalseE_3: \mathit{N1}=\mathrm{True}, \mathit{N2}=\mathrm{False}
  • E4:N1=True,N2=TrueE_4: \mathit{N1}=\mathrm{True}, \mathit{N2}=\mathrm{True}

In both examples below, each row’s Consistency is weighted by its probability under the reference model. Multiply each row’s Consistency by its reference probability and add the products. Calculating from the probabilities before rounding each row’s Consistency gives 0.531 bits for strong dependency and 0.007 bits for weak dependency.

Strong dependency

EvidenceJoint ProbabilityConsistency/Conflict
ReferenceStraw
E1E_10.450.250.848
E2E_20.050.25−2.322
E3E_30.050.25−2.322
E4E_40.450.250.848
Mean0.531

Weak dependency

EvidenceJoint ProbabilityConsistency/Conflict
ReferenceStraw
E1E_10.2750.250.138
E2E_20.2250.25−0.152
E3E_30.2250.25−0.152
E4E_40.2750.250.138
Mean0.007

Prior to version 6.0, the Consistency/Conflict metric was only available in:

New feature: Consistency as a network performance metric

Analysis menu with Network Performance open and Consistency highlighted

The chart shows the distribution of Log-Loss across observations in the associated dataset. The blue bars represent the reference model and the red bars represent the independence baseline.

Log-Loss for 6,003 observations. The mean is 27.668 bits for the reference model (blue) and 33.080 bits for the straw model (red). Mean consistency is 5.412 bits.

Bars farther left indicate lower Log-Loss and therefore higher probabilities for the observations. In this example, the reference model has lower mean Log-Loss.

As before, the straw model is the fully unconnected network. However, if the network contains discretized variables, we have a choice regarding the discretization. We can either keep the same discretization for both networks, or choose an alternative discretization algorithm for the straw model, with the requested number of bins being the same as the number of bins in the reference model.

Consistency window asking whether to keep the current discretization or change it for the straw model

Beyond the graphical comparison, the following Consistency Gain can be used to quantify the discrepancy between the reference model (BB) and the straw model (SS):

CG(E)=1−LLB(E)LLS(E)\mathrm{CG}(E) = 1 - \frac{\mathrm{LL}_B(E)}{\mathrm{LL}_S(E)}

for the evidence EE, and

CG=∑j=1NCG(Ej)N\mathrm{CG} = \frac{\sum_{j=1}^N \mathrm{CG}(E_j)}{N}

for the entire data set, where NN is the number of rows.

Example

Again, we use the simple reference structure with two Boolean nodes, N1\mathit{N1} and N2\mathit{N2}.

Strong dependency

Here, the associated dataset contains the 4 different weighted pieces of evidence that can be generated from the joint probability distribution represented by the reference model.

Data table of four weighted observations of N1 and N2, with the consistent rows weighted 0.45
EvidenceJoint ProbabilityLog-Loss
ReferenceStrawReferenceBaseline
E1E_10.450.251.1522
E2E_20.050.254.3222
E3E_30.050.254.3222
E4E_40.450.251.1522
Consistency Mean0.531
Consistency curve for the strongly dependent data, showing a Consistency Mean of 0.531

Weak dependency

Here, the associated dataset contains the 4 different weighted pieces of evidence that can be generated from the joint probability distribution represented by the reference model.

Data table of four weighted observations of N1 and N2, with near-uniform weights
EvidenceJoint ProbabilityLog-Loss
ReferenceStrawReferenceBaseline
E1E_10.2750.251.8622
E2E_20.2250.252.1522
E3E_30.2250.252.1522
E4E_40.2750.251.8622
Consistency Mean0.007
Consistency curve for the weakly dependent data, showing a Consistency Mean of 0.007

New: Relationship Analysis Report

Analysis menu with Report open and Relationship Analysis highlighted

As shown above, the Consistency Mean offers a good way to express the strength of the dependencies represented by the reference model. However, this metric can only be computed if data is available to sample the joint probability distribution.

If no data is associated with the model, the Consistency Mean can be efficiently approximated by computing the average of the sum of all Arc Forces (Kullback-Leibler Divergence) and the Mutual Information between all pairs of nodes that are connected by an arc. This Consistency Estimate is available in the first part of the Relationship Analysis Report:

Relationship Analysis Report with a Consistency Estimate column beside Kullback-Leibler Divergence and Mutual Information