Skip to Content

Parameter Estimation

Now we can see the real benefit of bringing all variables as nodes into BayesiaLab. To calculate Mutual Information, all the terms of the equation I(X,Y)=H(X)−H(X∣Y)I(X,Y)=H(X)-H(X \mid Y) can be easily computed with BayesiaLab once we have a fully specified network.

We start with a pair of nodes, namely Neighborhood\mathit{Neighborhood} and SalePrice\mathit{SalePrice}. As opposed to LotArea\mathit{LotArea}, which is a discretized Continuous variable, Neighborhood\mathit{Neighborhood} is categorical, and, as such, it has been automatically treated as Discrete in BayesiaLab. This is the reason the node corresponding to Neighborhood\mathit{Neighborhood} has a solid border. We now add an arc between these two nodes to explicitly represent the dependency between them:

Neighborhood and SalePrice nodes in the Ames example

In BayesiaLab 11.9.1, adding this arc retains the existing marginal probabilities in each new CPT row. These repeated values do not yet describe the dependency in the data. We must estimate the Conditional Probability Table (CPT) of SalePrice\mathit{SalePrice} given Neighborhood\mathit{Neighborhood}. In Chapter 4, we supplied CPTs from existing knowledge. Here, the associated database supplies the observations. The table below shows its first 10 records, including the missing Neighborhood values.

Loading SVG...

Counting all records gives the observed marginal counts of Neighborhood\mathit{Neighborhood}. Of the 2,930 records, 443 have a missing Neighborhood value; they are shown separately below.

Loading SVG...
Click to Zoom

Because Neighborhood\mathit{Neighborhood} is the parent of SalePrice\mathit{SalePrice}, we need the distribution of price states within each neighborhood. A cross-tabulation counts the known pairs. With Structural EM selected, BayesiaLab also estimates contributions from records with missing Neighborhood values. The completed occurrence table below therefore contains fractional counts, rather than only complete-case integer counts.

Loading SVG...
Click to Zoom

For complete data, normalizing each row of a count table illustrates how a CPT is obtained. Here, the following table reproduces the probabilities actually returned by BayesiaLab’s estimator with Structural EM. Tiny nonzero estimates are retained, and displayed rounding can affect row totals. Together, the network structure and the CPTs comprise the Bayesian network.

Loading SVG...
Click to Zoom

In practice, however, we do not need to bother with these individual steps. Rather, BayesiaLab can automatically learn all marginal and conditional probabilities from the associated database. We select Menus > Learning > Parameter Estimation to perform this task.

After Parameter Estimation, double-click SalePrice\mathit{SalePrice} to open the Node Editor. Under Probability Distribution > Tabular, verify the 27 Neighborhood\mathit{Neighborhood} rows and five SalePrice\mathit{SalePrice} columns. These probabilities match the table above, up to the displayed rounding.

Learned 27 by 5 SalePrice conditional probability table

This model now provides the basis for computing the Mutual Information between Neighborhood\mathit{Neighborhood} and SalePrice\mathit{SalePrice}. BayesiaLab computes Mutual Information on demand and can display its value in numerous ways. For instance, in Validation Mode F5, we can select Menus > Analysis > Visual > Overall > Arc > Mutual Information.

Arc Mutual Information visualization

The value of Mutual Information is now represented graphically in the thickness of the arc. This does not give us much insight because we only have a single arc in this network. So, we click the Show Arc Comments icon in the Toolbar to show the numerical values.

Pair network with child-relative and parent-relative mutual information

In the current display, the blue number is relative Mutual Information for the child, SalePrice\mathit{SalePrice}, and the red number is relative Mutual Information for the parent, Neighborhood\mathit{Neighborhood}. The Relationship Analysis report gives the absolute Mutual Information: 0.6462 bits. Mutual Information is symmetric, so the absolute amount is the same in both directions; the relative percentages differ because the nodes have different entropies.

Loading SVG...
Click to Zoom

The blue value divides Mutual Information by the marginal entropy of the child, SalePrice\mathit{SalePrice}:

0.64621.8500≈0.3493=34.93%\displaystyle \frac{0.6462}{1.8500} \approx 0.3493 = 34.93\%

The red value divides the same Mutual Information by the marginal entropy of the parent, Neighborhood\mathit{Neighborhood}:

0.64624.2625≈0.1516=15.16%\displaystyle \frac{0.6462}{4.2625} \approx 0.1516 = 15.16\%

Knowing Neighborhood\mathit{Neighborhood} therefore reduces uncertainty about SalePrice\mathit{SalePrice} by about 34.93% on average. Knowing SalePrice\mathit{SalePrice} reduces uncertainty about Neighborhood\mathit{Neighborhood} by about 15.16%. These are the two directional Relative Mutual Information values. They should not be confused with the report’s Symmetric Normalized Mutual Information (18.2629%) or Symmetric Relative Mutual Information (23.0123%).

To compare predictors, we next compute their relationships with SalePrice\mathit{SalePrice} in a network containing all 49 variables.