Advanced Econometric Modeling, Adversarial Game Theory, Operations Research & Native Desktop Node-Spreadsheet
A boardroom-grade enterprise decision architecture engineered for C-suite executives, corporate strategy leaders, and quantitative operators. Unifying 20+ advanced econometric, machine learning, and game-theoretic engines with a native high-speed desktop spreadsheet grid (PySide6 / Qt6), an interactive visual DAG pipeline canvas, autonomous swarm intelligence audits, and standalone Windows executable packaging.
The entire decision suite is bundled into a native desktop application with zero browser dependencies:
- Windows Standalone Executable (1-Click Run):
- Double-click
RUN_EXE.batordist\DecisionGraph\DecisionGraph.exe. - Runs with zero Python or library dependencies required.
- Double-click
- Intelligent Auto-Detect Launcher:
- Double-click
START_APP.bat. - Automatically runs
DecisionGraph.exeif present; otherwise seamlessly boots via Pythonrun.py.
- Double-click
- Terminal Launch:
python run.py
- Run Deterministic Verification Suite (51 Tests):
python -m pytest -v
[ Multi-Channel Order & Path Streams ]
│
┌─────────────────────────┬───────────────┴───────────────┬─────────────────────────┐
▼ ▼ ▼ ▼
[ Causal DML Elasticity ] [ Level-k Adversarial ] [ Ostrom Commons CPR ] [ Spectral Hypergraph ]
Neyman-Orthogonal Score Quantal Response (QRE) Tragedy-of-the-Commons Perron-Frobenius Katz
Robinson Residualization Price War Defection Defense CAC Kill-Gate Throttle Algebraic Connectivity
│ │ │ │
├─────────────────────────┼───────────────────────────────┼─────────────────────────┤
▼ ▼ ▼ ▼
[ Synthetic Control Lift ] [ Markowitz Frontier ] [ Universal Excel ] [ Stochastic CCC Float ]
Abadie Donor Pool Match Quadratic Programming Fuzzy Column Resolver Negative Working Capital
Counterfactual Lift Est. VaR 95% Ad Allocation Messy Workbook Ingest Treasury Yield Generation
│ │ │ │
├─────────────────────────┼───────────────────────────────┼─────────────────────────┤
▼ ▼ ▼ ▼
[ Multi-Echelon MEIO ] [ Multivariate Anomaly ] [ Supply Network Graph ] [ Customer Equity CLV ]
Stochastic Safety Stock Mahalanobis Regularization PageRank Node Authority Kaplan-Meier Survival
Normal Unit Loss G(z) Chi-Square P-Value Outliers Systemic Fragility Index Forward RFM Waterfall
│ │ │ │
├─────────────────────────┼───────────────────────────────┼─────────────────────────┤
▼ ▼ ▼ ▼
[ Cash Flow at Risk CFaR ] [ Bayesian Bandits MAB ] [ Mixed Logit Demand ] [ Conformal Prediction ]
Cholesky Correlated Shocks Thompson Sampling Poster Diversion Ratio Matrix Finite-Sample P >= 1-alpha
95% VaR & CVaR Tail Risk 75%+ Regret Reduction vs AB Cross-Price Elasticity SHAP Game Feature Axioms
To make sound executive decisions, leaders must be able to picture the physical mechanics behind the equations:
Imagine selling umbrellas. On rainy days, sales skyrocket even at $30. On sunny days, sales hit zero even at $5. A naive algorithm assumes higher prices cause higher sales because it cannot see the rain.
How DML Works: Two robotic scrubbers clean the data. Scrubber 1 scrubs away customer wealth and seasonal demand. Scrubber 2 scrubs away promotional pricing noise. What remains is a crystal-clear lens revealing true, unconfounded price sensitivity.
Standard pricing treats competitors as frozen statues. In reality, if you cut prices to steal share, rivals retaliate. Both firms bleed out in a destructive race to the bottom.
How Game Theory Solves This: Level-1 shoots where the rival stands today. Level-2 anticipates your move and steps aside. Level-3 (Our Engine) fires where the rival is about to jump. The engine calculates the Nash/QRE equilibrium ($81.47), maximizing cash margin while making competitor price attacks mathematically suicidal.
Shared ad auction pools (Google/Meta Ads) are an open-access fishing lake. When rival brands get greedy and flood the water with bids, the lake gets muddy and Cost-Per-Acquisition (CAC) explodes from $20 to $90 (Hardin's Tragedy of the Commons).
What Our Engine Does: A watchtower tracks the Commons Depletion Index. The instant congestion triggers an automated kill-gate, your budget quietly pulls out of the war and slips down a private canal (high-ROI email and organic channels), acquiring customers for $15 while competitors incinerate capital.
Customer journeys are pinballs bouncing across touchpoints: Instagram -> Tech Blog -> Retargeting -> Email -> Purchase. Last-click attribution gives 100% of the glory to Email just because it was touched last.
What Spectral Graph Theory Does: It treats the marketing ecosystem as an electrical grid. Using Perron-Frobenius leading eigenvectors and Katz attenuation, it measures structural network bridges, proving which early channels created the momentum so you never cut the fuel line.
When launching a regional marketing campaign or price test, you cannot run an A/B test in the past. You don't have a time machine.
What Synthetic Control Does: It blends untreated donor regions (e.g. 40% South + 35% East + 25% West) into a virtual "Doppelganger Clone" that mirrored your test region before the campaign. By comparing your real region against its synthetic twin during the campaign, the exact incremental lift is isolated without speculation.
Pouring all ad spend into the single highest-return channel causes channel exhaustion and high variance.
How Markowitz Solves This: It treats marketing channels and SKU inventory like financial assets. It solves the quadratic Pareto frontier under 95% Value-at-Risk (VaR), allocating capital to achieve optimal portfolio returns while strictly hedging downside concentration risk.
Customers pay immediately on Day 0. Inventory turns in 14 days. Suppliers are paid on Day 60.
The 44-Day Gap: You hold customer cash in your bank for 44 days before owing suppliers. For a $5M enterprise, you permanently float $600,000 of other people's money. The engine simulates risk-free money-market Treasury yields ($11,523/year) that self-fund ad spend before bills come due.
Computes mathematically optimal safety stock and reorder points under joint demand and lead-time stochasticity:
Surveys multi-dimensional transaction vectors (Revenue, Margin, Discount, Quantity, Shipping Cost) using regularized Mahalanobis Distance:
Constructs bipartite and multipartite operational graphs linking Accounts, SKUs, Categories, and Logistics Hubs. Solves the stationary PageRank authority vector via power iteration:
Simulates 5,000 correlated multi-variable macroeconomic shock paths (Stochastic Revenue Growth x COGS Inflation Surge x Operating Expense Drift x Debt Service). Preserves correlation structures via Cholesky decomposition of the covariance matrix (
Replaces wasteful static 50/50 A/B testing with Bayesian Thompson Sampling and Upper Confidence Bound (UCB1) algorithms. Draws conversion probabilities from conjugate Beta-Binomial posteriors ($\theta_k \sim \text{Beta}(\alpha_k + S_k, \beta_k + F_k)$), dynamically routing traffic to the highest-performing variant and slashing cumulative opportunity regret by up to 90%.
F. Random Coefficient / Mixed Logit Demand & Cannibalization Engine (src/mixed_logit_cannibalization.py)
Overcomes the restrictive Independence of Irrelevant Alternatives (IIA) assumption of basic Multinomial Logit by modeling heterogeneous consumer price sensitivities (
Computes distribution-free, finite-sample prediction sets for classification and intervals for regression with exact coverage guarantees:
Provides mathematically consistent feature attribution satisfying Efficiency, Symmetry, Dummy (Null Player), and Additivity axioms:
Quantifies omitted variable bias and unobserved confounder robustness (Cinelli & Hazlett, 2020, JRSS-B):
Evaluates sequential decision making, player impact, and high-pressure performance across state spaces:
Solves mixed-integer linear programming (MILP) capital and resource allocation under hard financial purse ceilings:
The engine was benchmarked on the canonical Global Superstore Enterprise Retail Dataset (9,426 orders across 2,703 accounts over 4 years). All outputs are published in examples/outputs/:
| Real-World Deliverable | Output Path | Key Empirical Results |
|---|---|---|
| Causal Price Elasticity | superstore_dml_elasticity.csv |
DML estimated unconfounded price elasticity [-0.043, -0.016]). Confirmed high price-inelasticity across enterprise office lines. |
| Customer Equity Waterfall | superstore_clv_waterfall.csv |
746 Champions deliver $771,207.65 in 12-month forward expected net margin equity (77.8% of total portfolio equity). |
| DuPont 3-Tier ROE | superstore_dupont_roe.csv |
Total ROE of 113.75%, decomposed into 26.15% net profit margin, 2.18x asset turnover, and 2.00x equity leverage. |
| Stochastic Cash Float Yield | superstore_working_capital_float.csv |
-44 days Cash Conversion Cycle (CCC) generated $68,363.39/year in risk-free treasury float returns. |
| Multi-Echelon MEIO Policy | superstore_inventory_meio.csv |
Optimized inventory policies across 1,263 operational categories, committing $646,081.87 working capital while achieving 99.8%+ fill rates. |
| Multivariate Anomaly Leakage | superstore_anomaly_leakage_summary.csv |
Isolated 268 anomalous transactions (2.84% anomaly rate) via Mahalanobis distance at |
| Network Fragility & SPOF | superstore_network_vulnerability.csv |
Identified Technology (Fragility: 64.66) and Furniture (Fragility: 51.72) as primary systemic throughput dependencies. |
| Synthetic Control Lift | superstore_synthetic_control_lift.csv |
Abadie Synthetic Control isolated true quarterly promotional expansion lift of +$7,321.58/quarter against donor regions. |
| Markowitz Capital Allocation | superstore_markowitz_allocation.csv |
Solved optimal Pareto capital allocation across Furniture, Office Supplies, and Technology under VaR constraints. |
Handles chaotic, unstandardized business Excel workbooks (.xlsx, .xls, .csv) with zero manual cleanup:
from src.excel_universal_ingestor import UniversalExcelIngestor
# Ingest any messy client workbook in 1 line
ingestor = UniversalExcelIngestor()
clean_df = ingestor.ingest_file("path/to/messy_client_data.xlsx")
# Automatically resolves column synonyms (Cust_ID, Selling Rate, Net Sales)
# Strips currency signs ('$', '₹', '%', commas) and derives customer cohort months
print(clean_df.head())decision-analytics-engine/
├── data/ <- Generated transaction datasets and pipeline CSV outputs
├── examples/
│ ├── raw_online_data/ <- Raw Global Superstore benchmark dataset (9,426 rows)
│ ├── outputs/ <- Real-world benchmark CSV deliverables
│ ├── run_superstore_benchmark.py <- Benchmark execution script on live retail data
│ └── README.md <- Detailed case study writeup and empirical findings
├── src/
│ ├── __init__.py
│ ├── cash_flow_at_risk_cfar.py <- Correlated Monte Carlo CFaR & balance sheet stress testing
│ ├── bandit_experimentation.py <- Dynamic Bayesian Multi-Armed Bandit (Thompson & UCB1)
│ ├── mixed_logit_cannibalization.py<- Random-coefficient demand & product diversion matrix
│ ├── supply_chain_meio.py <- Multi-echelon inventory and safety stock optimizer
│ ├── multivariate_anomaly.py <- Mahalanobis distance margin leak and outlier engine
│ ├── supply_network_graph.py <- PageRank network graph centrality and fragility
│ ├── conformal_prediction.py <- Split-conformal distribution-free coverage engine
│ ├── shap_attribution.py <- Game-theoretic SHAP feature attribution engine
│ ├── causal_sensitivity_bounds.py <- Cinelli & Hazlett unobserved confounder RV engine
│ ├── markov_wpa_xrop.py <- Second-order Markov chain WPA and xROP engine
│ ├── knapsack_auction_optimizer.py <- MILP capital allocation and purse optimizer
│ ├── cohort_retention.py <- Longitudinal cohort and Kaplan-Meier churn hazard
│ ├── price_elasticity.py <- Econometric log-linear demand regression models
│ ├── causal_elasticity_dml.py <- Double / Debiased Machine Learning (DML) engine
│ ├── adversarial_game_pricing.py <- Level-k and Logit QRE competitive pricing solver
│ ├── ostrom_commons_governance.py <- Elinor Ostrom CPR bidding war governance engine
│ ├── synthetic_control.py <- Abadie Synthetic Control quasi-experiment engine
│ ├── portfolio_markowitz.py <- Markowitz quadratic programming capital allocator
│ ├── spectral_attribution.py <- Perron-Frobenius and Katz spectral graph attribution
│ ├── stochastic_float_engine.py <- DuPont 3-tier ROE & negative CCC float simulation
│ ├── clv_model.py <- RFM portfolio segmentation and forward CLV equity
│ ├── marketing_attribution.py <- First-order Markov chain removal-effect attribution
│ └── dashboard.py <- Interactive 8-tab Streamlit executive decision cockpit
├── tests/
│ ├── __init__.py
│ ├── test_cfar_and_experimentation.py <- CFaR, MAB Bandits & Mixed Logit tests (7 passing)
│ ├── test_analytics.py <- Baseline mathematical invariant tests (11 passing)
│ ├── test_advanced_algorithms.py <- Game-theory and DML invariant tests (8 passing)
│ ├── test_excel_and_new_algorithms.py <- Synthetic Control, Markowitz & Excel tests (3 passing)
│ ├── test_screenings_and_new_algorithms.py <- Conformal, SHAP, Cinelli-Hazlett, WPA & Knapsack tests (6 passing)
│ ├── test_mortgage_underwriting.py <- Automated mortgage underwriting engine tests (5 passing)
│ └── test_supply_chain_and_anomalies.py <- MEIO, Mahalanobis & Network Graph tests (8 passing)
├── verify_engines.py <- Standalone zero-dependency mathematical verification runner
├── run_pipeline.py <- Master execution orchestrator producing all deliverables
├── pytest.ini <- Pytest isolated configuration preventing external conftest loading
├── requirements.txt <- Python dependency specifications
└── README.md <- Executive documentation and architectural guide
Every module is governed by strict invariant unit tests:
# Run standalone zero-dependency verification (Takes 1 second)
python verify_engines.py
# Or run pytest
python -m pytest -v tests/test_cfar_and_experimentation.py-
TestCashFlowAtRiskSimulator: VaR 99 floor$\le$ VaR 95 floor$\le$ Mean OCF, CVaR 95 shortfall$\ge$ VaR 95, covenant breach probability bounded in$[0, 100]%$ , percentile monotonicity. -
TestBanditExperimentEngine: Conservation of arm pulls, Bayesian Thompson Sampling regret strictly lower than static 50/50 A/B split by$> 30%$ , convergence on dominant variant. -
TestMixedLogitCannibalizationEngine: Probability simplex conservation ($\sum P_i = 1.0$ ), strictly negative own-price elasticity, diversion ratio row conservation ($\sum \text{Diversion} = 100%$ ). -
TestConformalPrediction: Finite-sample distribution-free coverage bounds ($P \ge 1 - \alpha$ ), adaptive prediction set sizing, regression residual intervals. -
TestShapleyAttribution: Game-theoretic efficiency axiom ($f(x) = \phi_0 + \sum \phi_j$ ), relative importance simplex conservation ($\sum = 100%$ ), local decision attributions. -
TestCausalSensitivity: Cinelli & Hazlett partial$R^2$ non-negativity, Robustness Value ($RV$ ) calculation, omitted variable bias erosion monotonicity. -
TestMarkovWPAxROP: State transition matrix discretization, delivery-level Win Probability Added (WPA), Expected Runs Over Par (xROP), death-over clutch leverage index. -
TestKnapsackAuctionOptimizer: Mixed-integer purse budget ceiling enforcement, squad size lower/upper bounds, overseas cap constraint, surplus-per-crore ranking. -
TestMultiEchelonInventoryOptimization: Normal loss function monotonicity, service level safety stock monotonicity, EOQ working capital bounds, portfolio policy aggregation. -
TestMultivariateAnomalyDetection: Regularized Mahalanobis distance non-negativity, Chi-Square p-value bounds, margin leak classification summary. -
TestEnterpriseNetworkGraph: PageRank probability simplex conservation ($\sum r_i = 1.0$ ), degree centrality volume share, systemic fragility ranking. -
TestCausalElasticityDML: Neyman-orthogonal score consistency, negative causal elasticity, valid asymptotic standard error bounds. -
TestAdversarialGamePricing: Best-response profitability bounds, QRE probability simplex conservation, fixed-point convergence. -
TestOstromCommonsGovernance: Pool congestion monotonicity, Ostrom CAC dominance over unregulated commons defection spirals. -
TestSpectralAttribution: Perron-Frobenius leading eigenvector normalization, non-negative Laplacian Fiedler algebraic connectivity. -
TestSyntheticControlEngine: Donor weights non-negativity and convex combination ($\sum W = 1.0$ ), post-intervention causal lift detection. -
TestMarkowitzPortfolioOptimizer: Budget conservation, channel allocation cap bounds, positive Sharpe ratio, non-negative 95% VaR. -
TestUniversalExcelIngestor: Multi-format currency parsing, fuzzy synonym column mapping, automatic cohort derivation. -
TestStochasticFloatEngine: Exact 3-tier DuPont identity reconciliation, non-decreasing cumulative float yield. -
TestCohortRetentionInvariants: Period 0 retention normalization, Kaplan-Meier monotone survival, valid conditional hazard rates.
# 1. Clone repository
git clone https://github.com/AmSach/decision-analytics-engine.git
cd decision-analytics-engine
# 2. Run instant verification (All upgrade engines verified in 1s)
python verify_engines.py
# 3. Execute master pipeline (Generates all synthetic deliverables)
python run_pipeline.py
# 4. Execute live Global Superstore real-world benchmark
python examples/run_superstore_benchmark.py
# 5. Launch interactive 8-tab executive decision cockpit
streamlit run src/dashboard.pyMIT License. Developed for graduate business school decision modeling, enterprise strategic planning, and algorithmic data analytics.