#Causal Inference

Articles about Causal Inference — exploring patterns, best practices, and real-world implementations in production systems.

8 posts tagged with causal inference. ← All posts

#A/B Testing (3)#A2A (14)#ADK (8)#AG-UI (6)#AI (9)#AI Agents (311)#AI Architecture (22)#AI Cost (10)#AI Cost Optimization (8)#AI Engineering (254)#AI Evaluation (9)#AI Gateway (8)#AI Governance (39)#AI Red Teaming (9)#AI Research (9)#AI Safety (10)#AI Security (29)#AI in Production (12)#AML (3)#API Design (10)#API Security (8)#APIs (57)#AWS (17)#Accountability (8)#Accounting (9)#Agent Skills (3)#Agentic AI (25)#Agentic Commerce (12)#Agentic RAG (8)#Agents (4)#Amazon Bedrock (8)#Analytics (3)#Architecture (40)#Attention (3)#Audit (4)#Authentication (11)#Authorization (3)#Automation (9)#Azure (11)#Azure AI Foundry (9)#Backend Engineering (310)#Benchmarks (3)#Best Practices (3)#BigQuery (6)#Business Finance (8)#Business Strategy (55)#C (8)#CI/CD (16)#Caching (11)#Capital Markets (14)#Card Payments (12)#Cards (13)#Career (25)#Causal Inference (8)#Checkpointing (4)#Claude Code (8)#Cloud (5)#Cloud Architecture (3)#Cloud Native (10)#Code Review (8)#Collaboration (5)#Communication (9)#Compliance (54)#Computer Networking (9)#Computer Science (32)#Computer Vision (13)#Concurrency (40)#Consulting (3)#Containers (10)#Context Engineering (10)#Conversational AI (8)#Cost Optimisation (5)#Cost Optimization (3)#Credit (14)#Credit Risk (14)#CrewAI (8)#Crypto (12)#Cryptocurrency (12)#Cryptography (9)#Custody (9)#DSPy (8)#Data (14)#Data Engineering (15)#Data Science (8)#Data Structures (10)#Databases (40)#Deep Learning (20)#Deployment (5)#Design Patterns (10)#DevOps (24)#DevSecOps (22)#Developer Experience (5)#Developer Tools (5)#Differential Privacy (3)#Distributed Systems (98)#Documentation (3)#Edge AI (8)#Embeddings (21)#Emotional Intelligence (8)#Energy (8)#Engineering (13)#Engineering Culture (3)#Engineering Judgment (5)#Engineering Practices (16)#Error Handling (4)#Evaluation (67)#Event-Driven Architecture (8)#Explainable AI (8)#FREE-AI (8)#FX (5)#Feature Engineering (3)#Feedback (4)#FinOps (23)#FinTech (6)#Financial AI (14)#Financial Engineering (8)#Financial Systems (129)#Fine-Tuning (12)#Fintech (131)#Flutter (8)#Forecasting (9)#Foreign Exchange (5)#Forward Deployed Engineer (20)#Forward Deployed Engineering (8)#Fraud (10)#Function Tools (5)#Functional Programming (3)#Fundamentals (18)#Fundraising (8)#GCP (5)#GPU (8)#Gemma (4)#Generative AI (3)#Git (8)#Go (220)#Go-to-Market (11)#Google ADK (36)#Governance (61)#Granite (6)#Graph Neural Networks (8)#GraphQL (3)#Growth (3)#Guardrails (34)#HIPAA (3)#HTTP (3)#Harness Engineering (8)#Hiring (8)#Hugging Face (8)#Human-in-the-Loop (9)#IBM watsonx (8)#Identity (11)#Inference (8)#Information Retrieval (8)#Integration (3)#Intellectual Property (8)#Interfaces (3)#Interpretability (8)#JavaScript (8)#KYC (11)#KYC and AML (12)#Kafka (10)#Knowledge Graphs (10)#Kubernetes (17)#LLM (5)#LLM Inference (8)#LLM Infrastructure (8)#LLM-as-Judge (3)#LLMOps (8)#LLMs (190)#LangChain (8)#LangGraph (11)#Leadership (28)#Ledger (12)#Legal (8)#Lending (14)#Linux (9)#LlamaIndex (8)#Load Balancing (3)#MCP (22)#MLOps (35)#Machine Learning (108)#Marketing (16)#Markets (4)#Mathematical Finance (8)#Memory (15)#Memory Management (5)#Metrics (7)#Microservices (3)#Microsoft Agent Framework (150)#Middleware (6)#Migration (9)#Mixture of Experts (5)#Monitoring (4)#Multi-Agent (10)#Multi-Agent AI (14)#Multi-Agent Systems (73)#Multimodal (3)#Multimodal AI (10)#NIM (5)#NVIDIA (8)#Networking (3)#OAuth (3)#OWASP (7)#Observability (50)#On-Device AI (8)#Ontology (8)#Open Source (7)#OpenTelemetry (5)#Operating Systems (9)#Operations (11)#Opinion (6)#Orchestration (10)#Organizational Design (8)#Payment Rails (16)#Payments (54)#People (8)#Performance (56)#Personalization (9)#Platform Engineering (9)#Policy as Code (3)#PreSales (8)#Privacy (13)#Privacy Engineering (3)#Process (4)#Product (30)#Product Management (8)#Production (21)#Programming (10)#Programming Languages (48)#Prompt Engineering (78)#Prompt Injection (14)#Protocol Buffers (3)#Protocols (9)#Providers (4)#Pydantic AI (8)#Python (142)#Quality (3)#Quantitative Finance (8)#RAG (69)#RBI (3)#REST (5)#Rails (16)#Reasoning Models (8)#Recommender Systems (8)#Reconciliation (3)#RegTech (8)#Regulation (10)#Reinforcement Learning (9)#Reliability (53)#Resilience (4)#Responsible AI (5)#Retrieval (3)#Risk (14)#Risk Management (10)#Rust (32)#SLSA (3)#SRE (23)#Sales (9)#Scalability (5)#Search (10)#Security (101)#Security Engineering (8)#Self-Evolving Agents (16)#Semantic Web (8)#Sessions (3)#Settlement (9)#Soft Skills (8)#Software (3)#Software Architecture (36)#Software Delivery (9)#Software Engineering (144)#Spanner (4)#Speech (8)#Startups (30)#Statistics (8)#Strands (8)#Strategy (6)#Streaming (32)#Structured Output (4)#Supply Chain Security (9)#Sustainability (8)#System Design (32)#Systems Programming (56)#Testing (59)#Threat Modeling (3)#Time Series (8)#Tool Use (22)#Tooling (5)#Tools (3)#Trading (8)#Treasury (6)#Type System (3)#Type Systems (11)#TypeScript (8)#Vector Databases (22)#Vector Search (11)#Venture Capital (8)#Version Control (9)#Voice AI (9)#Web Development (6)#Workflow (3)#Workflows (14)#eBPF (8)#gRPC (13)#smolagents (8)
Pratik Dhanave · ·7 min read

