subjob {simsalapar} | R Documentation |
Subjob - Compute one Row of the Virtual Grid
Description
subjob()
computes one row of the virtual grid in a simulation
study, provides several seeding methods, and sub-job monitoring
(information about the sub-job just finished).
printInfo
is a named list of functions optionally to be used as
monitor
in subjob()
for printing information at the end of
each sub-job.
Usage
subjob(i, pGrid, nonGrids, n.sim, seed, keepSeed = FALSE,
repFirst = TRUE, doOne,
timer = mkTimer(gcFirst=FALSE), monitor = FALSE, ...)
printInfo # or
# printInfo[["default"]]
Arguments
i |
row number of the virtual grid. |
pGrid |
“physical grid” of all combinations of variables
of type |
nonGrids |
values of non-"grid"-variables (if provided, passed to
|
n.sim |
number of simulation replications. |
seed |
one of:
|
keepSeed |
|
repFirst |
|
doOne |
|
timer |
a |
monitor |
|
... |
additional arguments passed to |
Details
See the vignette or references in simsalapar-package
for
how to use these functions.
The case where seed
is a numeric
vector of length
n.sim
also leads to the same results no matter which variables
are of type “grid” or “inner”; see demo(robust.mean)
where
this is tested. This is important to guarantee since one might want to
change certain “inner” variables to “grid” variables due to
load-balancing while computing the desired statistics based on the
same seed (or generated data from this seed).
Value
- printInfo
is a named
list
offunction
s which produce output (cat(..)
) containing information about the sub-job whichsubjob()
has just finished. Note that components"gfile"
(“global file”) and"fileEach"
each direct the monitoring output to files.- subjob()
returns a vector of length five if
keepSeed
is true andseed
is notNA
, otherwise (also by default), of length four. The first four components contain the return value ofdoCallWE()
. IfkeepSeed
is true, the fifth component contains.Random.seed
before the call ofdoCallWE()
(for reproducibility).
Author(s)
Marius Hofert and Martin Maechler.
See Also
doCallWE()
; .Random.seed
for
information about random number generators and seeds.
For examples of implicit use of subjob
, see
doLapply
.
Examples
names(printInfo)# currently "default", "gfile", "fileEach"
str(printInfo, give.attr=FALSE)
## the functions in printInfo share a common environment() with utility functions:
ls.str(environment(printInfo$default))
if(FALSE) # show them all
as.list(environment(printInfo$default))