simsalapar-package {simsalapar} | R Documentation |
Tools for Simulation Studies in Parallel with R
Description
Tools for setting up, conducting, and evaluating larger-scale simulation studies, including parallel computations, in R.
Details
The DESCRIPTION file:
Package: | simsalapar |
Version: | 1.0-12 |
Date: | 2023-04-26 |
Title: | Tools for Simulation Studies in Parallel |
Description: | Tools for setting up ("design"), conducting, and evaluating large-scale simulation studies with graphics and tables, including parallel computations. |
Author: | Marius Hofert and Martin Maechler <maechler@stat.math.ethz.ch> |
Maintainer: | Marius Hofert <mhofert@hku.hk> |
Depends: | R (>= 3.1.0), graphics |
Imports: | stats, parallel, utils, grDevices, methods, grid, sfsmisc, gridBase (>= 0.4-6), colorspace |
Suggests: | lattice, Rmpi, Hmisc, copula, foreach, doParallel, fGarch, robustbase |
SuggestsNote: | copula is only used for the vignettes, see their VignetteDepends; fGarch: only used in demo(TGforecasts), robustbase in another demo. |
KeepSource: | yes |
License: | GPL-2 | GPL-3 |
Encoding: | UTF-8 |
Index of help topics:
dev.off.pdf Cropping and Font Embedding PDF Device doCallWE Innermost Computation: Error Catching Version of do.call() doCheck Checking a User's doOne doLapply Functions for Iterating Over All Subjobs expr2latex Translate 'plotmath' expressions to LaTeX getEl Tools For Working with Variable Specification Lists LEseeds Advancing .Random.seed for "L'Ecuyer-CMRG" mayplot Matrix-like Plot for Arrays up to Rank 5 simsalapar-package Tools for Simulation Studies in Parallel with R subjob Subjob - Compute one Row of the Virtual Grid toLatex.ftable Convert Flat Contingency Table (ftable) and VarLists to LaTeX Table tryCatch.W.E Catching and Storing Warnings and Errors Simultaneously ul Tools For Converting To and From Arrays, Lists, and Array of Lists varlist Variable Specification List - Generation and Class wrapLaTable Wrapper for a floating LaTeX Table
Setting up a simulation
varlist
()creates a variable specification list.
- dimnames2varlist()
creates a variable specification list from given dimension names.
- getEl()
extracts elements from a variable list.
- mkGrid()
function for creating a grid of all variables of type “grid”; see
mkGrid()
.- mkNms()
builds a list of names from a variable list; see
mkNms()
.- get.n.sim()
extracts “n.sim”; see
get.n.sim()
.- get.nonGrids()
extracts all variables not of type “grid”; see
get.nonGrids()
.
Conducting a simulation
- tryCatch.W.E()
catching and storing warnings and errors simultaneously; see
tryCatch.W.E()
.- doCallWE()
innermost computation (return value of doOne()): returns value, error, warning, and run time; see
doCallWE()
.- LEseeds()
create a list of advanced
.Random.seed
's for “L'Ecuyer-CMRG”; seeLEseeds()
.- printInfo()
displays information about the sub-job just finished; see
printInfo()
.- subjob()
computes one row of the virtual grid in a simulation; see
subjob()
.- mkTimer()
creates a function to be passed to doCallWE() as timer; see
mkTimer()
.doLapply()
sequentially iterates over all subjobs via standard
lapply()
.doForeach()
iterates over all subjobs in parallel (via
foreach()
, package foreach).doRmpi()
iterates over all subjobs in parallel (via Rmpi's
mpi.apply()
).doMclapply()
iterates over all subjobs in parallel (via
mclapply()
).doClusterApply()
iterates over all subjobs in parallel (via
clusterApply()
).
Analysis
- doRes.equal()
convenience wrapper for comparing two results of the
do*
lapply-like functions; seedoRes.equal()
.- mkAL()
converts a list of named 5-lists to an array of lists; see
mkAL()
.- saveSim()
(optionally) converts a result list to an array of lists using mkAL(); see
saveSim()
.- maybeRead()
(optionally) reads the provided
.rds
; seemaybeRead()
.- getArray()
gets an array of 4-lists and computes an array of values, errors, warnings, or run times; see
getArray()
.array2df()
conveniently converts an array to a
data.frame
.toLatex()
:an S3 method for varlist and ftable.
fftable()
essentially calls
format.ftable()
and adds attributesncv
andnrv
to the return object.tablines()
computes ingredients for converting a character matrix with attributes to a LaTeX table.
wrapLaTable()
wraps a table and tabular environment around the lines of the body of a LaTeX table.
mayplot()
:a matrix-like plot for arrays up to rank 5, with grid and gridBase.
Author(s)
Marius Hofert and Martin Maechler <maechler@stat.math.ethz.ch>
Maintainer: Marius Hofert <marius.hofert@math.ethz.ch>
References
- Publication
-
Marius Hofert, Martin Maechler (2016). Parallel and Other Simulations in R Made Easy: An End-to-End Study. Journal of Statistical Software, 69(4), 1–44. doi:10.18637/jss.v069.i04
- Preprint (for simsalapar 1.0-0; including timing info):
-
Hofert, M. and Mächler, M. (2013). Parallel and other simulations in R made easy: An end-to-end study. https://arxiv.org/abs/1309.4402
Examples
## Not run:
demo(TGforecasts)
## End(Not run)