| make.scenarios | R Documentation |
This function prepares a dataframe in which each row specifies a
simulation scenario. The dataframe is used as input to run.scenarios.
make.scenarios(trapsindex = 1, noccasions = 3, nrepeats = 1,
D, g0, sigma, lambda0, epsilon, tau, z,
detectfn = 0, recapfactor = 1, popindex = 1, detindex = 1, fitindex = 1,
groups, crosstraps = TRUE)
trapsindex |
integer vector determining the traps object to use |
noccasions |
integer vector for the number of sampling occasions |
nrepeats |
integer vector of multipliers for D (see Details) |
D |
numeric vector of values for the density parameter (animals / hectare) |
g0 |
numeric vector of values for the g0 parameter |
sigma |
numeric vector of values for the sigma parameter (m) |
lambda0 |
numeric vector of values for the lambda0 parameter |
epsilon |
numeric vector of values for the epsilon parameter (m) |
tau |
numeric vector of values for the tau parameter (OU correlation) |
z |
numeric vector of values for the z parameter |
detectfn |
vector of valid detection function codes (numeric or character) |
recapfactor |
numeric vector of values for recapfactor
( |
popindex |
integer vector determining which population model is used |
detindex |
integer vector determining which detection options are used |
fitindex |
integer vector determining which model is fitted |
groups |
character vector of group labels (optional) |
crosstraps |
logical; if TRUE the output includes all
combinations of
|
The index in trapsindex is used in run.scenarios to
select particular detector arrays from the list of arrays provided as
an argument to that function.
The function generates all combinations of the given parameter values
using expand.grid. By default, it also generates
all combinations of the parameters with trapsindex and the
number of sampling occasions. If crosstraps is FALSE then
trapsindex, noccasions, and nrepeats are merely
used to fill in these columns in the output dataframe.
Use the detection parameters (g0, sigma, lambda0, epsilon, tau, z) that apply
for the chosen detection function (detectfn). Others will be ignored.
Detectfn 20 (Ornstein-Uhlenbeck) is currently available in secrdesign
but not in secr (see simOU.capthist).
It uses epsilon, sigma and tau (= 1/beta).
Designs may use multiple detector arrays with the same internal
geometry (e.g., number and spacing of traps). The number of such
arrays is varied with the nrepeats argument. For example, you
may compare designs with many small arrays or a few large ones. In
practice, run.scenarios simulates a single layout with density
D * nrepeats. This shortcut is not appropriate when
animals compete for traps (detector = ‘single’).
fitindex allows a choice of different models when the argument
fit.args of run.scenarios is a compound list.
If groups is provided each scenario is replicated to the length of groups and a column ‘group’ is added.
Dataframe with one row per scenario (or sub-scenario) and the columns
scenario |
a number identifying the scenario |
group |
(optional) |
trapsindex |
|
noccasions |
|
nrepeats |
|
D |
|
... |
|
[parameters appropriate to detectfn] |
|
... |
|
detectfn |
see |
recapfactor |
|
popindex |
|
detindex |
|
fitindex |
An attribute ‘inputs’ is saved for possible use in make.array.
run.scenarios, scenarioSummary, sim.capthist
make.scenarios(trapsindex = 1, nrepeats = 1, D = c(5,10), sigma = 25,
g0 = 0.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.