liveBook · Manning

Chance node

As explained in Statistics Every Programmer Needs

A chance node is a decision-tree node representing an uncertain event with multiple possible outcomes and associated probabilities.

A chance node represents an uncertain event in a decision tree. It follows a choice or another chance event and branches into possible outcomes. Each outgoing branch has a probability; paths ultimately lead to payoffs. Unlike a decision node, a chance node does not represent a choice the decision-maker controls. section 10.2

To build and evaluate a chance node:

  • List every possible outcome, assign its probability, and check that the probabilities leaving that node sum to 1. section 10.2.1
  • Attach payoffs or further chance nodes to the outcomes. Nested chance nodes represent another uncertainty after an earlier outcome. section 10.2.1
  • Work backward from the payoffs: multiply each outcome’s payoff by its probability and add the results. Repeat at earlier chance nodes, then compare the choices. section 10.1.4 section 10.2

Evaluating a contract offer

Suppose one offer depends first on whether a player stays healthy (probability 0.75) or does not (0.25). Each health outcome leads to another chance node for performance incentives. The possible payoffs are $90 million, $120 million, and $150 million. Their probabilities are 0.10, 0.20, and 0.70 when healthy; 0.40, 0.30, and 0.30 otherwise. healthy = .10*90 + .20*120 + .70*150 # 138 million not_healthy = .40*90 + .30*120 + .30*150 # 117 million offer = .75*healthy + .25*not_healthy - 13 # 119.75 million The $13 million deduction represents agent fees. Against an alternative payoff of $120 million, this offer has a $0.25 million lower expected payoff under the stated probabilities. That comparison depends on those probabilities and payoffs being appropriate for the decision. section 10.2.1

>>> stays_healthy_payoff = (0.10 * 90000000 +
>>>                         0.20 * 120000000 +
>>>                         0.70 * 150000000)    #1
>>> does_not_stay_healthy_payoff = (0.40 * 90000000 +
>>>                         0.30 * 120000000 +
>>>                         0.30 * 150000000)    #2

>>> dodgers_expected_payoff = (0.75 * stays_healthy_payoff +
>>>                            0.25 * does_not_stay_healthy_payoff -
>>>                            agent_fees)    #3

>>> dodgers.name += (f'\nExpected Payoff: \
>>>        f"${dodgers_expected_payoff:,.0f}')    #4

>>> stays_healthy.name += (f'\nExpected Payoff: '
>>>        f'${stays_healthy_payoff:,.0f}')     #5
>>> does_not_stay_healthy.name += (f'\nExpected Payoff: '
>>>        f'${does_not_stay_healthy_payoff:,.0f}')    #6

The Python calculation rolls expected payoffs backward through the incentive and health chance nodes before deducting agent fees. section 10.2.1

A plotted tree can distinguish chance nodes from decision nodes with color and label outcomes with probabilities and expected payoffs. Although the diagram is built from left to right, interpret it from the terminal payoffs back toward the initial decision. section 10.2.2

How Statistics Every Programmer Needs covers it

How deep it goes
Develops a probability-checked schema, nested nodes, Python payoff calculations, and a plotted tree.
Examples
Uses investment outcomes and a contract offer with health and performance-incentive uncertainties.
What it assumes
Introduces the node types and probability rules while using basic Python and weighted arithmetic for implementation.
What you can do after
Build it from scratch as a probability-checked tree and calculate expected payoffs backward to compare choices.
How it connects
Links decision nodes, outcome probabilities, payoffs, expected value, and decision trees.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.