Counts-class: Class "Counts" - a container for measurements and dupiR...

Description Objects from the Class Slots Author(s) References See Also Examples

Description

Definition of an object of this class requires a set of measurements, i.e. a collection of counts and sampling fractions. Inference of the posterior distribution by dupiR (computePosterior) and subsequent call to getPosteriorParam will fill all additional slots.

Objects from the Class

Objects should be created with calls to newCounts.

Slots

counts:

Object of class "integer". An integer vector of positive numbers (counts). Mandatory for object initialization.

fractions:

Object of class "numeric". A numeric vector of the corresponding sampling fractions (real numbers in (0,1]). Mandatory for object initialization.

n1:

Object of class "numeric". Left endpoint of the prior support interval. If not provided and total counts are not zero, computed using the maximum likelihood estimate (mle) of the population size as 0.5 * mle.

n2:

Object of class "numeric". Right endpoint of the prior support interval. If not provided and total counts are not zero, computed using the maximum likelihood estimate (mle) of the population size as 2 * mle.

X:

Object of class "numeric". The product of (1 - fractions).

mle:

Object of class "numeric". The maximum likelihood estimate of the population size, computed as K/R, where K is the total counts and R is the total sampling fraction.

nconst:

Object of class "numeric". The normalization constant (see Corollary 1 in the reference for details).

posterior:

Object of class "ANY". A vector of posterior probabities over the prior support. It containes either the PMF or a logical value used to obtain posterior parameters with a Gamma approximation (see reference for details).

map.p:

Object of class "numeric". The maximum posterior probability.

map.idx:

Object of class "numeric". The index of the prior support corresponding to the maximum a posteriori (MAP), i.e. MAP - n1 + 1.

map:

Object of class "numeric". The MAP of the population size.

qlow.p:

Object of class "numeric". The probability of the left endpoint (q1) of the credible interval. Default confidence level 95%.

qlow.idx:

Object of class "integer". The index of the prior support corresponding to q1.

qlow:

Object of class "numeric". The left endpoint (q1) of the credible interval.

qlow.cum:

Object of class "numeric". The cumulative posterior probability from n1 to q1, i.e. the left tail.

qup.p:

Object of class "numeric". The probability of the right endpoint (q2) of the credible interval. Default confidence level 95%.

qup.idx:

Object of class "integer". The index of the prior support corresponding to q2.

qup:

Object of class "numeric". The right endpoint (q2) of the credible interval.

qup.cum:

Object of class "numeric". The cumulative posterior probability from q2 to n2, i.e. the right tail.

gamma:

Object of class "logical". TRUE if the posterior was computed using a Gamma approximation (see reference for details).

Author(s)

Federico Comoglio, federico.comoglio@bsse.ethz.ch

References

Comoglio F, Fracchia L and Rinaldi M (2013) Bayesian inference from count data using discrete uniform priors. PLOS ONE, to appear

See Also

newCounts

Examples

1
2
3
4
5
# create an object of class 'Counts' by using new
new('Counts', counts = c(30, 35), fractions = c(0.075, 0.1))

#or by means of the constructor
newCounts(counts = c(30, 35), fractions = c(0.075, 0.1))

dupiR documentation built on May 2, 2019, 3:43 a.m.