Learn R Programming

unmarked (version 1.4.3)

gpcount: Generalized binomial N-mixture model for repeated count data

Description

Fit the model of Chandler et al. (2011) to repeated count data collected using the robust design. This model allows for inference about population size, availability, and detection probability.

Usage

gpcount(lambdaformula, phiformula, pformula, data,
mixture = c("P", "NB", "ZIP"), K, starts, method = "BFGS", se = TRUE,
engine = c("C", "R"), threads=1, ...)

Value

An object of class unmarkedFitGPC

Arguments

lambdaformula

Right-hand sided formula describing covariates of abundance.

phiformula

Right-hand sided formula describing availability covariates

pformula

Right-hand sided formula for detection probability covariates

data

An object of class unmarkedFrameGPC

mixture

Either "P", "NB", or "ZIP" for Poisson, negative binomial, or zero-inflated Poisson distributions

K

The maximum possible value of M, the super-population size.

starts

Starting values

method

Optimization method used by optim

se

Logical. Should standard errors be calculated?

engine

Either "C" or "R" for the C++ or R versions of the likelihood. The C++ code is faster, but harder to debug.

threads

Set the number of threads to use for optimization in C++, if OpenMP is available on your system. Increasing the number of threads may speed up optimization in some cases by running the likelihood calculation in parallel. If threads=1 (the default), OpenMP is disabled.

...

Additional arguments to optim, such as lower and upper bounds

Author

Richard Chandler rbchan@uga.edu

Details

The latent transect-level super-population abundance distribution \(f(M | \mathbf{\theta})\) can be set as either a Poisson, negative binomial, or zero-inflated Poisson random variable, depending on the setting of the mixture argument. The expected value of \(M_i\) is \(\lambda_i\). If \(M_i \sim NB\), then an additional parameter, \(\alpha\), describes dispersion (lower \(\alpha\) implies higher variance). If \(M_i \sim ZIP\), then an additional zero-inflation parameter \(\psi\) is estimated.

The number of individuals available for detection at time j is a modeled as binomial: \(N_{ij} \sim Binomial(M_i, \mathbf{\phi_{ij}})\).

The detection process is also modeled as binomial: \(y_{ikj} \sim Binomial(N_{ij}, p_{ikj})\).

Parameters \(\lambda\), \(\phi\) and \(p\) can be modeled as linear functions of covariates using the log, logit and logit links respectively.

References

Royle, J. A. 2004. N-Mixture models for estimating population size from spatially replicated counts. Biometrics 60:108--105.

Chandler, R. B., J. A. Royle, and D. I. King. 2011. Inference about density and temporary emigration in unmarked populations. Ecology 92:1429-1435.

See Also

gmultmix, gdistsamp, unmarkedFrameGPC

Examples

Run this code
set.seed(54)

nSites <- 20
nVisits <- 4
nReps <- 3

lambda <- 5
phi <- 0.7
p <- 0.5

M <- rpois(nSites, lambda) # super-population size

N <- matrix(NA, nSites, nVisits)
y <- array(NA, c(nSites, nReps, nVisits))
for(i in 1:nVisits) {
    N[,i] <- rbinom(nSites, M, phi) # population available during vist j
}
colMeans(N)

for(i in 1:nSites) {
    for(j in 1:nVisits) {
        y[i,,j] <- rbinom(nReps, N[i,j], p)
    }
}

ym <- matrix(y, nSites)
ym[1,] <- NA
ym[2, 1:nReps] <- NA
ym[3, (nReps+1):(nReps+nReps)] <- NA
umf <- unmarkedFrameGPC(y=ym, numPrimary=nVisits)

if (FALSE) {
fmu <- gpcount(~1, ~1, ~1, umf, K=40, control=list(trace=TRUE, REPORT=1))

backTransform(fmu, type="lambda")
backTransform(fmu, type="phi")
backTransform(fmu, type="det")
}

Run the code above in your browser using DataLab