Methods to summarize simulated datasets.
# S3 method for secrdesign
summary(object, ...)# S3 method for rawdata
summary(object, ...)
# S3 method for estimatetables
summary(object, ...)
# S3 method for selectedstatistics
summary(object, fields = c('n', 'mean',
'se'), dec = 5, alpha = 0.05, type = c('list','dataframe','array'), ...)
# S3 method for selectedstatistics
plot(x, scenarios, statistic, type =
c('hist', 'CI'), refline, xlab = NULL, ...)
header(object)
List with components `header'
original function call
from object
from object
small dataframe with values of non-varying inputs
small dataframe with values of varying inputs
small dataframe with values arguments for secr.fit, if specified
and `OUTPUT', a list with one component for each field. Each component may be a list or an array.
object of class simulations from run.scenarios
number of decimal places in output
character vector; names of required summary statistics (see Details)
alpha level for confidence intervals and quantiles
character code for type of output (see Details)
other arguments -- not currently used by summary but
passed to hist
by the plot method
object of class `selectedstatistics' from
run.scenarios
integer indices of scenarios to plot (all plotted if not specified)
integer or character indices of the statistics in x for which histograms are requested
logical; if TRUE a reference line is plotted at the true value of a parameter
character; optional label for x-axis
If object
inherits from `selectedstatistics' then the numeric
results from replicate simulations are summarized using the chosen
`fields' (by default, the number of non-missing values, mean and standard
error), along with header information describing the
simulations. Otherwise the header alone is returned.
fields
is a vector of any selection from c(`n', `mean', `sd',
`se', `min', `max', `lcl', `ucl', `median', `q', `rms', `var'), or the
character value `all'.
Field `q' provides 1000 alpha/2
and 1000[1 - alpha/2
]
quantiles qxxx and qyyy.
`lcl' and `ucl' refer to the upper and lower limits of a 100(1 - alpha)% confidence interval for the statistic, across replicates.
`rms' gives the root-mean-square of the statistic - most useful for
the statistic `ERR' (see select.stats
) when it
represents the overall accuracy or RMSE.
The plot
method plots either (i) histograms of the selected
statistics (type = `hist') or (ii) the estimate and confidence interval for
each replicate (type = `CI'). The default for type = `hist' is to plot
the first statistic - this is usually `n' (number of detected animals)
when fit = FALSE
, and `estimate' (parameter estimate) when
fit = TRUE
. If length(statistic) > 1 then more than one plot
will be produced, so a multi-column or multi-row layout should be
prepared with par
arguments `mfcol' or `mfrow'.
For type = `CI' the statistics must include `estimate', `lcl' and `ucl' (or `beta', `lcl' and `ucl' if outputtype = `coef').
estimateSummary
is a simpler approach that provides full output
for models with groups or multiple sessions simulated in
run.scenarios
with extractfn predict or coef).
run.scenarios
,
make.array
,
select.stats
validate
estimateSummary
## collect raw counts
scen1 <- make.scenarios(D = c(5,10), sigma = 25, g0 = 0.2)
traps1 <- make.grid()
tmp1 <- run.scenarios(nrepl = 50, trapset = traps1, scenarios = scen1,
fit = FALSE)
opar <- par(mfrow=c(2,3))
plot(tmp1, statistic = 1:3)
par(opar)
summary(tmp1)
summary(tmp1, field=c('q025', 'median', 'q975'))
Run the code above in your browser using DataLab