model.average(..., realnames = NULL, betanames = NULL, newdata = NULL,
alpha = 0.05, dmax = 10, covar = FALSE, average = "link")
collate (..., realnames = NULL, betanames = NULL, newdata = NULL,
scaled = FALSE, alpha = 0.05, perm = 1:4, fields = 1:4)
secr
objectscollate
model.average
, an array of model-averaged estimates, their
standard errors, and a $100(1-\alpha)$% confidence
interval. The interval for real parameters is backtransformed from the
link scale. If there is only one row in newdata
or beta
parameters are averaged or averaging is requested for only one parameter
then the array is collapsed to a matrix. If covar = TRUE
then a
list is returned with separate components for the estimates and the
variance-covariance matrices.
For collate
, a 4-dimensional array of model-specific parameter
estimates. By default, the dimensions correspond respectively to rows in
newdata
(usually sessions), models, statistic fields (estimate, SE.estimate, lcl,
ucl), and parameters ("D", "g0" etc.). For particular comparisons it often helps
to reorder the dimensions with the perm
argument.model.average
may conflict with a method of the
same name in realnames
==
NULL and betanames
== NULL then all real parameters will be
averaged; in this case all models must use the same real parameters. To
average beta parameters, specify betanames
(this is ignored if a
value is provided for realnames
). See predict.secr
for an explanation of the optional argument newdata
;
newdata
is ignored when averaging beta parameters.
Model-averaged estimates for parameter $\theta$ are given by
$$\hat{\theta} = \sum\limits _k w_k \hat{\theta}_k$$ where the subscript $k$ refers to a specific
model and the $w_k$ are AIC weights with small sample adjustment
(see AIC.secr
for details). Averaging of real parameters
may be done on the link scale before back-transformation
(average="link"
) or after back-transformation
(average="real"
).
Models for which dAICc > dmax
are given a weight of zero and
effectively are excluded from averaging.
Also, $$\mbox{var} (\hat{\theta}) = \sum\limits _{k} { w_{k}
( \mbox{var}(\hat{\theta}_{k} | \beta _k) + \beta _k ^2)}$$
where $\hat{\beta} _k = \hat{\theta}_k - \hat{\theta}$ and the variances are asymptotic estimates
from fitting each model $k$. This follows Burnham and Anderson
(2004) rather than Buckland et al. (1997).
collate
extracts parameter estimates from a set of fitted secr
model objects. fields
may be used to select a subset of summary
fields ("estimate","SE.estimate","lcl","ucl") by name or number.
The argument scaled
applies only to the detection parameters g0
and sigma, and only to models fitted with scalesigma
or
scaleg0
switched on. If scaled
is TRUE then each estimate is multiplied by
its scale factor (1/D^0.5 and 1/sigma^2 respectively).AIC.secr
, secr.fit
## Compare two models fitted previously
## secrdemo.0 is a null model
## secrdemo.b has a learned trap response
model.average(secrdemo.0, secrdemo.b)
model.average(secrdemo.0, secrdemo.b, betanames = c("D","g0","sigma"))
## In this case we find the difference was actually trivial...
## (subscripting of output is equivalent to setting fields = 1)
collate (secrdemo.0, secrdemo.b, perm = c(4,2,3,1))[,,1,]
Run the code above in your browser using DataLab