Learn R Programming

dupiR: an R package for Bayesian inference using discrete uniform priors

This R package implements a Bayesian approach to infer population sizes from count data. The package takes a set of sample counts obtained by sampling fractions of a finite volume containing an homogeneously dispersed population of identical objects and returns the posterior probability distribution of the population size. The algorithm makes use of a binomial likelihood and non-conjugate, discrete uniform priors. dupiR can be applied to both sampling with or without replacement.

Further details on the statistical framework can be found in:

  • Comoglio F, Fracchia L, Rinaldi M (2013) Bayesian Inference from Count Data Using Discrete Uniform Priors. PLoS ONE 8(10): e74388

Please cite this article if you are using dupiR for your research.

Installation

You can install the latest package release from CRAN:

install.packages("dupiR")

or the development version from GitHub:

# install.packages("devtools")
devtools::install_github("FedericoComoglio/dupiR")

Copy Link

Version

Install

install.packages('dupiR')

Monthly Downloads

149

Version

1.2.1

License

GPL-2

Maintainer

Federico Comoglio

Last Published

March 21st, 2024

Functions in dupiR (1.2.1)

compute_ecdf

Compute ECDF (empirical cumulative distribution function)
get_posterior_param

Compute posterior probability distribution parameters (e.g. credible intervals) for an object of class Counts
show,Counts-method

Print method for Counts class
plot_posterior

Plot posterior probability distribution and display posterior parameters for an object of class Counts
plot,Counts-method

Plot method for Counts class
dupiR-package

Bayesian inference from count data using discrete uniform priors
initialize,Counts-method

Initialize Counts class
new_counts

Constructor for Counts class
set_fractions<-

Set fractions slot for an object of class Counts
set_counts<-

Set counts slot for an object of class Counts
summary,Counts-method

Summary method for Counts class
compute_term

Compute single term (function F, Comoglio et al.)
compute_sum

Compute sum of terms (function F, Comoglio et al.)
gamma_poisson_clough

Compute posterior probability using a Gamma-Poisson model (Clough et al.)
compute_posterior_with_replacement

Compute posterior probability with replacement
compute_posterior

Compute the posterior probability distribution of the population size for an object of class Counts
compute_normalization_constant

Compute normalization constant
get_counts

Get counts slot for an object of class Counts
get_fractions

Get fractions slot for an object of class Counts
Counts-class

An S4 class to store measurements (count data, sampling fractions), prior support and posterior parameters