Skip to Content
BayesiaLabKey ConceptsPearson Correlation

Pearson Correlation

Context

In BayesiaLab’s approach to learning and analyzing Bayesian networks, statistical concepts play a secondary role compared to concepts from the field of Information Theory. Nevertheless, statistical measures, such as correlation, can provide certain insights that are unavailable from non-statistical measures.

Definition

The Pearson Correlation Coefficient rr between two nodes XX and YY is defined as the covariance of the two corresponding variables divided by the product of their standard deviations:

r=cov⁡(X,Y)σXσYr = \frac{\operatorname{cov}(X,Y)}{\sigma_X\sigma_Y}

The covariance is

cov⁡(X,Y)=∑x,yp(x,y) (Vx−vX)(Vy−vY)\operatorname{cov}(X,Y) = \sum_{x,y} p(x,y)\,(V_x - v_X)(V_y - v_Y)

The standard deviation of XX is

σX=∑xpx (Vx−vX)2\sigma_X = \sqrt{\sum_x p_x\,(V_x - v_X)^2}
  • VxV_x and VyV_y are the values associated with states xx and yy.
  • vXv_X and vYv_Y are the expected values of XX and YY.
  • pxp_x is the marginal probability of state xx.
  • p(x,y)p(x,y) is the joint probability of states xx and yy.

Special considerations

  • For calculating the Pearson Correlation rr, BayesiaLab must use the values of node states.
  • In BayesiaLab, there are Discrete Nodes and Continuous Nodes with discretized numerical states. As a result, the value of a node’s state may not always be apparent:
    • For Discrete Nodes that have states with integer or real values, BayesiaLab uses these numerical values directly.
    • For states without numeric values, BayesiaLab uses their zero-based indices. For example, red\mathrm{red}, green\mathrm{green}, and blue\mathrm{blue} in that order use the values 0, 1, and 2.
    • For Continuous Nodes, BayesiaLab uses the mean values of each interval.
  • Please see Mean, Value, and Standard Deviations for a detailed discussion.