Learn R Programming

DGA

Performs capture-recapture estimation by averaging over decomposable graphical models. This implements the approach introduced in Madigan and York (1997).

Installation

Stable CRAN release:

install.packages("dga")

Example usage

Five lists example from Madigan and York (1997):

library(dga)

# Number of lists and prior hyperparameter
p <- 5
data(graphs5) # Decomposable graphical models on 5 lists.
delta <- 0.5
Nmissing <- 1:300 # Reasonable range for the number of unobserved individuals.

# Counts corresponding to list inclusion patterns.
Y <- c(0,27,37,19,4,4,1,1,97,22,37,25,2,1,3,5,83,36,34,18,3,5,0,2,30,5,23,8,0,3,0,2)
Y <- array(Y, dim=c(2,2,2,2,2))
N <- sum(Y) + Nmissing

# Model-wise posterior probaiblities on the total population size.
# weights[i,j] is the posterior probability for j missing individuals under model graphs5[[j]].
weights <- bma.cr(Y,  Nmissing, delta, graphs5)

# Plot of the posterior distribution.
plotPosteriorN(weights, N)

References

  • David Madigan and Jeremy C. York. "Bayesian methods for estimation of the size of a closed population." Biometrika. Vol. 84, No. 1 (Mar., 1997), pp. 19-31.
  • Mauricio Sadinle (2018) Bayesian propagation of record linkage uncertainty into population size estimation of human rights violations. Annals of Applied Statistics Vol. 12 No. 2 pp. 1013-1038

Written by James Johndrow, Kristian Lum, and Patrick Ball.

copyright (c) 2015 Human Rights Data Analysis Group (HRDAG) https://hrdag.org

Copy Link

Version

Install

install.packages('dga')

Monthly Downloads

229

Version

2.0.1

License

GPL (>= 2)

Maintainer

Olivier Binette

Last Published

May 10th, 2021

Functions in dga (2.0.1)

cfunction

A Helper Function for make.strata
circle

A Helper Function Used in venn3
ellipse.ind

A Helper Function Used by Venn4
circle.ind

A Helper Function for venn3
check.strata

Checks Each Stratum for Suitability for Capture-Recapture
bma.cr

Bayesiam Model Averaging for Capture-Recapture
MakeCompMatrix

Component-wise Matrix of Log Marginal Likelihoods
sfunction

A Helper Function for make.strata.
ellipse

A Helper Function Used by Venn4 to Define the Perimeter of an Ellipse
venn4

Four List Venn Diagram
dga-package

Capture-Recapture Estimation using Bayesian Model Averaging
CompLogML

Computes Marginal Likelihoods for Each Clique and Value of Nmissing
make.strata

Transforms Records to List Intersection Counts by Stratum
graphs4

All Decomposable Graphical Models on Four Lists
graphs3

All Decomposable Graphical Models on Three Lists
venn3

Three List Venn Diagram
plotPosteriorN

Plots Posterior Distribution of Nmissing
integer.base.b

Base Converter
graphs5

All Decomposable Graphical Models on Five Lists
remove.close

A Helper Function to Tell Which Points Are Near the Boundary of a Circle
remove.close.ellipse

A Helper Function to Tell Which Points are Near the Boundary of the Ellipse