dm_poibin: Create a data model based on a Poisson-binomial mixture

Description Usage Arguments Value Examples

View source: R/datamodel-constructors.R

Description

Create a data model where the distribution of the reported value is a Poisson-binomial mixture. If Y ~ binom(n, p) and Z ~ pois(n(1-p)) then X = Y + Z is a Poisson-binomial mixture.

Usage

1
dm_poibin(data, prob, nm_series, nm_data = NULL)

Arguments

data

A data frame, described in data-arg.

prob

A number between 0 and 1.

nm_series

The name of the demographic series that data describes.

nm_data

The name of the dataset. If no value supplied, then nm_data is assumed to equal the name of the object supplied as the data argument.

Value

An object of class "dm_poibin".

Examples

1
2
3
4
5
reg_immig <- account::gl_reg_immig
reg_immig_dm <- dm_poibin(data = reg_immig,
                          prob = 0.95,
                          nm_series = "immigration")
reg_immig_dm

ONSdigital/Bayesian-demographic-accounts documentation built on Jan. 10, 2022, 12:34 a.m.