Proof of Concept / Bayesian Inference
Dirichlet-Multinomial Posterior Updating for 2L mCRC
A Bayesian forecasting engine that updates market share estimates in real time as prescribing data accumulates. Starting from analyst consensus priors encoded as Dirichlet distributions, the model performs conjugate posterior updating with each month of observed data — producing calibrated uncertainty intervals from Day 1 and progressively sharper forecasts as evidence grows. Built entirely in-browser with no backend dependencies.
Disclaimer: This is a proof-of-concept demonstration using synthetic prescribing data and simulated market dynamics. All market share figures, brand names, and competitive scenarios are illustrative. "Lumivara" is a fictional product. This tool does NOT represent actual commercial data, forecasts, or strategies of any pharmaceutical company. Not intended for investment or commercial decisions.
Running Bayesian market share analysis...
The Dirichlet distribution is the conjugate prior for the Multinomial likelihood. Each month's prescribing counts update the posterior via simple addition: alpha' = alpha + n. This closed-form update eliminates MCMC overhead while providing exact posterior inference over market share proportions.
Each brand's marginal posterior is Beta(alpha_i, alpha_0 - alpha_i). Log-space computation via Lanczos approximation ensures numerical stability for large alpha values that emerge after months of data accumulation. 200-point density curves enable smooth visualization.
KL divergence between consecutive posteriors quantifies 'surprise' — months where observed prescribing data significantly shifted beliefs. Computed using the digamma function with asymptotic series expansion (psi(x) ~ ln(x) - 1/2x - 1/12x^2) and recursion for small arguments.