closedp.bc: Bias Correction for Closed Population Loglinear Models

View source: R/closedp.bc.R

closedp.bcR Documentation

Bias Correction for Closed Population Loglinear Models

Description

This function applies a bias correction to the abundance estimations obtained by closed population models.

Usage

closedp.bc(X, dfreq=FALSE, dtype=c("hist","nbcap"), t=NULL, t0=t,
           m=c("M0","Mt","Mh","Mth","Mb","Mbh"), h=NULL, h.control=list(), ...)

## S3 method for class 'closedp.bc'
print(x, ...)

Arguments

X

The matrix of the observed capture histories (see Rcapture-package for a description of the accepted formats).

dfreq

A logical. By default FALSE, which means that X has one row per unit. If TRUE, it indicates that the matrix X contains frequencies in its last column.

dtype

A characters string, either "hist" or "nbcap", to specify the type of data. "hist", the default, means that X contains complete observed capture histories. "nbcap" means that X contains numbers of captures (see Rcapture-package for details on data formats). If m is "Mt", "Mth", "Mb" or "Mbh", dtype must be "hist".

t

Requested only if dtype="nbcap". A numeric specifying the total number of capture occasions in the experiment.

t0

A numeric used for model M0 or for an Mh model other than Chao's lower bound model : Models are fitted considering only the frequencies of units captured 1 to t0 times. By default t0=t.

m

A character string indicating the model to fit, either "M0"=M0 model, "Mt"=Mt model, "Mh"=Mh model, "Mth"=Mth model, "Mb"=Mb model, "Mbh"=Mbh model.

h

A character string ("LB", "Chao", "Poisson", "Darroch" or "Gamma") or a numerical R function specifying the form of the column(s) for heterogeneity in the design matrix.
"LB" and "Chao" represents Chao's lower bound model (the default),
"Poisson" represents the function f(k)=theta^k-1,
"Darroch" represents the function f(k)=k^2/2,
and "Gamma" represents the function f(k)=-log(theta + k) + log(theta)
where k is the number of captures and theta is a parameter specified with the argument theta.
If an R function is given, it must be the implementation of any convex mathematical function f(k) (it must have only one argument).

h.control

A list of elements to control the heterogeneous part of the model, if any.
For a Poisson or Gamma heterogeneous model:

theta

The value of the parameter theta in f(k)=theta^k-1 for the Poisson model (the default value is 2) and in f(k)=-log(theta + k) + log(theta) for the Gamma model (the default value is 3.5).

For the Chao's lower bound Mth model:

neg

If this option is set to TRUE (the default), negative eta parameters in Chao's lower bound models are set to zero.

...

Further arguments to be passed to glm or print.default.

x

An object, produced by the closedp.bc function, to print.

Details

For the Mt model:
When t=2, closedp.bc returns the Petersen estimator with Chapman's (1951) bias correction and the bias corrected standard error estimator of Seber (1970) and Wittes (1972). For t>2, closedp.bc implements the bias correction of Rivest and Levesque (2001). The estimate for N and its variance are calculated by solving an estimating equation as proposed in Seber (1982), not by fitting a Poisson regression. This approach works for large values of t.

For other models:
The bias correction is done through frequency modifications in Poisson regression as described in Rivest and Levesque (2001). The variances calculated with the modified frequencies are less biased than the standard ones, but they can overestimate the mean squared errors, especially when the data is sparse.

This function works with fairly large data set, except if an "Mth" model is requested. In this case, only heterogeneity of the form "LB", "Chao", "Poisson" with theta=2 or "Darroch" is accepted.

Value

n

The number of captured units

t

The total number of capture occasions in the data matrix X.

t0

For models M0 and Mh only: the value of the argument t0 used in the computations.

results

A table containing, for the fitted model:

abundance:

the estimated population size,

stderr:

the standard error of the estimated population size,

infoFit:

a numerical code giving information about error or warnings encountered when fitting the model (see Rcapture-package for details).

glm.warn

Only if the corrected population size estimation was obtained with glm: A vector of character strings. If the glm function generates one or more warnings when fitting the model, a copy of these warnings are stored in glm.warn. NULL if glm did not produce any warnings.

neg.eta

For Chao's lower bound model Mth only: the position of the eta parameters set to zero in the loglinear parameter vector, if any.

Note

This function uses the glm function of the stats package, except for models Mt and Mh Chao's lower bound for which exact calculation is performed.

Author(s)

Louis-Paul Rivest Louis-Paul.Rivest@mat.ulaval.ca and Sophie Baillargeon

References

Baillargeon, S. and Rivest, L.P. (2007) Rcapture: Loglinear models for capture-recapture in R. Journal of Statistical Software, 19(5), doi: 10.18637/jss.v019.i05.

Chapman, D. G. (1951) Some properties of the hypergeometric distribution with applications to zoological sample censuses. University of California Publications in Statistics, 1(7), 131-160.

Rivest, L.P. and Levesque, T. (2001) Improved loglinear model estimators of abundance in capture-recapture experiments. Canadian Journal of Statistics, 29, 555-572.

Seber, G.A.F. (1970) The effects of trap response on tag recapture estimates. Biometrics, 26, 13-22.

Seber, G.A.F. (1982) The Estimation of Animal Abundance and Related Parameters, 2nd edition. New York: Macmillan.

Wittes, J.T. (1972) On the bias and estimated variance of Chapman's two-sample capture-recapture population estimate. Biometrics, 28, 592-597.

See Also

closedp

Examples

# Third primary period of mvole data set
period3 <- mvole[, 11:15]
closedp.bc(period3, m = "Mh", h = "Darroch")
closedp.bc(period3, m = "Mh", h = "Gamma", h.control = list(theta = 3.5))

# BBS2001 data set
closedp.bc(BBS2001, dfreq = TRUE, dtype = "nbcap", t = 50, t0 = 20,
           m = "Mh", h = "Gamma", h.control = list(theta = 3.5))

# Seber (1982) p.107
# When there are 2 capture occasions, only models M0 and Mt can be fitted
X <- matrix(c(1,1,167,1,0,781,0,1,254), byrow = TRUE, ncol = 3)
closedp.bc(X, dfreq = TRUE, m = "M0")
closedp.bc(X, dfreq = TRUE, m = "Mt") 

Rcapture documentation built on May 4, 2022, 5:05 p.m.