Causal Inference in Practice — From Theory to Better Decisions

Causal inference isn't an academic exercise — it's the discipline that makes data-driven decisions actually work instead of merely feeling rigorous. This closing post pulls the series into practice: how to approach a real causal question, how causal thinking fixes the most common ML and analytics mistakes, and the honest judgment about what you can and can't conclude. It's the difference between knowing what correlates with success and knowing what causes it.

Causal inference is the discipline that makes data-driven decisions actually work. A practical workflow for any causal question, how causal thinking fixes the most common ML and analytics mistakes (acting on confounded correlations, using predictive features as causal levers), and the calibrated humility that is the real rigor.

Pratik Dhanave · ·7 min read

Natural Experiments — When the World Randomizes for You

Sometimes you can't run an experiment, but the world runs one for you. A policy change, a lottery, an arbitrary cutoff, a quirk of timing — these can assign a "treatment" in a way that's effectively random, letting you recover experimental-grade causal evidence from observational data. Natural experiments are the most ingenious tools in causal inference, and the quasi-experimental methods built on them (instrumental variables, difference-in-differences, regression discontinuity) are how economists and data scientists establish causation when a controlled trial is impossible.

Sometimes the world runs the experiment for you — a policy change, a lottery, an arbitrary cutoff assigns treatment as-if-randomly. The three canonical designs (instrumental variables, difference-in-differences, regression discontinuity) that recover experiment-grade credibility from observational data, and their assumptions.

Pratik Dhanave · ·7 min read

Observational Methods — Causal Inference Without an Experiment

