MandiIQ applies Causal Regression Discontinuity Designs (RDD) to test whether IMD rainfall-deficit thresholds drive structural margins in national commodity markets. Live metrics for price records, commodities, districts, and causal estimates are fetched in real-time from the pipeline below.
Live data flows from government APIs through DuckDB into the causal inference engine. Key warehouse metrics update in real-time from /health.
%%{init: {"theme": "dark", "themeVariables": { "primaryColor": "#1a1a2e", "primaryTextColor": "#fff", "lineColor": "#d7ff00"}}}%%
flowchart TB
subgraph Sources["Data Sources"]
A1["Agmarknet API<br/>Daily Mandi Prices"]
A2["IMD Weather Grids<br/>Rainfall Departure"]
end
subgraph Storage["Analytical Store"]
C1["DuckDB<br/>mandi_iq.duckdb<br/>{{n_prices}} records"]
end
subgraph Analysis["Causal Engine"]
D1["RDD Analysis<br/>Local-linear + FE"]
D2["Forecast<br/>Seasonal Naive"]
end
subgraph Serving["Serving"]
F1["FastAPI Gateway<br/>/health /prices /forecast"]
F2["Streamlit Dashboard<br/>Interactive UI"]
end
A1 --> C1; A2 --> C1; C1 --> D1; C1 --> D2; D1 --> F1; D2 --> F1; F1 --> F2;
Does the IMD declaring a region as "rain-deficient" drive agricultural market behavior? We test discontinuity at the official -20% deficit cutoff.
Key Finding: Onions show statistically significant price jumps (p < 0.05) at the threshold, suggesting active hoarding behavior. Other crops show continuous responses.
Live causal-agency swarm — QVE simulated-annealing placement, rendered in Three.js from the live pipeline.