Learn R Programming

BBRecapture (version 0.2)

partition.ch: Partition of partial capture histories according to equivalence classes of numerical quantification corresponding to supplied intervals

Description

All the possible partial capture histories observable during a capture-recapture experiment with \(t\) sampling occasions can be partitioned according to numerical values corresponding to some meaningful covariate (quantification of binary sequences corresponding to partial capture histories). Each subset of the partition corresponds to all partial capture histories which returns numerical values of the quantification within one of the intervals represented by two consecutive values in the optional argument vector breaks.

Usage

partition.ch(quantify.ch.fun, t, breaks, include.lowest = T,
type = c("list", "index"), ...)

Arguments

quantify.ch.fun

a function which returns a numerical value for each possible partial capture history

t

an integer. t is number of trapping occasions

breaks

a vector of numerical values which are used as bounds for the interval of numerical values corresponding to partial capture histories that belongs to the same partition

include.lowest

a logical, indicating if an x[i] equal to the lowest (or highest, when right = FALSE) breaks value should be included

type

a character string. It can be either "list" or "index". See examples.

\dots

additional arguments to be passed to quantify.ch.fun

Value

If the argument type="list" a list is returned. If type="index" a numerical index corresponding to the numeric integer equivalent of the consecutive interval according to the convention used in objects of class factor

Details

It is useful in conjunction with LBRecap.custom.part. See examples.

References

REFERENCES

See Also

LBRecap.custom.part, BBRecap.custom.part

Examples

Run this code
# NOT RUN {
data(mouse)
head(mouse)
t=ncol(mouse)

Mc1.partition=partition.ch(quantify.ch.fun=quant.binary,t=t,breaks=c(0,0.5,1))
Mc1.partition

mod.Mc1.cust=BBRecap.custom.part(mouse,partition=Mc1.partition)
mod.Mc1.cust

mod.Mc1.easy=BBRecap(mouse,mod="Mc",markov.ord=1,output="complete")

mod.Mc1.easy$N.hat.RMSE
mod.Mc1.easy$HPD.N
mod.Mc1.easy$log.marginal.likelihood

# the two functions give the same results!


# }

Run the code above in your browser using DataLab