get_zib_likelihood: Zero-Inflated Binomial Log-Likelihood

Description Usage Arguments Details Value Examples

Description

get_zib_likelihood retuns the log-likelihood of observed counts of detection at n_sites tested n_tests times each, given a certain probability of occupancy and conditional probability of detection given site is occupied.

Usage

1

Arguments

params

Numeric vector of length 2, where the first value is the probability of occupancy and the second is the probability of detection conditional on occupancy

data

Data.frame with at least two columns: one named obs_counts with the observed counts at each site, and once called n_tests with the number of tests per sites

Details

The Likehood function is described in equation (2) of Royle and Nichols (2003).

Royle, J. A., & Nichols, J. D. (2003). Estimating abundance from repeated presence–absence data or point counts. Ecology, 84(3), 777–790. http://doi.org/10.1890/0012-9658(2003)084[0777:EAFRPA]2.0.CO;2

Value

The log-likelihood of the data given the parameter values under a model of Zero-Inflated Binomial

Examples

1
2
data <- maldetectr::sim_zib_data( n_sites = 10, n_samples = 5, p_oc = 0.2, p_dt = 0.8 )
maldetectr::get_zib_likelihood( params = c( 0.5, 0.5 ), data = data )

andersgs/maldetectr documentation built on May 12, 2019, 2:41 a.m.