predict.simulations: Extract Estimates From Fitted Models

Description Usage Arguments Details Value Note See Also Examples

Description

If simulations have been saved from run.scenarios as fitted secr models it is necessary to use one of these functions to extract estimates for later summarization.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'fittedmodels'
predict(object, ...)

## S3 method for class 'fittedmodels'
coef(object, ...)

## S3 method for class 'fittedmodels'
derived(object, ...)

## S3 method for class 'fittedmodels'
region.N(object, ...)

Arguments

object

fitted model simulation output from run.scenarios

...

other arguments passed to predict, coef, derived or region.N

Details

These functions are used when output from run.scenarios has been saved as fitted models. derived and region.N require a full fit (including the mask and design0 objects) whereas a trimmed model is sufficient for predict and coef.

derived is used to compute the Horvitz-Thompson-like estimate of density when secr.fit has been used with CL = TRUE; it is roughly equivalent to predict.

region.N predicts the realised number (R.N) or expected number (E.N) in a masked area. When detector layouts and/or sigma vary, the masked area will also vary (arbitrarily, depending on the buffer argument ‘xsigma’) unless a mask is provided by the user; this may be done either in run.scenarios or in region.N.

Value

An object with class (‘estimatetables’, ‘secrdesign’, ‘list’) with appropriate outputtype (‘predicted’, ‘coef’, ‘derived’, ‘regionN’; see also run.scenarios).

Note

From secrdesign 2.5.3 the methods described here replace the functions derived.SL and regionN.SL. This is for compatibility with secr.

See Also

run.scenarios coef.secr predict.secr derived.secr region.N.secr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
scen1 <- make.scenarios(D = c(3,6), sigma = 25, g0 = 0.2)
traps1 <- make.grid()  ## default 6 x 6 grid of multi-catch traps
tmp1 <- run.scenarios(nrepl = 10, trapset = traps1, scenarios = scen1,
    fit = TRUE, extractfn = trim)
tmp2 <- predict(tmp1)
tmp3 <- select.stats(tmp2, 'D', c('estimate','RB','RSE'))
summary(tmp3)

## for derived and region.N need more than just 'trimmed' secr object
## use argument 'keep' to save mask and design0 usually discarded by trim
tmp4 <- run.scenarios(nrepl = 10, trapset = traps1, scenarios = scen1,
    fit = TRUE, extractfn = trim, keep = c('mask','design0'))

summary(derived(tmp4))

## for region.N we must specify the parameter for which we want statistics
## (default 'D' not relevant)
tmp5 <- select.stats(region.N(tmp4), parameter = 'E.N')
summary(tmp5)

## End(Not run)

secrdesign documentation built on Dec. 5, 2017, 1:02 a.m.