Cursor vs Copilot Share: Bayesian Model, 12 Steps, 70 Min A new Python package built in 12 steps and about 70 minutes computes Bayesian posterior distributions for Cursor's and GitHub Copilot's developer-tool shares from four-cell survey counts, yielding credible intervals and the probability one tool leads the other. The approach targets a denominator mismatch: Stack Overflow's 2025 Developer Survey put Cursor at roughly 18% of respondents among development environments and AI-enabled editors, while 68% of respondents who use out-of-the-box AI assistants selected GitHub Copilot. The dataset is synthetic and seeded for reproducibility, and the write-up cautions that a public analysis placing Cursor at 17.9% of about 49,000 respondents is unconfirmed as an official Stack Overflow measure. Stack Overflow’s 2025 Developer Survey put Cursor at roughly 18% of respondents among development environments and AI-enabled editors, according to the company’s press release https://stackoverflow.co/company/press/archive/stack-overflow-2025-developer-survey/ . The survey’s AI section separately reports that 68% of respondents who use out-of-the-box AI assistants selected GitHub Copilot. Two numbers, two different denominators, and not one error bar in sight. Blog posts then line them up in a table and declare a winner. A short Python package fixes that. It takes a four-cell count table per survey respondents who use both tools, Cursor only, Copilot only, or neither and returns a full probability distribution for each tool’s share. From that distribution you can read credible intervals, the probability that one tool leads another, and a pooled estimate across several surveys. If you already ran the frequentist route in our margin of error walkthrough https://shattered.io/cursor-vs-copilot-margin-of-error-wilson-interval-12-steps-2026/ , this is the Bayesian counterpart, and it answers questions a Wilson interval cannot. The build takes 12 steps and about 70 minutes. The dataset is synthetic, generated from a seeded script, so every number in the output blocks below is reproducible on your machine. One public analysis reportedly puts Cursor at 17.9% of about 49,000 respondents. DiffVibe’s write-up https://diffvibe.com/articles/cursor-s-17-9-survey-share-separating-signal-from-noise cautions that the figure is not confirmed as an official Stack Overflow measure and may not share a denominator with Copilot’s number, which is exactly the trap the code below exposes. Treat it as a lead and not a fact. Don't miss new tech stories on Google Add Shattered once in the Google app and our stories show up in your news suggestions. Add now https://www.google.com/preferences/source?hl=en&q=https%3A%2F%2Fshattered.io%2F What You Need Before Step 1 The project runs on a laptop. No GPU, no cloud account, no API key. Everything below was run on Linux with the versions in this table, and nothing in the code depends on an operating system feature. | Requirement | Version tested | Purpose | |---|---|---| | Python | 3.12.3 | Language runtime | | NumPy | 2.5.5 | Random draws and array math | | SciPy | 1.18.1 | Beta posteriors, beta-binomial likelihood, optimizer | | pandas | 3.1.1 | CSV loading and report tables | | pytest | 9.2.0 | Regression tests for the statistics | | matplotlib | 3.11.2 | Optional, only for the plotting tip near the end | | Disk space | Under 300 MB | Virtual environment plus packages | | Time | About 70 minutes | Includes reading the output | You need basic Python functions, dataframes, a virtual environment and a rough memory of what a proportion is. You do not need a statistics degree. Each formula appears next to the code that implements it, in plain words. The input format matters more than the packages. The loader expects one row per survey with five integer columns: survey , n , both , cursor only , copilot only , and neither . The four cells must sum to n . If you hold respondent-level data, a single pandas groupby produces this table in two lines. If you only have published percentages, you cannot build the cells without guessing, and the pooling and overlap steps will not work. That limitation is real, and it is the main reason to hunt for the raw tables before you trust any share claim. A word on what the data represents. These surveys let respondents tick several tools at once, so Cursor’s share and Copilot’s share do not add up to 100%. Both can be high at once. Treat each share as the prevalence of use among the respondents who answered, never as a slice of one pie. Why a Survey Share Needs a Posterior, Not a Point A share is a proportion measured on a sample. If a group of developers answered and some of them ticked Cursor, the sample gives you one number. The population could plausibly sit anywhere in a range around it. Publishing that single number alone hides the range, and it hides it most when the sample is small or the claim is a close race. Three denominators float around in the public numbers, and mixing them is the most common error in this topic. | Denominator | Who is counted | What the share means | |---|---|---| | All respondents | Everyone who finished the survey | Use among developers overall | | AI-tool users | Only people who use some AI tool | Preference among adopters | | Users of one tool category | Only people who ticked an assistant or IDE | Share inside a narrow category | Stack Overflow’s own page reports that 84% of respondents use or plan to use AI tools, up from 76% the year before, and that 51% of professional developers use them daily. A Copilot figure measured among assistant users and a Cursor figure measured among all respondents cannot be compared, however clean the arithmetic looks. Our selection bias walkthrough https://shattered.io/cursor-vs-copilot-survey-selection-bias-tipping-point-12-steps-2026/ covers who answers these surveys in the first place. Assume you have already picked one denominator and want honest uncertainty around it. So why go Bayesian instead of stopping at a Wilson interval? Three reasons stand out. - Direct probability statements. A Bayesian posterior lets you compute the probability that Copilot’s share exceeds Cursor’s, or that Cursor’s true share is above 15%. A confidence interval cannot make those claims without contortions. - Pooling across surveys. When you have three or four surveys with different sample sizes, a hierarchical model borrows strength between them. Small surveys get pulled toward the group mean, and large surveys barely move. - Visible assumptions. Every prior is a line of code. You can swap it, rerun the report, and see whether your conclusion survives. For a proportion, the math is gentle. Start with a Beta a, b prior. Observe k successes in n trials. The posterior is Beta a + k, b + n – k . No sampling, no Markov chains, one line of SciPy. The overlap and pooling steps add a little more machinery, but nothing heavier than a Dirichlet draw and a one-dimensional optimizer. One caution before the build. A posterior quantifies sampling noise under your model. It does not repair a biased sample, a leading question, or a mismatch between 2025 fieldwork and the product people use today. Step 9 adds a dial for design effects, and the section on reading the output returns to the larger gap between a 2025 snapshot and November 2026. Steps 1 to 3: Project, Demo Data, and a Loader That Refuses Bad Counts Step 1: Create the project. Make a folder, a virtual environment, and install the packages. Pin versions in a requirements.txt so a rerun in six months gives the same numbers. mkdir share-bayes && cd share-bayes python3 -m venv .venv source .venv/bin/activate pip install numpy scipy pandas pytest matplotlib pip freeze | grep -iE "numpy|scipy|pandas|pytest|matplotlib" requirements.txt mkdir data Check that python --version prints 3.12 inside the activated shell, since that is the version the output blocks below were produced on. Step 2: Generate synthetic survey data. Real raw tables are hard to find, so the demo builds three fake surveys from a known truth. Cursor’s true share and Copilot’s true share are both set by hand, and the overlap between them runs above what independence would predict. Those values are inventions for testing, not claims about the world. The point is that you know the answer, so you can check whether the pipeline recovers it. """Write a synthetic three-survey dataset. All numbers are invented for the demo.""" import numpy as np import pandas as pd rng = np.random.default rng 2026 SURVEYS = { name: respondents who answered the AI-tool question "survey a": 1800, "survey b": 950, "survey c": 4200, } Invented "true" shares. Change them and the pipeline should recover them. TRUE CURSOR, TRUE COPILOT, OVERLAP LIFT = 0.19, 0.62, 1.15 SURVEY NOISE = 0.015 between-survey wobble, in probability points rows = for name, n in SURVEYS.items : pc = np.clip TRUE CURSOR + rng.normal 0, SURVEY NOISE , 0.01, 0.99 pg = np.clip TRUE COPILOT + rng.normal 0, SURVEY NOISE , 0.01, 0.99 both = min pc pg OVERLAP LIFT, pc, pg cells = np.array both, pc - both, pg - both, 1 - pc - pg + both both n, cur n, cop n, none n = rng.multinomial n, cells / cells.sum rows.append dict survey=name, n=n, both=both n, cursor only=cur n, copilot only=cop n, neither=none n pd.DataFrame rows .to csv "data/surveys.csv", index=False print pd.DataFrame rows .to string index=False Run it with python make demo.py . The seed is fixed, so you should see these exact counts. survey n both cursor only copilot only neither survey a 1800 240 88 862 610 survey b 950 144 40 451 315 survey c 4200 597 218 2081 1304 Notice that survey B is small and survey C is large. That spread is deliberate. It will show how pooling treats small and large samples differently. Step 3: Write a loader that refuses bad counts. Silent data errors wreck statistics faster than any modeling choice. The loader below checks for missing columns, negative counts, and rows where the four cells fail to add up to n . It also derives the two marginal counts, because a respondent who ticked both tools counts toward each tool. python from future import annotations import numpy as np import pandas as pd from scipy import optimize, stats CELLS = "both", "cursor only", "copilot only", "neither" PRIORS = {"uniform": 1.0, 1.0 , "jeffreys": 0.5, 0.5 , "weak": 2.0, 6.0 } def load surveys path: str - pd.DataFrame: df = pd.read csv path missing = {"survey", "n", CELLS} - set df.columns if missing: raise ValueError f"missing columns: {sorted missing }" if df CELLS < 0 .any .any : raise ValueError "negative cell count" bad = df df CELLS .sum axis=1 = df "n" if not bad.empty: raise ValueError f"cells do not sum to n for: {bad 'survey' .tolist }" df "cursor" = df "both" + df "cursor only" df "copilot" = df "both" + df "copilot only" return df The cell-sum check earns its keep. If you hand it a row where neither is off by one, it stops with ValueError: cells do not sum to n for: 'survey a' instead of producing a plausible but wrong interval. Fail loudly at the border, and the rest of the code can trust its inputs. A common slip here: respondents who skipped the question. Decide up front whether they belong in n . If they do, they land in neither , which deflates both shares. If they do not, drop them before you count. Write the rule in a comment next to the data export, because nobody remembers it three months later. Steps 4 and 5: The Beta-Binomial Posterior and Honest Intervals Step 4: Compute the posterior. For each tool in each survey, count the respondents who selected it k , count everyone who answered n , and apply the conjugate update. The function is three lines. It returns a frozen SciPy distribution, so you can ask it for a mean, a quantile, or a probability without writing more math. Step 5: Summarize with two kinds of interval. An equal-tail interval chops an equal slice of probability off each end. A highest-density interval HDI finds the narrowest range that holds 95% of the probability. For a share away from the extremes in a big sample the two are nearly identical. For a skewed posterior, such as 5 successes in 60 trials, the HDI is tighter and shifts toward the mode. The code reports both so you can see when the choice matters. python def beta posterior k: float, n: float, prior= 1.0, 1.0 : a, b = prior return stats.beta a + k, b + n - k def hdi dist, mass: float = 0.95 - tuple float, float : """Narrowest interval holding mass of a unimodal distribution.""" def width lo tail: float - float: return dist.ppf lo tail + mass - dist.ppf lo tail res = optimize.minimize scalar width, bounds= 0, 1 - mass , method="bounded" return float dist.ppf res.x , float dist.ppf res.x + mass def summarize dist, mass: float = 0.95 - dict: tail = 1 - mass / 2 h lo, h hi = hdi dist, mass return { "mean": float dist.mean , "eq lo": float dist.ppf tail , "eq hi": float dist.ppf 1 - tail , "hdi lo": h lo, "hdi hi": h hi, } The hdi helper minimizes the interval width over the position of the lower tail. SciPy’s bounded scalar minimizer handles that cleanly because the width function has a single valley for unimodal distributions. Beta posteriors with a, b above 1 fit that description. A Beta with both parameters below 1 is U-shaped and breaks the assumption, which matters if you ever use extreme priors. Now apply it to every survey. This loop lives in run report.py , which Step 12 shows in full. print "== 1. Per-survey posterior uniform prior ==" rows = for , r in df.iterrows : for tool in "cursor", "copilot" : s = sb.summarize sb.beta posterior r tool , r "n" , sb.PRIORS "uniform" rows.append {"survey": r "survey" , "tool": tool, "n": r "n" , s} per = pd.DataFrame rows print per.to string index=False Here is the output on the demo data. == 1. Per-survey posterior uniform prior == survey tool n mean eq lo eq hi hdi lo hdi hi survey a cursor 1800 0.183 0.165 0.201 0.165 0.200 survey a copilot 1800 0.612 0.589 0.634 0.590 0.635 survey b cursor 950 0.194 0.170 0.220 0.169 0.220 survey b copilot 950 0.626 0.595 0.657 0.595 0.657 survey c cursor 4200 0.194 0.182 0.206 0.182 0.206 survey c copilot 4200 0.638 0.623 0.652 0.623 0.652 Read the table the way a skeptic would. Survey C, the largest, pins Cursor inside a narrow band. Survey B, the smallest, spreads it over a visibly wider one. Both surveys agree on the center, and the width simply tracks sample size. A blog post that quotes survey B’s point estimate as if it were as firm as survey C’s overstates what a small sample can tell you. Copilot’s intervals follow the same logic, though they run wider in absolute terms because a share near 62% has more binomial variance than one near 19%. The variance of a proportion peaks at 50%, so mid-range shares always carry the fattest error bars. An aside on the numbers you will meet in the wild. When a post reports an interval around a Cursor or Copilot share https://shattered.io/cursor-vs-copilot-share-claim-linter-python-12-steps-2026/ , check that the sample size behind the interval matches the sample size behind the share. One secondary analysis reportedly pairs intervals computed on a much smaller sample with a Cursor figure drawn from roughly 49,000 respondents. Intervals from one sample cannot describe a point estimate from another. If the denominators disagree, the interval means nothing. Step 6: Test How Much the Prior Matters A prior encodes what you believed before the data arrived. The uniform prior, Beta 1, 1 , says every share from 0% to 100% is equally likely. The Jeffreys prior, Beta 0.5, 0.5 , leans slightly toward the extremes and has a good track record for proportions. The weak prior in the code, Beta 2, 6 , expects a share near 25% and carries the weight of eight imaginary respondents. With real survey sizes the prior is a rounding error. Even the smallest demo survey is large enough that three very different priors give the same answer to three decimals. print "\n== 2. Prior sensitivity on the smallest survey ==" small = df.sort values "n" .iloc 0 for name, prior in sb.PRIORS.items : s = sb.summarize sb.beta posterior small "cursor" , small "n" , prior print f"{name:9s} mean={s 'mean' :.4f} 95%= {s 'eq lo' :.4f}, {s 'eq hi' :.4f} " == 2. Prior sensitivity on the smallest survey == uniform mean=0.1943 95%= 0.1698, 0.2200 jeffreys mean=0.1940 95%= 0.1695, 0.2197 weak mean=0.1942 95%= 0.1697, 0.2198 The means and the interval edges barely differ. That is the reassuring case. You report the uniform result, note that Jeffreys agrees, and move on. The picture changes when the sample is tiny. Suppose a niche survey of 40 developers shows 8 using Cursor. Run the same three priors on those counts and you get this. uniform mean=0.2143 95%= 0.1056, 0.3487 jeffreys mean=0.2073 95%= 0.0994, 0.3422 weak mean=0.2083 95%= 0.1070, 0.3326 Now the lower bound moves by about 0.8 percentage points depending on the prior, and the upper bound by 1.6. Still not dramatic, but it is the kind of spread a reader deserves to see. Make a habit of running all three priors on every survey under about 200 respondents. If they disagree enough to flip a conclusion, the data cannot support the conclusion. Avoid one trap. Do not tune the prior until the interval looks the way you want. The set of priors belongs in the code before you see results, and the report should print all of them. A prior chosen after the fact is a thumb on the scale. Step 7: Model the Overlap With a Dirichlet Posterior Here is where the four-cell table pays off. A respondent can use both tools. Because the same people appear in both counts, Cursor’s share and Copilot’s share are correlated within a survey. Treating them as independent Beta distributions ignores that link and misstates the uncertainty in their difference. The fix is a Dirichlet posterior over the four cells jointly. With a flat prior of 1 on each cell, you draw cell probabilities from Dirichlet counts + 1 , add up the relevant cells to get each tool’s share, and subtract to get the gap. php def joint draws row: pd.Series, size: int, rng, alpha: float = 1.0 - pd.DataFrame: """Dirichlet posterior over the four overlap cells of one survey.""" counts = row CELLS .to numpy dtype=float p = rng.dirichlet counts + alpha, size=size out = pd.DataFrame p, columns=CELLS out "cursor" = out "both" + out "cursor only" out "copilot" = out "both" + out "copilot only" out "gap" = out "copilot" - out "cursor" return out Each draw is one plausible world consistent with the survey. Cursor’s share in that world is both + cursor only , Copilot’s is both + copilot only , and the gap is Copilot minus Cursor. Run 20,000 draws and read the percentiles. The loop in the report script does exactly that for every survey. print "\n== 3. Copilot minus Cursor gap, joint Dirichlet draws ==" for , r in df.iterrows : d = sb.joint draws r, 20000, rng lo, hi = np.percentile d "gap" , 2.5, 97.5 p = d "gap" 0 .mean print f"{r 'survey' }: gap mean={d 'gap' .mean :.3f} 95%= {lo:.3f}, {hi:.3f} P gap 0 ={p:.4f}" == 3. Copilot minus Cursor gap, joint Dirichlet draws == survey a: gap mean=0.429 95%= 0.402, 0.456 P gap 0 =1.0000 survey b: gap mean=0.431 95%= 0.394, 0.467 P gap 0 =1.0000 survey c: gap mean=0.443 95%= 0.425, 0.461 P gap 0 =1.0000 Every survey puts the gap near 43 to 44 percentage points, and the probability that Copilot leads is 1.0000 to four decimals in all three. That last number deserves suspicion, and a later pitfall explains why. With a gap this wide and samples this large, none of the 20,000 draws fell below zero, so the empirical probability rounds to one. The honest statement is that the leader is not in doubt under this model, not that the probability is literally 100%. Does the joint model matter, or is it extra work? With a bigger positive overlap or a closer race, the difference grows, and so does the risk of calling a tie when the data settle it, or the reverse. The overlap structure also lets you ask follow-up questions that independent models cannot. What share of Cursor users also use Copilot? That is both / cursor in each draw, with its own interval. The overlap and lift walkthrough https://shattered.io/cursor-vs-copilot-survey-overlap-jaccard-lift-12-steps-2026/ digs into that angle with Jaccard similarity, and the Dirichlet draws here feed straight into it. Step 8: Pool Surveys With Empirical Bayes Three surveys, three estimates. Which one do you quote? Quoting the biggest throws away information. Averaging all three equally lets the smallest survey count as much as the largest one. Partial pooling sits between those extremes. It assumes each survey’s true share is drawn from a common Beta a, b distribution, estimates a and b from the data, and shrinks each survey’s raw share toward the group mean by an amount that depends on its sample size. The standard trick is empirical Bayes. You maximize the beta-binomial marginal likelihood over a and b, then plug the fitted values in as the prior for each survey. SciPy ships the beta-binomial distribution, and optimize.minimize does the rest. The first attempt fails in an instructive way. Write the naive version, which optimizes a and b with no safeguards, and run it on the Cursor counts. k, n = df "cursor" .to numpy , df "n" .to numpy print sb.fit hyperprior k, n, kappa prior=None 45213732.74, 191583952.99 An alpha that runs off to an enormous value is not a finding. It means the fitted prior is a spike. Three surveys that happen to agree give the likelihood no evidence of between-survey spread, so the optimizer pushes the concentration a + b toward infinity, and every survey shrinks to exactly the same value. With three data points you cannot tell a world where surveys differ by a point from one where they never differ at all. The remedy is a weak penalty on the concentration. The final function parameterizes the prior by its mean and its concentration kappa = a + b, then adds a log-normal penalty on kappa centered at 400 with a log-scale spread of 1.5. That nudges the fit toward plausible spreads without overruling real data. With dozens of surveys the penalty vanishes. With three, it keeps the model sane. python def fit hyperprior k: np.ndarray, n: np.ndarray, kappa prior: tuple float, float | None = np.log 400.0 , 1.5 : """Empirical Bayes for Beta a, b with a lognormal penalty on a + b. Without the penalty, three surveys that happen to agree push a + b toward infinity and every survey shrinks to the same number. """ def nll theta : mu = 1 / 1 + np.exp -theta 0 kappa = np.exp theta 1 a, b = mu kappa, 1 - mu kappa out = -stats.betabinom.logpmf k, n, a, b .sum if kappa prior is not None: m0, s0 = kappa prior out += 0.5 theta 1 - m0 / s0 2 return out start = np.log k.sum / n.sum / 1 - k.sum / n.sum , np.log 100.0 res = optimize.minimize nll, start, method="Nelder-Mead", options={"xatol": 1e-6, "fatol": 1e-9, "maxiter": 4000} if not res.success: raise RuntimeError f"hyperprior fit failed: {res.message}" mu, kappa = 1 / 1 + np.exp -res.x 0 , np.exp res.x 1 return float mu kappa , float 1 - mu kappa def shrunken shares k: np.ndarray, n: np.ndarray, a: float, b: float - np.ndarray: return a + k / a + b + n Here is the pooled result on the demo surveys. print "\n== 4. Partial pooling across surveys ==" for tool in "cursor", "copilot" : k, n = df tool .to numpy , df "n" .to numpy a, b = sb.fit hyperprior k, n raw = k / n shr = sb.shrunken shares k, n, a, b hyper = a / a + b print f"{tool}: alpha={a:.1f} beta={b:.1f} pooled mean={hyper:.3f}" for name, rv, sv in zip df "survey" , raw, shr : print f" {name}: raw={rv:.4f} shrunk={sv:.4f}" new = rng.beta a, b, size=20000 print f" new-survey 95% range: {np.percentile new,2.5 :.3f}, {np.percentile new,97.5 :.3f} " report "surveys" tool = {"alpha": a, "beta": b, "pooled mean": hyper} == 4. Partial pooling across surveys == cursor: alpha=325.6 beta=1385.7 pooled mean=0.190 survey a: raw=0.1822 shrunk=0.1861 survey b: raw=0.1937 shrunk=0.1915 survey c: raw=0.1940 shrunk=0.1930 new-survey 95% range: 0.172, 0.209 copilot: alpha=787.3 beta=469.4 pooled mean=0.626 survey a: raw=0.6122 shrunk=0.6181 survey b: raw=0.6263 shrunk=0.6264 survey c: raw=0.6376 shrunk=0.6351 new-survey 95% range: 0.600, 0.654 Partial pooling moves small surveys more than large ones. A smaller survey’s raw share is nudged toward the pooled mean, while a larger survey with many respondents barely moves. That asymmetry is the whole point of partial pooling. The last line of each block matters most for planning. The new-survey range for Cursor describes where the next survey’s true share might land, given how much the existing ones disagreed. It is wider than any single survey’s credible interval because it adds between-survey variation on top of sampling noise. When someone asks what Cursor’s share will look like in the next study, quote that range, not a single-survey interval. Treat the fitted a and b with care. Their ratio gives the pooled mean, and their sum measures how tightly surveys cluster. A very large kappa for Cursor means surveys cluster tightly, and the penalty keeps that estimate from running away. Report the sum as an approximate, not a measurement, whenever you have fewer than ten surveys. Steps 9 and 10: Stress Test With Design Effects, Then Check Coverage Step 9: Add a design-effect dial. Online developer surveys are not simple random samples. Respondents self-select, weights get applied, and clusters form around communities. Survey statisticians summarize the damage with a design effect, deff, where 1.0 means simple random sampling and 2.0 means the sample is worth half as many respondents. The cheap approach divides both the success count and the sample size by deff before applying the posterior. php def deflate k: float, n: float, deff: float - tuple float, float : """Shrink counts by a design effect so the posterior widens honestly.""" if deff < 1: raise ValueError "design effect must be = 1" return k / deff, n / deff Run survey C’s Cursor counts through four design effects and watch the interval widen. print "\n== 5. Design-effect stress test survey c Cursor ==" r = df df "survey" == "survey c" .iloc 0 for deff in 1.0, 1.5, 2.0, 3.0 : k, n = sb.deflate r "cursor" , r "n" , deff s = sb.summarize sb.beta posterior k, n print f"deff={deff:.1f} n eff={n:7.1f} 95% width={s 'eq hi' -s 'eq lo' :.4f}" == 5. Design-effect stress test survey c Cursor == deff=1.0 n eff= 4200.0 95% width=0.0239 deff=1.5 n eff= 2800.0 95% width=0.0293 deff=2.0 n eff= 2100.0 95% width=0.0338 deff=3.0 n eff= 1400.0 95% width=0.0414 A design effect of 2.0 halves the effective sample size and stretches the interval by the square root of 2. A larger deff widens it further. If your source reports a weighting efficiency or an effective sample size, you can turn it straight into a deff by dividing n by the effective n. Our raking and reweighting tutorial https://shattered.io/cursor-vs-copilot-survey-raking-reweight-python-12-steps-2026/ shows how to get that number from real weights. Be honest about what this dial does and does not do. It widens the interval to reflect lost information. It does not shift the center to correct for bias. A sample that over-represents Cursor users stays over-represented at any deff. Step 10: Check coverage by simulation. A 95% credible interval should capture the true share about 95% of the time if the model is calibrated. You can test that. Pick a true share, simulate thousands of surveys of a given size, build the interval for each, and count how often it contains the truth. python def coverage true p: float, n: int, prior, reps: int, rng, mass: float = 0.95 - float: k = rng.binomial n, true p, size=reps a, b = prior tail = 1 - mass / 2 lo = stats.beta.ppf tail, a + k, b + n - k hi = stats.beta.ppf 1 - tail, a + k, b + n - k return float np.mean lo <= true p & true p <= hi print "\n== 6. Coverage check, 2,000 simulated surveys ==" for n in 200, 1000 : for name in "uniform", "jeffreys" : c = sb.coverage 0.19, n, sb.PRIORS name , 2000, rng print f"n={n:5d} prior={name:9s} coverage={c:.3f}" == 6. Coverage check, 2,000 simulated surveys == n= 200 prior=uniform coverage=0.938 n= 200 prior=jeffreys coverage=0.950 n= 1000 prior=uniform coverage=0.953 n= 1000 prior=jeffreys coverage=0.956 Coverage near nominal confirms the arithmetic. It says nothing about whether the model matches reality, because the simulation draws from the same binomial the model assumes. A coverage estimate from a modest number of replications carries its own simulation noise, so rerun with more replications before reading a small gap below 95% as a problem. Steps 11 and 12: Lock It In With Tests and Run the Report Step 11: Write regression tests. Statistical code rots silently. A refactor that swaps a quantile for a mean passes every glance test and ruins the report. Six small tests pin the behavior that matters: the loader rejects inconsistent rows, the posterior mean matches the closed-form formula, a design effect below 1 raises an error, the HDI is never wider than the equal-tail interval, the hyperprior stays finite when surveys agree, and simulated coverage stays near 95%. python import numpy as np import pandas as pd import pytest import sharebayes as sb def test loader rejects cells that do not sum tmp path : p = tmp path / "bad.csv" pd.DataFrame dict survey="x", n=100, both=10, cursor only=5, copilot only=40, neither=40 .to csv p, index=False with pytest.raises ValueError, match="do not sum" : sb.load surveys p def test posterior mean matches conjugate formula : d = sb.beta posterior 30, 100, 1, 1 assert d.mean == pytest.approx 31 / 102 def test design effect below one is rejected : with pytest.raises ValueError : sb.deflate 10, 100, 0.8 def test hdi is narrower or equal to equal tail : s = sb.summarize sb.beta posterior 5, 60 assert s "hdi hi" - s "hdi lo" <= s "eq hi" - s "eq lo" + 1e-9 def test hyperprior stays finite when surveys agree : k, n = np.array 190, 380, 760 , np.array 1000, 2000, 4000 a, b = sb.fit hyperprior k, n assert a + b < 1e5 def test coverage is near nominal : rng = np.random.default rng 1 c = sb.coverage 0.19, 1000, sb.PRIORS "jeffreys" , 2000, rng assert 0.93 < c < 0.97 The hyperprior test deserves attention. It feeds three surveys with identical shares and checks that the penalized fit does not explode. If someone removes the penalty in a future cleanup, that test fails on the spot. Run the suite from the project folder. pytest -q ...... 100% 6 passed in 1.20s Step 12: Run the full report. The report script ties every step together. It loads the CSV, prints each section, and writes a small report.json holding the fitted hyperpriors so downstream tools can read them. The seed is fixed at 7, so repeated runs print identical numbers. python import json import sys import numpy as np import pandas as pd import sharebayes as sb SEED = 7 rng = np.random.default rng SEED df = sb.load surveys sys.argv 1 if len sys.argv 1 else "data/surveys.csv" pd.options.display.float format = "{:.3f}".format report = {"seed": SEED, "surveys": {}} print "== 1. Per-survey posterior uniform prior ==" rows = for , r in df.iterrows : for tool in "cursor", "copilot" : s = sb.summarize sb.beta posterior r tool , r "n" , sb.PRIORS "uniform" rows.append {"survey": r "survey" , "tool": tool, "n": r "n" , s} per = pd.DataFrame rows print per.to string index=False print "\n== 2. Prior sensitivity on the smallest survey ==" small = df.sort values "n" .iloc 0 for name, prior in sb.PRIORS.items : s = sb.summarize sb.beta posterior small "cursor" , small "n" , prior print f"{name:9s} mean={s 'mean' :.4f} 95%= {s 'eq lo' :.4f}, {s 'eq hi' :.4f} " print "\n== 3. Copilot minus Cursor gap, joint Dirichlet draws ==" for , r in df.iterrows : d = sb.joint draws r, 20000, rng lo, hi = np.percentile d "gap" , 2.5, 97.5 p = d "gap" 0 .mean print f"{r 'survey' }: gap mean={d 'gap' .mean :.3f} 95%= {lo:.3f}, {hi:.3f} P gap 0 ={p:.4f}" print "\n== 4. Partial pooling across surveys ==" for tool in "cursor", "copilot" : k, n = df tool .to numpy , df "n" .to numpy a, b = sb.fit hyperprior k, n raw = k / n shr = sb.shrunken shares k, n, a, b hyper = a / a + b print f"{tool}: alpha={a:.1f} beta={b:.1f} pooled mean={hyper:.3f}" for name, rv, sv in zip df "survey" , raw, shr : print f" {name}: raw={rv:.4f} shrunk={sv:.4f}" new = rng.beta a, b, size=20000 print f" new-survey 95% range: {np.percentile new,2.5 :.3f}, {np.percentile new,97.5 :.3f} " report "surveys" tool = {"alpha": a, "beta": b, "pooled mean": hyper} print "\n== 5. Design-effect stress test survey c Cursor ==" r = df df "survey" == "survey c" .iloc 0 for deff in 1.0, 1.5, 2.0, 3.0 : k, n = sb.deflate r "cursor" , r "n" , deff s = sb.summarize sb.beta posterior k, n print f"deff={deff:.1f} n eff={n:7.1f} 95% width={s 'eq hi' -s 'eq lo' :.4f}" print "\n== 6. Coverage check, 2,000 simulated surveys ==" for n in 200, 1000 : for name in "uniform", "jeffreys" : c = sb.coverage 0.19, n, sb.PRIORS name , 2000, rng print f"n={n:5d} prior={name:9s} coverage={c:.3f}" with open "report.json", "w" as fh: json.dump report, fh, indent=2 print "\nwrote report.json" Run it with python run report.py . If you pass a different CSV path as the first argument, the script analyzes that file instead, which makes it easy to point at your own survey tables. The output is the six blocks you have already seen, and the last line confirms report.json was written. Save the printed text next to the JSON so a reviewer can trace each figure in your write-up to a specific run. Reading the Output Without Overclaiming The report gives you tight intervals on the demo data. Real data will not always cooperate, and even clean intervals answer a narrow question. They describe how far the sample’s share could sit from the share of the population that the sample represents. They say nothing about whether the sample represents the population you care about. Three gaps sit between a 2025 survey share and a statement about today. First, the fieldwork date. Stack Overflow’s survey describes 2025, and this is November 2026. Its own headline numbers show how fast the ground moves: 84% of respondents used or planned to use AI tools in 2025, up from 76% a year earlier, and 66% of developers named AI solutions that are almost right as their top frustration. A product-level share from that window describes the tools as they stood then. Second, the product definition. Copilot in November 2026 is a different object from Copilot in the 2025 survey window. GitHub announced that all Copilot plans would move to usage-based billing on June 1, 2026, and kept the base prices in place. On November 17, 2026, GitHub made OpenAI’s GPT-6.2 Astra and GPT-6.2 Sol generally available in Copilot and shipped Microsoft’s MAI Code 2 and MAI Code 2 Flash the same day. GitHub keeps a supported models page https://docs.github.com/en/enterprise-cloud@latest/copilot/reference/ai-models/supported-models?ref=blog.brianrandell.com that changes often, so a survey respondent who ticked Copilot in 2025 used a different model lineup than one who ticks it today. Cursor changed too. Its documentation reportedly now lists Free, Plus, Premium, Super, and Ultra individual tiers next to Teams and Enterprise, and it labels the older request-based pricing as legacy. That plan structure comes from a single secondary report, so confirm it on Cursor’s pricing page before you cite it. | Copilot plan | Listed price | Billing unit | |---|---|---| | Pro | $10 per month | Individual | | Pro+ | $39 per month | Individual | | Max | $100 per month | Individual | | Business | $19 per month | Per user | | Enterprise | $39 per month | Per user | Third, the question wording. A survey that asked which AI tools you used in the past year captures trial and habit alike. It does not separate a developer who opened Cursor once from one who lives in it eight hours a day. Our market share audit https://shattered.io/cursor-vs-github-copilot-market-share-audit-12-steps-2026/ walks through checking each of those wording details against a published claim. So how should you phrase a result? Something like this: In a synthetic survey of N respondents, the posterior mean for Cursor was p with a 95% credible interval from lo to hi under a uniform prior, and the result held under Jeffreys and weak priors. Name the denominator, the fieldwork period, the prior, and the design effect you assumed. If you cannot fill in all four, you are reporting a number, not a finding. Pricing and model lists belong in a separate analysis. If your real question is what a team should pay, the seat audit https://shattered.io/cursor-vs-copilot-seat-audit-cost-per-active-developer-12-steps/ turns adoption into cost per active developer, and the side-by-side model comparison https://shattered.io/github-copilot-vs-cursor-4-models-8-days-2026/ covers what each tool offers right now. Common Pitfalls Most failures in this kind of analysis are not coding bugs. They are quiet choices that make a number look more certain than it is. These are the nine worth checking before you publish. Denominator mistakes Comparing shares from different bases. An 18% figure drawn from all respondents and a 68% figure among users of out-of-the-box assistants cannot sit in the same bar chart. Write the base into every label. Reading multi-select shares as a pie. Shares from a multi-select question do not sum to 100%, and the remainder is not a share of some other tool. Respondents who tick both tools count toward each share. Mixing an interval from one sample with a point from another. The check is one line: does n in the interval match n in the share? If not, discard the interval. Modeling mistakes Trusting a probability of exactly 1.0000. With a gap this wide, a finite number of draws will not produce a single reversal, so the printed probability is a floor set by the draw count and not a law of nature. Report it as very close to certain or skip it. Letting the pooling model collapse. Three agreeing surveys produced a concentration of tens of millions in Step 8. The fix is the penalty on kappa, and the test that guards it. Feeding deflated counts to the pooling fit. After deflate , counts are fractions such as 543.33. The beta-binomial likelihood only accepts integers and returns negative infinity for fractions. Apply the design effect when you summarize one survey, and keep raw integers for the hyperprior. Reporting mistakes Printing too many digits. A posterior mean of 0.19433 implies a precision the data lacks. Round shares to the nearest tenth of a point and intervals to the nearest tenth as well. Calling a 2025 share current. The survey is a dated snapshot. Label it with its year, and say plainly that plans and models have changed since. Hiding the prior. If the reader cannot see which prior you used, they cannot judge it. Print it beside the interval, every time. Troubleshooting Ten problems come up repeatedly when people run this project on their own data. - ModuleNotFoundError: No module named 'pandas' . The virtual environment is not active. Run source .venv/bin/activate and confirm that which python points inside the project folder. - FileNotFoundError: data/surveys.csv . The script reads a relative path. Run it from the project root, or pass an absolute path as the first argument to run report.py . - ValueError: cells do not sum to n on a table that looks right. Check the dtypes. A column with thousands separators, such as "1,000" , loads as text, and the sum comparison fails. Strip the commas before saving the CSV. - ValueError: missing columns . The header names must match exactly: survey , n , both , cursor only , copilot only , neither . A trailing space in a header is enough to break it. - RuntimeError: hyperprior fit failed . The optimizer ran out of iterations. Raise maxiter in fit hyperprior , and check that no survey has zero respondents. - Pooled alpha and beta in the millions. Someone passed kappa prior=None , or removed the penalty. Restore the default and rerun the hyperprior test. - Pooled result looks oddly confident with one survey. One survey carries no information about between-survey spread, so the fit returns that survey’s own share with a concentration set by the penalty alone. Pool only when you have at least three surveys, and treat three as the minimum. - Numbers change between runs. The script uses one shared random generator, so adding or reordering a section shifts every draw after it. Seed a separate generator per section if you need stable output while you edit. - P gap 0 =1.0000 everywhere. That is the expected output for a wide gap. Raise the draw count to confirm it stays at 1, then report it as above 99.99%. - Coverage test flaky or failing. The test fixes a random seed and a set number of replications, and checks that coverage lands inside a tolerance band. Advanced Tips Once the basic pipeline works, five extensions pay off most. Add a region of practical equivalence. Decide in advance that a gap under two percentage points counts as a tie. Then report the share of posterior draws inside that region. It answers the question stakeholders ask when a race is close. Pool across segments, not just surveys. Break each survey into roles or regions and fit the same empirical Bayes model across segments. Small segments, such as 40 respondents in one country, get pulled toward the group mean instead of swinging wildly. Keep the cell counts per segment above a floor, or the penalty will do all the work. Take weights seriously. If the raw survey ships with weights, compute an effective sample size and divide n by it to get your design effect. The pandas survey-data walkthrough https://shattered.io/cursor-vs-copilot-stack-overflow-survey-pandas-12-steps-2026/ shows how to load such files, and the reweighting tutorial earlier shows how to rake them. Plot the posteriors. A picture of overlapping densities communicates uncertainty faster than a table. This 15-line script draws all six posteriors on one axis and saves a PNG. python import matplotlib matplotlib.use "Agg" import matplotlib.pyplot as plt import numpy as np import sharebayes as sb df = sb.load surveys "data/surveys.csv" x = np.linspace 0.1, 0.75, 600 fig, ax = plt.subplots figsize= 8, 4 for , r in df.iterrows : for tool, style in "cursor", "-" , "copilot", "--" : d = sb.beta posterior r tool , r "n" ax.plot x, d.pdf x , style, label=f"{r 'survey' } {tool}" ax.set xlabel "share of respondents" ax.set ylabel "posterior density" ax.legend fontsize=7 fig.savefig "posteriors.png", dpi=150, bbox inches="tight" Move to a probabilistic programming library when you need covariates. PyMC or Stan lets you model share as a function of company size, experience, or region with proper hierarchical priors. The conjugate shortcuts here stop working once you add predictors, but the habits transfer: name the prior, check coverage, report the denominator. One more tip: version the data, not just the code. Commit the CSV, the seed, and the printed report together, so a reader can rebuild any figure in your write-up. The Complete Project at a Glance The finished folder holds seven files and one virtual environment. Everything lives at the top level, so imports stay trivial. share-bayes/ data/surveys.csv four-cell counts per survey make demo.py synthetic data generator, seed 2026 sharebayes.py loader, posteriors, Dirichlet, pooling, coverage run report.py six-section report, writes report.json test sharebayes.py six regression tests plot posteriors.py optional PNG of all posteriors requirements.txt pinned versions from Step 1 | File | Main functions | Step | |---|---|---| | make demo.py | Seeded multinomial generator | 2 | | sharebayes.py | load surveys , beta posterior , hdi , summarize | 3 to 5 | | sharebayes.py | joint draws | 7 | | sharebayes.py | fit hyperprior , shrunken shares | 8 | | sharebayes.py | deflate , coverage | 9 and 10 | | test sharebayes.py | Six pytest cases | 11 | | run report.py | Report and report.json | 12 | From a clean machine, five lines reproduce every block of output above. python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt python make demo.py pytest -q python run report.py To use real data, replace data/surveys.csv with your own four-cell table, rerun the tests, and rerun the report. For more on editors and assistants, the Coding and Dev Tools hub https://shattered.io/category/software/ collects every comparison and build guide in this cluster. FAQ Is a Bayesian credible interval different from a confidence interval? Yes, in meaning. A 95% credible interval says that, given your model and prior, the true share lies in the range with 95% probability. A 95% confidence interval describes how often the procedure captures the truth across repeated samples. With large samples and flat priors the numbers nearly match, as the coverage check in Step 10 shows. Why use a four-cell table instead of two shares? Because the same respondent can appear in both counts. The four cells keep that overlap, so the gap between Copilot and Cursor gets the right uncertainty. Two separate shares would treat the tools as independent samples. How many surveys do I need before partial pooling helps? Three is the working minimum, and the penalty on kappa keeps the fit stable at that size. With five to ten surveys the data start to speak for themselves. With one survey, pooling does nothing useful. Does a narrow interval mean the share is accurate? No. A narrow interval means the sampling noise is small. A biased sample can sit narrowly around the wrong number. Selection bias and question wording need their own checks. Which prior should I report? Report the uniform prior as the main result and show Jeffreys and a weak prior beside it. If all three agree, say so in one sentence. If they diverge, say the data cannot settle the question. Can I use this with Stack Overflow’s real survey data? Yes, if you can build the four-cell table from respondent-level records. The public results page shows percentages, and that is not enough. Check whether the survey’s data download includes the AI tool questions, and confirm which respondents saw each one, since that sets your denominator. Why is the demo data synthetic? Because published percentages cannot produce the overlap cells, and invented counts with a known truth let you test whether the code recovers the answer. The adoption shares in the demo are inventions for testing and make no claim about real adoption.