Internal function used by openCR.fit
.
openCR.design(capthist, models, type, naive = FALSE, stratumcov = NULL,
sessioncov = NULL, timecov = NULL, agecov = NULL,
dframe = NULL, contrasts = NULL, initialage = 0,
minimumage = 0, maximumage = 1, agebreaks = NULL, CJSp1 = FALSE, ...)
A list with the components
list of reduced design matrices, one for each real parameter
index to row of the reduced design matrix for each real parameter; dim(parameterTable) = c(uniquepar, np), where uniquepar is the number of unique combinations of paramater values (uniquepar < \(nSKM\)) and np is the number of parameters in the detection model.
Parameter Index Array - index to row of parameterTable for a given animal, occasion and latent class; dim(PIA) = c(n,S,K,M)
for J primary sessions, a logical matrix of np rows and J columns, mostly
TRUE, but FALSE for impossible combinations e.g. CJS recapture
probability in session 1 (validlevels["p",1]) unless CJSp1 = TRUE
, or CJS final survival
probability (validlevels["phi",J]). Also, validlevels["b",1] is
FALSE with type = "JSSA..." because of the constraint that entry
parameters sum to one.
TRUE if uses individual variate(s)
levels for age factor (cut numeric ages) if `age' in model
single-session capthist
object
list of formulae for parameters of detection
character string for type of analysis "CJS", "JSSAfCL" etc. (see openCR.fit
)
logical if TRUE then modelled parameter is for a naive animal (not caught previously)
optional vector or dataframe of values of occasion-specific covariate(s).
optional dataframe of values of stratum-specific covariate(s)
optional dataframe of values of session-specific covariate(s)
optional dataframe of values of age-specific covariate(s)
optional data frame of design data for detection parameters
contrast specification as for model.matrix
numeric or character (name of individual covariate containing initial ages)
numeric; ages younger than minimum are truncated up
numeric; ages older than maximum are truncated down
numeric vector of age-class limits
logical; if TRUE detection is modelled on first primary session in CJS models
other arguments passed to the R function model.matrix
This is an internal openCR function that you are unlikely ever
to use. ... may be used to pass contrasts.arg
to
model.matrix
.
Each real parameter is notionally different for each unique combination of individual, secondary session, detector and latent class, i.e., for \(n\) individuals, \(S\) secondary sessions, \(K\) detectors and \(m\) latent classes there are potentially \(n \times S \times K \times m \) different values. Actual models always predict a much reduced set of distinct values, and the number of rows in the design matrix is reduced correspondingly; a parameter index array allows these to retrieved for any combination of individual, session and detector.
openCR.design
is less tolerant than openCR.fit
regarding
the inputs `capthist' and `models'. Model formulae are processed by openCR.fit
to a standard form (a named list of formulae) before they are passed to
openCR.design
, and multi-session capthist objects are
automatically `reduced' and `joined' for open-population analysis.
If timecov
is a single vector of values (one for each secondary session)
then it is treated as a covariate named `tcov'.
If sessioncov
is a single vector of values (one for each primary session)
then it is treated as a covariate named `scov'.
The initialage
and maximumage
arguments are usually passed via the
openCR.fit
`details' argument.
agecov
may be used to group ages. It should have length (or number of rows)
equal to maximumage
+ 1. Alternatively, age classes may be defined with the argument agebreaks
; this is preferred from openCR 2.2.6.
openCR.fit
## this happens automatically in openCR.fit
ovenCH1 <- join(reduce(ovenCH, by = "all", newtraps=list(1:44)))
openCR.design (ovenCH1, models = list(p = ~1, phi = ~session),
interval = c(1,1,1,1), type = "CJS")
Run the code above in your browser using DataLab