Pricing under confounding¶
The flagship. Offline data is logged under a behaviour policy that ties the action to a confounder
z which also drives the outcome — retention teams gave big discounts to the customers most
likely to churn. A controller that fits the action's effect without adjusting for z learns
the wrong sign and drives the true plant away from its target; adjusting for z recovers the effect
and control succeeds. Both controllers plan with their learned effect and act on the true system.
uv run python scripts/flagship_demo.py
What it printed when this site was built:
true effect b = +1.000
naive estimate = -0.200 (confounded, wrong sign)
causal estimate = +1.001 (adjusted for z)
target x* = +2.000
causal final x = +1.847 -> reaches target
naive final x = -20.179 -> wrong way, at the actuator limit
wrote outputs/flagship.png
With matplotlib installed the script also writes outputs/flagship.png;
tutorial 1 draws the same comparison and scores
it against an oracle. Code: chc.flagship, on
chc.causal.