{
  "name": "Poisson-gamma parameter cross-walk with worked-example values",
  "description": "Compares how the Poisson-gamma model is written as a Gamma(a, b) rate prior and update versus the R dnbinom size/prob form, with the values from a worked example (prior Gamma(3, 5), one city of exposure 2 with 3 events). Compiled from the R NegBinomial manual, Akande STA 360/602L conjugacy notes and Lancaster MATH331 conjugate table, with values computed from their formulas.",
  "page": "https://casrai.org/guides/poisson-gamma-distribution",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-15T07:03:23Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Quantity",
      "unit": "",
      "description": ""
    },
    {
      "name": "Gamma-Poisson form",
      "unit": "",
      "description": ""
    },
    {
      "name": "R dnbinom form",
      "unit": "",
      "description": ""
    },
    {
      "name": "Worked-example value",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Quantity": "Prior on the rate",
      "Gamma-Poisson form": "theta ~ Gamma(a, b), mean a/b, variance a/b^2",
      "R dnbinom form": "not applicable",
      "Worked-example value": "Gamma(3, 5): mean 0.6, variance 0.12"
    },
    {
      "Quantity": "Prior marginal count (exposure 1)",
      "Gamma-Poisson form": "Negative binomial, size a, prob b/(b+1)",
      "R dnbinom form": "dnbinom(y, size = a, prob = b/(b+1)) or size = a, mu = a/b",
      "Worked-example value": "size 3, prob 5/6: mean 0.6, variance 0.72"
    },
    {
      "Quantity": "Posterior after y events over exposure x",
      "Gamma-Poisson form": "Gamma(a + y, b + x)",
      "R dnbinom form": "not applicable",
      "Worked-example value": "Gamma(6, 7): mean 0.857, variance 0.122"
    },
    {
      "Quantity": "Posterior predictive count (exposure 1)",
      "Gamma-Poisson form": "Negative binomial, size a_n, prob b_n/(b_n+1)",
      "R dnbinom form": "dnbinom(y, size = a_n, prob = b_n/(b_n+1))",
      "Worked-example value": "size 6, prob 7/8: mean 0.857, variance 0.980"
    },
    {
      "Quantity": "Variance relation",
      "Gamma-Poisson form": "Var(y) = a_n(b_n+1)/b_n^2, exceeds the mean",
      "R dnbinom form": "mu + mu^2/size",
      "Worked-example value": "0.980 versus mean 0.857"
    }
  ],
  "sources": [
    {
      "title": "R documentation: NegBinomial",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/stats/html/NegBinomial.html",
      "accessed": "2026-11-15"
    },
    {
      "title": "Akande, STA 360/602L: deriving conjugacy",
      "url": "https://sta-360-602l-su21.github.io/Course-Website/slides/2-8-derive-conjugacy.html",
      "accessed": "2026-11-15"
    },
    {
      "title": "Lancaster MATH331 Chapter 2 conjugate priors",
      "url": "https://www.lancaster.ac.uk/~prendivs/accessible/math331/lectures.tex/Ch2.S2.html",
      "accessed": "2026-11-15"
    }
  ]
}