| RiemannL2sim | R Documentation |
This class is created to set up a simulations scenario, simulate data from it, fit models, do cross-validation, predict quantities of interest, and summarize relevant statistics in an easy and transparent way.
The methods depend on the magrittr %>% operator and dplyr::bind_rows.
And, if messaging is desired, on the R-package telegram.
model0the underlying true model object.
newdata0_FDboostthe data used for sampling in FDboost format.
new_mf0a clone of the mfGeometry of model0 with newdata0.
new_pred0_predictions of model0 on newdata0.
sessionInfothe result of sessionInfo() executed at initialization.
new_effect0effects of model0 evaluated on newdata0.
new_fac0tensor-product factorization of model0 on newdata0.
seedthe random seed used for the simulation.
na vecor of length three of the form c(n_sim = NA, n_obj = NA, n_grid = NA) containing the specified (average) sample sizes.
simdatathe simulated dataset.
clusterthe cluster id used for parallel computing.
familythe family object used.
mfboost_controlthe list specified for controlling mboost in the model fits.
modelsthe fitted model objects.
runtimethe runtime of the model fits.
warningswarnings produced during model fits.
cvrisk_controla list of argument supplied to control the cross-validation.
cv_seedsseeds used for cross-validation.
cvscross-validation objects.
runtime_cvruntimes of the cross-validations.
warnings_cvwarnings produced during cross-validations.
preds_predictions of model fits in internal geometry format.
poles_poles predicted in internal geometry format.
effectseffects estimated on fitted models.
facsfactorized model fits.
simsumfirst simulation summary.
botTGbot object of R package telegram used for automized notifications.
namename of the simulation.
new()initialize simulation scenario.
RiemannL2sim$new(model0, newdata0 = NULL, name = NULL)
model0the model object with the underlying truth.
newdata0new data to simulate from. The default
NULL will take the data of model0.
namecharacter string, a name for the simulation scenario.
gridsampler()function sampling from the evaluations of a single response observation
RiemannL2sim$gridsampler(x, size)
xvector to be subsampled from
sizeaverage sample size
sample_topdown()function for sampling observations
RiemannL2sim$sample_topdown( n_sim = 1, n_obj = 1, n_grid = 40, seed = NULL, sample_obj = sample, sample_grid = self$gridsampler )
n_sim, n_obj, n_gridsample sizes
seedrandom seed
sample_objfunction to sample from objects.
sample_gridfunction to sample within objects.
sample_blockwise()function for sampling observations in a blockwise strategy to preserve covariate composition.
RiemannL2sim$sample_blockwise( n_sim = 1, n_blocks = 1, n_grid = 40, seed = NULL, random_trafo = function(y_) y_, sample_grid = self$gridsampler )
n_sim, n_gridsample sizes.
n_blocksnumber of blocks in each sample.
seedrandom seed. For the defaul NULL, the seed
is randomly drawn.
random_trafofunction taking y_ an returning it
after random transformations.
sample_gridfunction to sample within objects.
parallel_setup()initialize parallel computing
RiemannL2sim$parallel_setup(nc = detectCores())
ncnumber of cores.
parallel_stop()end parallel computing
RiemannL2sim$parallel_stop()
fit()fit simulated datasets
RiemannL2sim$fit(family = self$model0$family, ..., verbose = FALSE)
familymfFamily object used for fitting.
...arguments supplied to mboost control argument.
verboselogical, should live info be printed.
crossvalidate()conduct cross-validations of fitted models.
RiemannL2sim$crossvalidate( type = "kfold", B = 5, ..., verbose = FALSE, seeds = NULL )
typetype of resampling (as for mboost).
Bnumber of resampling folds.
...other arguments supplied to cvLong.
verboselogical, should live info be printed?
seedsvector of random seeds for cross-validation. For the
default NULL, seeds are randomly drawn.
predict()predict model0 and models and extract estimated effects.
RiemannL2sim$predict()
summarize()generate simulation summary
RiemannL2sim$summarize()
notify()send automated notifications via telegram using the R package telegram. For getting started see their package vignette.
RiemannL2sim$notify(token = bot_token("RBot"), id = user_id("me"), name = NULL)tokentelegram bot token, see ?telegram::bot_token.
idtelegram user id, see ?telegram::user_id.
namesimulation name attached to the notification.
plot()make first summary for first inspection of results.
RiemannL2sim$plot()
clone()The objects of this class are cloneable with this method.
RiemannL2sim$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.