Learn R Programming

secr (version 2.10.2)

pmixProfileLL: Mixture Model Check

Description

Compute the profile likelihood of a finite mixture model for a user-specified range of values for the mixing parameter. This provides a check on multimodality.

Usage

pmixProfileLL(CH, model = list(g0 ~ h2, sigma ~ h2), CL = TRUE, pmvals = seq(0.01,
 0.99, 0.01), pmi = 5, ncores = 1, ...)

Arguments

CH
capthist object
model
model as in secr.fit
CL
logical as in in secr.fit
pmvals
numeric vector of values for mixing parameter `pmix'
pmi
integer index of `pmix' in vector of coefficients (beta parameters) for the specified model
ncores
integer number of CPUs to use for parallel processing
...
other arguments passed to secr.fit

Value

  • Numeric vector of profile likelihoods.

Details

See secr-finitemixtures.pdf. Choosing the wrong value for pmi results in the error message "invalid fixed beta - require NP-vector". The easiest way to find the value of pmi is to inspect the output from a previously fitted mixture model - either count the coefficients or check fit$parindx$pmix (for a model named `fit'). It is assumed that `pmix' is the last real parameter in the model, and that pmix is constant.

Examples

Run this code
pmvals <- seq(0.02,0.99,0.02)
mask <- make.mask(traps(ovenCH[[1]]), nx = 32, buffer = 100)
## only g0 ~ h2, so reduce pmi
outPL <- pmixProfileLL(ovenCH[[1]], model = list(g0~h2), mask
= mask, pmvals, CL = TRUE, ncores = 5, pmi = 4) ## slow!
plot(pmvals, outPL, xlim = c(0,1),
xlab = 'Fixed pmix', ylab = 'Profile log-likelihood')

Run the code above in your browser using DataLab