Bayesian Networks vs. Petersburg

A couple of weeks ago we walked through how petersburg represents complex decisions (check it out here).

Some of you may have recognized a familiar concept in that description: Bayesian networks (or bayesnet).  Just like petersburg’s structure, a Bayesian network is at it’s core a Directed Acyclic Graph (DAG).  So let’s first discuss what a Bayesian Network is.

Bayesian Networks

A Bayesian network is a graph representation of conditional dependencies between a set of random variables.  The nodes of the DAG are Bayesian random variables, generally an observed quantity or a latent variable.  The connections between these random variable nodes represent the conditional dependencies between the nodes.  Using the example from wikipedia:

 

Screen Shot 2016-01-23 at 12.45.37 PM

In this example, the sprinkler is influenced by whether or not it is raining, and the wetness of the grass is influenced by both the sprinkler and rain. The core form of analysis for the Bayesian network here is the joint probability function, which is a multivariate expression of a probability density function (PDF), cumulative density function (CDF) or probability mass function (PMF).  For this simple example, that would look like:

mathrm P(G,S,R)=mathrm P(Gmid S,R)mathrm P(Smid R)mathrm P(R)

This equation shows us the relationship outlined by the Bayesian network, notably that the probability of grass being wet is influenced by the sprinkler and rain (first term), the probability of the sprinkler being on is influenced by the rain (second term) and the probability of rain is independent of the other two (final term).

Petersburg

Bayesian networks can be extremely useful for inference and learning tasks, while petersburg is focused on a narrower problem space: decisions under uncertainty.  This means that petersburg’s graphs must have the core concept of decision theory baked in: cost.  Decision theory problems are focused around the idea of finding the best choice for an agent under uncertainty (which is well represented by Bayesian networks), payoffs, and costs (which are not as well represented).

So we think of petersburg as a specialized subset of Bayesian networks.  They differ by:

  1. All edges in a petersburg have a cost.
  2. All nodes in a petersburg have a payoff.
  3. All graphs in petersburg have a single explicit starting node (a node with no input edges).

In this way, petersburg’s graphs inherit the analytical techniques applicable to Bayesian networks, which is convenient.  Reflecting on the sprinkler example, we can re-structure it as a decision problem: should I turn on the sprinkler today? We have the same options available, we can turn on the sprinkler or not, and it could rain or not.  But we introduce costs and payoffs.  There is a cost to turn on the sprinklers themselves (N), and a cost of the grass not getting watered at all and dying (M).  For simplicity, we will set all edge weights to 1, so every choice edge is equally likely to be taken (50% chance of rain).  The petersburg graph would look like:

Screen Shot 2016-01-23 at 1.12.53 PM

With this structure, given a chance of rain and cost figures, we can evaluate the decision of whether or not to turn on the sprinklers according to different strategies (minimizing risk of ruin, maximizing chance of windfall, or maximizing expected outcome).  If the chance of rain is unknown, this structure can be used to find the chance of rain at which turning on the sprinkler becomes profitable, or given only the chance of rain and the cost of watering, the cost of grass dying at which watering becomes profitable can be found.

Conclusion

So it turns out that a graph in petersburg is just a Bayesian Network with a few extra pieces of meta-data on the edges and nodes, and an explicit single starting node.  In future posts we will expand on this concept by applying some of the analysis techniques for Bayesian networks to graphs in petersburg, alongside the simulative analysis made possible by the python package: petersburg.

The post Bayesian Networks vs. Petersburg appeared first on Will’s Noise.