Often you can't run an experiment — it's unethical, infeasible, or too slow — but you still need to know whether something causes something. Observational causal inference is the set of techniques for extracting causal conclusions from data you didn't control, by reconstructing the comparable groups that randomization would have given you for free. This post covers the main tools (adjustment, matching, propensity scores) and the uncomfortable assumption they all depend on.

When you can't experiment, observational methods reconstruct the comparable groups randomization gives for free — adjustment, matching, propensity scores. All share one goal (remove confounders' influence) and one unprovable Achilles' heel: the 'no unmeasured confounding' assumption. How to use them honestly.

Pratik Dhanave · ·7 min read

Causal Graphs — Drawing What You Believe Causes What

Causal reasoning gets dramatically clearer when you draw it. A causal graph is a diagram of what causes what — nodes for variables, arrows for causal influence — and it turns fuzzy debates about confounding and adjustment into visual rules you can actually check. This post introduces causal graphs (DAGs) and the single most useful thing they do: tell you exactly which variables to control for, and which ones you must leave alone.

Causal reasoning gets clearer when you draw it. A causal graph (DAG) turns fuzzy debates about confounding and adjustment into visual rules: the three building blocks (chain/mediator, fork/confounder, collider) and why 'control for everything' is wrong — adjusting the wrong variable adds bias.

Pratik Dhanave · ·6 min read

Randomized Experiments — The Gold Standard, and Your A/B Test

The most reliable way to establish causation is almost embarrassingly simple: flip a coin to decide who gets the treatment. Randomization is the one technique that defeats confounding completely — including confounders you never thought of — which is why the randomized controlled trial is the gold standard of causal evidence and why the A/B test is the most powerful tool an engineer has. This post explains why randomization works its magic, and the many ways real experiments still go wrong.

The most reliable way to establish causation is almost embarrassingly simple: randomize. Why randomization defeats all confounders at once (even unknown ones), why the A/B test is a genuine causal tool, and the many ways real experiments still go wrong (peeking, power, interference, broken randomization).

Pratik Dhanave · ·7 min read

Confounding — The Central Villain of Causal Inference

If you remember one thing about why causal conclusions go wrong, make it confounding. A confounder is a lurking variable that influences both the treatment and the outcome, manufacturing a correlation that looks causal but isn't. It's the reason observational data is so treacherous, the reason randomized experiments are the gold standard, and the single concept that explains most spurious causal claims in business, science, and ML. This post makes confounding concrete and shows why it's so hard to defeat.

A confounder influences both the treatment and the outcome, manufacturing a correlation that looks causal but isn't — the reason observational data is treacherous and experiments are the gold standard. Why it produces confident wrong conclusions, why unmeasured confounders are the nightmare, and how the field fights it.

Pratik Dhanave · ·6 min read

Potential Outcomes — Defining a Causal Effect Precisely

To reason about causation rigorously, you first need to define what a "causal effect" even is — and the answer is more subtle than it looks. The potential-outcomes framework defines it through a counterfactual: the difference between what happened and what would have happened otherwise. That single idea, and the "fundamental problem" that you can never observe both, is the foundation on which all of causal inference is built.

To reason about causation you must define a causal effect: the counterfactual difference between what happened and what would have happened otherwise. The potential-outcomes framework, the fundamental problem (you can never observe both), and why everything reduces to making treated and untreated groups comparable.

Pratik Dhanave · ·6 min read

Correlation Is Not Causation — Why Engineers Keep Getting This Wrong

Every data-driven engineer knows the phrase "correlation is not causation," and almost everyone violates it anyway — in A/B test readouts, in metric dashboards, in ML models used to make decisions. The gap between "these move together" and "this causes that" is where enormous amounts of money and effort get wasted on changes that don't work. Causal inference is the discipline of crossing that gap rigorously, and this series builds it from first principles for people who build systems.

Everyone knows 'correlation is not causation' and violates it anyway — in A/B readouts, dashboards, and ML used to drive decisions. The real difference (observing vs intervening), the three reasons correlation appears without causation (reverse causation, confounding, selection), and why it's an engineering problem.

All posts on this site are written by Pratik Dhanave, an Agentic AI Architect with 7+ years building production distributed systems, multi-agent AI platforms, and cloud-native infrastructure. About the author → Each article includes working code, architecture diagrams, and references to the specific frameworks and standards discussed. Browse all posts or explore related topics using the tag cloud above.