Last data update: 2014.03.03

R: Bayesian inference for behavioural effect models based on a...
BBRecap.custom.partR Documentation

Bayesian inference for behavioural effect models based on a partition of the set of all partial capture histories

Description

Bayesian inference for a general model framework based on the capture probabilities conditioned on each possible partial capture history. As suggested in Alunni Fegatelli and Tardella (2012) the conditional approach originally proposed in Farcomeni (2011) [saturated reparameterization] is reviewed in terms of partitions into equivalence classes of conditional probabilities. In this function the user can directly provide the model as a partition.

Usage

BBRecap.custom.part (data,last.column.count=FALSE, partition, neval = 1000, 
   by.incr = 1, prior.N = c("Rissanen", "Uniform", "one.over.N", "one.over.N2"),       
   output = c("base", "complete"))
    

Arguments

data

can be one of the following:

  1. an M by t binary matrix/data.frame. In this case the input is interpreted as a matrix whose rows contain individual capture histories for all M observed units

  2. a matrix/data.frame with (t+1) columns. The first t columns contain binary entries corresponding to capture occurrences, while the last column contains non negative integers corresponding to frequencies. This format is allowed only when last.column.count is set to TRUE

  3. a t-dimensional array or table representing the counts of the 2^t contingency table of binary outcomes

M is the number of units captured at least once and t is the number of capture occasions.

last.column.count

a logical. In the default case last.column.count=FALSE each row of the input argument data represents the complete capture history for each observed unit. When last.column.count is set to TRUE in each row the first t entries represent one of the observed complete capture histories and the last entry in the last column is the number of observed units with that capture history

partition

list. partition represents a partition of the set of all partial capture histories.

neval

a positive integer. neval is the number of values of the population size N where the posterior is evaluated starting from M. The default value is neval=1000.

by.incr

a positive integer. by.incr represents the increment on the sequence of possible population sizes N where the posterior is evaluated. The default value is by.incr=1. The use of by.incr>1 is discouraged unless the range of N values of interest is very large

prior.N

a character. prior.N is the label for the prior distribution for N. When prior.N is set to "Rissanen" (default) the Rissanen prior is used as a prior on N. This distribution was first proposed in Rissanen 1983 as a universal prior on integers. prior.N="Uniform" stands for a prior on N proportional to a constant value. prior.N="one.over.N" stands for a prior on N proportional to 1/N. prior.N="one.over.N2" stands for a prior on N proportional to 1/N^2.

output

a character. output selects the kind of output from a very basic summary info on the posterior output (point and interval estimates for the unknown N) to more complete details

Details

Uniform prior distribution is considered for the nuisance parameters.

Value

Prior

prior distribution for N.

N.hat.mean

posterior mean for N

N.hat.median

posterior median for N

N.hat.mode

posterior mode for N

N.hat.RMSE

minimizer of a specific loss function connected with the Relative Mean Square Error.

HPD.N

95 % highest posterior density interval estimate for N.

log.marginal.likelihood

log marginal likelihood.

N.range

values of N considered.

posterior.N

values of the posterior distribution for each N considered

partition

partition of the set H

Author(s)

Danilo Alunni Fegatelli and Luca Tardella

References

Alunni Fegatelli, D. and Tardella, L. (2012) Improved inference on capture recapture models with behavioural effects. Statistical Methods & Applications Applications Volume 22, Issue 1, pp 45-66 10.1007/s10260-012-0221-4

Farcomeni A. (2011) Recapture models under equality constraints for the conditional capture probabilities. Biometrika 98(1):237–242

See Also

partition.ch, LBRecap.custom.part, BBRecap

Examples

data(greatcopper)
partition.Mc1=partition.ch(quant.binary,t=ncol(greatcopper),breaks=c(0,0.5,1))
mod.Mc1=BBRecap.custom.part(greatcopper,partition=partition.Mc1)
str(mod.Mc1)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BBRecapture)
Loading required package: HI
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: lme4
Loading required package: Matrix
Loading required package: secr
This is secr 2.10.3. For overview type ?secr
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BBRecapture/BBRecap.custom.part.Rd_%03d_medium.png", width=480, height=480)
> ### Name: BBRecap.custom.part
> ### Title: Bayesian inference for behavioural effect models based on a
> ###   partition of the set of all partial capture histories
> ### Aliases: BBRecap.custom.part
> ### Keywords: Behavioural models Bayesian inference
> 
> ### ** Examples
> 
> data(greatcopper)
> partition.Mc1=partition.ch(quant.binary,t=ncol(greatcopper),breaks=c(0,0.5,1))
> mod.Mc1=BBRecap.custom.part(greatcopper,partition=partition.Mc1)
> str(mod.Mc1)
List of 4
 $ Prior.N                : chr "Rissanen"
 $ N.hat.RMSE             : num 88
 $ HPD.N.                 : num [1:2] 58 151
 $ log.marginal.likelihood: num -170
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>