MandiIQ
Causal Agricultural Intelligence

Testing Policy Thresholds
On Mandi Margins

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.

Regression Discontinuity Causal Inference DuckDB Warehouse FastAPI Streamlit XGBoost Prophet
01 / LIVE METRICS

Warehouse Scale & Coverage

Price Records
Live transaction records
Commodities
Unique agricultural commodities
Districts
Markets covered
RDD Estimates
Causal estimates computed
Deployment Surface Health checking…
LATESTSTALEDOWNAUTH/STATIC
02 / PIPELINE ARCHITECTURE

Data Flow & Processing

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;
03 / EMPIRICAL FINDINGS

Regression Discontinuity Results

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.

Empirical Results
CropP-Value
Onionp < 0.05 ✓
Tomatop = 0.74
Potatop = 0.31
03 · OMEGA QUANTUM FIELD

Autonomous Quantum Field

Live causal-agency swarm — QVE simulated-annealing placement, rendered in Three.js from the live pipeline.

MandiIQ · OMEGA

Quantum Particle Field

QVE simulated-annealing placement
Particles
QUBO Energy
Agent Alerts
Causal Edges
Market Drivers · out-degree
state —
prediction
confidence
energy
Collapsing superposition…
↖ Live Metrics ↖ Architecture Explore All Pages →