subjob | R Documentation |
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.
subjob(i, pGrid, nonGrids, n.sim, seed, keepSeed = FALSE,
repFirst = TRUE, doOne,
timer = mkTimer(gcFirst=FALSE), monitor = FALSE, ...)
printInfo # or
# printInfo[["default"]]
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 |
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).
is a named list
of
function
s which produce output (cat(..)
)
containing information about the sub-job which subjob()
has
just finished. Note that components "gfile"
(“global file”) and "fileEach"
each direct the
monitoring output to files.
returns a vector of length five if keepSeed
is true
and seed
is not NA
, otherwise (also by default), of
length four. The first four components contain the
return value of doCallWE()
. If keepSeed
is
true, the fifth component contains .Random.seed
before the call of doCallWE()
(for reproducibility).
Marius Hofert and Martin Maechler.
doCallWE()
; .Random.seed
for
information about random number generators and seeds.
For examples of implicit use of subjob
, see
doLapply
.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.